LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-25-2008, 06:21 PM   #1
alpha01
Member
 
Registered: Jul 2008
Location: Orange County
Distribution: Ubuntu/Debian, CentOS, RHEL, FreeBSD, OS X
Posts: 75

Rep: Reputation: 19
Unable to send emails using mail command


Hello everyone,


I currently have a Debian Etch server configured and running. I was able to send emails using the mail command before. However as of today I'm not able to do so. I tried starting the /etc/init.d/sendmail script but I wasn't able to locate the service script or the config script either.

I have checked the system to see if it has working email server and was able to connect with out any problems. (telnet 127.0.0.1 25)

Any suggestions why I'm still not able to send emails using the mail command?
 
Old 07-25-2008, 07:18 PM   #2
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
What do your mail logs show (/var/log/maillog) ?

Last edited by Mr. C.; 07-28-2008 at 09:30 PM.
 
Old 07-28-2008, 06:15 PM   #3
alpha01
Member
 
Registered: Jul 2008
Location: Orange County
Distribution: Ubuntu/Debian, CentOS, RHEL, FreeBSD, OS X
Posts: 75

Original Poster
Rep: Reputation: 19
Quote:
Originally Posted by Mr. C. View Post
What do you mail logs show (/var/log/maillog) ?
I check the the /var/log directory and the following directories were empty mail.err mail.info mail.log mail.warn


Though I'm not sure why the daemon script(/etc/init.d/sendmail is not present in the system).


I appreciate your help.
Thanks!
 
Old 07-28-2008, 09:31 PM   #4
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
Show the output of :

telnet localhost 25
netstat -aln | grep 25
ls -l /usr/*/sendmail

Last edited by Mr. C.; 07-29-2008 at 03:05 PM.
 
Old 07-29-2008, 02:34 PM   #5
alpha01
Member
 
Registered: Jul 2008
Location: Orange County
Distribution: Ubuntu/Debian, CentOS, RHEL, FreeBSD, OS X
Posts: 75

Original Poster
Rep: Reputation: 19
Quote:
Originally Posted by Mr. C. View Post
Show the output of :

telnet localhost 25
netstat -rn | grep 25
ls -l /usr/*/sendmail


backup:~# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
220 backup ESMTP Exim 4.63 Tue, 29 Jul 2008 12:09:08 -0700

netstat -rn | grep 25
192.168.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1


ls -l /usr/*/sendmail
lrwxrwxrwx 1 root root 13 2008-03-11 11:33 /usr/lib/sendmail -> ../sbin/exim4
lrwxrwxrwx 1 root root 5 2008-03-11 11:33 /usr/sbin/sendmail -> exim4


/etc/init.d/exim4 status
checking separate queue runner daemon...done (not running).
checking combined SMTP listener and queue runner daemon...done (running).
 
Old 07-29-2008, 03:05 PM   #6
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
I don't know what startup scripts debian uses to startup exim's daemons. Perhaps it is /etc/init.d/exim or some variant.

What happens when you try to send mail ?

[ ps. my netstat command had a typo - the arguments should have been -aln ]
 
Old 07-29-2008, 11:14 PM   #7
avijitp
Member
 
Registered: May 2005
Location: India
Distribution: FC11, Debian/Ubuntu, RHEL, Solaris, AIX, HP-UX
Posts: 161

Rep: Reputation: 32
Your mail logs should be in /var/log/exim4. What are they saying? Need to check how exim is configured. Have a look into the /etc/exim.conf file.
 
Old 08-21-2008, 01:36 PM   #8
alpha01
Member
 
Registered: Jul 2008
Location: Orange County
Distribution: Ubuntu/Debian, CentOS, RHEL, FreeBSD, OS X
Posts: 75

Original Poster
Rep: Reputation: 19
Unhappy Email header leads to DNS Issue

I can't figure out why its a DNS issue
Code:
recipients. This is a permanent error. The following address(es) failed:

  tony.baltazar@trinetsolutions.com
    Unrouteable address

------ This is a copy of the message, including all the headers. ------

Return-path: <root@backup.trinetcom.com>
Received: from root by backup with local (Exim 4.63)
        (envelope-from <root@backup.trinetcom.com>)
        id 1KVUUn-0001tP-Rl; Tue, 19 Aug 2008 09:55:49 -0700
To: all@backup.trinetcom.com, finally@backup.trinetcom.com,
        messages@backup.trinetcom.com, removed@backup.trinetcom.com,
        tony.baltazar@trinetsolutions.com
Subject: test email
Message-Id: <E1KVUUn-0001tP-Rl@backup>
From: root <root@backup.trinetcom.com>
Date: Tue, 19 Aug 2008 09:55:49 -0700

backup:~# exim -Mvb 1KVUai-0001uJ-L4
1KVUai-0001uJ-L4-D
This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:

  tony.baltazar@trinetsolutions.com
    Unrouteable address

------ This is a copy of the message, including all the headers. ------

Return-path: <root@backup.trinetcom.com>
Received: from root by backup with local (Exim 4.63)
        (envelope-from <root@backup.trinetcom.com>)
        id 1KVUai-0001uH-JK
        for tony.baltazar@trinetsolutions.com; Tue, 19 Aug 2008 10:01:56 -0700
To: tony.baltazar@trinetsolutions.com
Subject: Test
Message-Id: <E1KVUai-0001uH-JK@backup>
From: root <root@backup.trinetcom.com>
Date: Tue, 19 Aug 2008 10:01:56 -0700

This is just a test mail
test mail two
 
Old 08-21-2008, 09:32 PM   #9
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
On your mail system, what is the output of :

host trinetsolutions.com
 
Old 08-22-2008, 01:19 PM   #10
alpha01
Member
 
Registered: Jul 2008
Location: Orange County
Distribution: Ubuntu/Debian, CentOS, RHEL, FreeBSD, OS X
Posts: 75

Original Poster
Rep: Reputation: 19
Quote:
Originally Posted by Mr. C. View Post
On your mail system, what is the output of :

host trinetsolutions.com
backup:~# host trinesolutions.com
trinesolutions.com has address 74.52.84.210
trinesolutions.com mail is handled by 0 trinesolutions.com.
 
Old 08-22-2008, 01:25 PM   #11
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
So now the question is, can you telnet to port 25 of that address:

telnet 74.52.84.210 25
 
Old 08-27-2008, 12:02 PM   #12
alpha01
Member
 
Registered: Jul 2008
Location: Orange County
Distribution: Ubuntu/Debian, CentOS, RHEL, FreeBSD, OS X
Posts: 75

Original Poster
Rep: Reputation: 19
Quote:
Originally Posted by Mr. C. View Post
So now the question is, can you telnet to port 25 of that address:

telnet 74.52.84.210 25

I mistype the hostname. It should be trinetsolutions.com not trinesolutions.com. I can't telnet to that host on port 25 because their is not mail server running on it (connection refused as well).

I removed the mail queue and restarted the exim 4 daemon and was able to send emails to different address successfully. But I still not able to send mail to any address in the trinetsolutions.com domain. Email header indicates that the hostname is unreachable. (DNS )
 
Old 08-27-2008, 02:08 PM   #13
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
Use the logs as your source of diagnostics, not the bounced mail message.

I see trinetsolutions.com mail is handled by:

Code:
$ host trinetsolutions.com 
trinetsolutions.com has address 216.177.75.66
trinetsolutions.com mail is handled by 30 aspmx2.googlemail.com.
trinetsolutions.com mail is handled by 30 aspmx3.googlemail.com.
trinetsolutions.com mail is handled by 30 aspmx4.googlemail.com.
trinetsolutions.com mail is handled by 30 aspmx5.googlemail.com.
trinetsolutions.com mail is handled by 10 aspmx.l.google.com.
trinetsolutions.com mail is handled by 20 alt1.aspmx.l.google.com.
trinetsolutions.com mail is handled by 20 alt2.aspmx.l.google.com.
So you'd have to telnet to one of the listed MX servers, not the trinetsolutions.com IP address shown.
 
Old 08-29-2008, 06:11 PM   #14
alpha01
Member
 
Registered: Jul 2008
Location: Orange County
Distribution: Ubuntu/Debian, CentOS, RHEL, FreeBSD, OS X
Posts: 75

Original Poster
Rep: Reputation: 19
Smile Issue Solve

It turned out the reason why exim wasn't able to email messages to the trinetsolutions.com domain is because the email server is configured to be part as a subdomain of it. This causes exim to get confused and found any address sent to that domain unreachable.


I appreciate you help Mr. C!!!

This command verified this:
exim -d -bt user@mydomain.com
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
unable to send mail using Mail command navin_karnam Linux - Newbie 3 05-13-2008 02:21 AM
command line email client to send mail to remote mail server dhanju Linux - Software 1 03-07-2008 06:37 AM
Unable to send mail using mail command faruque.ahmed Linux - Software 1 02-03-2007 10:29 AM
Unable to send mail to some mail servers due smtp greetings malformed atotomex Linux - Networking 6 12-20-2005 04:38 PM
swatch daemon is unable to send emails hari_seldon99 Linux - Software 2 12-18-2005 04:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration