LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Sendmail Issue? (https://www.linuxquestions.org/questions/linux-server-73/sendmail-issue-691100/)

your_shadow03 12-16-2008 10:42 PM

Sendmail Issue?
 
Whenever I am running this command on the command line on RHEL I am getting the error:

Code:

[root@EL385 ~]# echo "it is my job"| mail -vv aaina@gmail.com
WARNING: local host name (EL385) is not qualified; see cf/README: WHO AM I?
aaina@gmail.com... Connecting to [127.0.0.1] via relay...
220 ssa.loga.com ESMTP Sendmail 8.13.1/8.13.1; Wed, 17 Dec 2008 04:36:20 GMT
>>> EHLO
250-ssa.loga.com Hello localhost.localdomain [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-AUTH GSSAPI DIGEST-MD5 CRAM-MD5
250-DELIVERBY
250 HELP
>>> MAIL From:<root@EL385> SIZE=39 AUTH=root@EL385
250 2.1.0 <root@EL385>... Sender ok
>>> RCPT To:<aaina@gmail.com>
>>> DATA

Code:

Dec 17 04:35:19 tuxbuddy sendmail[5834]: My unqualified host name (EL385) unknown; sleeping for retry
Dec 17 04:38:12 EL385 sendmail[2347]: mBC8ASsl014838: to=<root@bl18dl385>, delay=4+20:26:28, xdelay=00:00:35, mailer=esmtp, pri=10473308, relay=EL385.logica.com., dsn=4.0.0, stat=Deferred: Name server: bl18dl385.loga.com.: host name lookup failure
Dec 17 04:38:52 EL385 sendmail[2347]: mBC4ASsl010087: to=<root@EL385>, delay=5+00:06:30, xdelay=00:00:40, mailer=esmtp, pri=10833438, relay=EL385.loga.com., dsn=4.0.0, stat=Deferred: Name server: EL385.loga.com.: host name lookup failure
Dec 17 04:38:52 EL385 sendmail[2347]: mBC4ASsl010087: mBH4Aaab002347: return to sender: Cannot send message for 5 days
Dec 17 04:38:52 EL385 sendmail[2347]: mBH4Aaab002347: to=root, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=34994, dsn=2.0.0, stat=Sent

I checked /etc/hosts file too but everything seems right?
Completely confused !!!

WW125599 12-16-2008 11:03 PM

Hi
This is not a proper format for the command.
#echo 'hai' | mail john@example.com
is the proper format to sent mail

And this case u are directly sending the mail to gamil domain and user name aaina.
So ur stub resolver should have the
Ip address of the gmail main server and gmail.com in the /etc/hosts
like this
10.24.3.140 gmail.com

and check whether u are getting the ping with ip and the hostname the both...

your_shadow03 12-16-2008 11:43 PM

The Entry is already there.
Here's the output again:
Code:

Dec 17 05:36:49 EL385 sendmail[15784]: unable to qualify my own domain name (EL385) -- using short name
Dec 17 05:36:49 EL385 sendmail[15784]: mBH5an5X015784: from=root, size=51, class=0, nrcpts=1, msgid=<200812170536.mBH5an5X015784@EL385>, relay=root@localhost
Dec 17 05:36:49 EL385 sendmail[16160]: mBH5anfN016160: <aaina@gmail.com>... User unknown
Dec 17 05:36:49 EL385 sendmail[15784]: mBH5an5X015784: to=amanda.uk.intinfra.com, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30051, relay=[127.0.0.1] [127.0.0.1], dsn=5.1.1, stat=User unknown
Dec 17 05:36:49 EL385 sendmail[16160]: mBH5anfN016160: from=<root@EL385>, size=51, class=0, nrcpts=0, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Dec 17 05:36:49 EL385 sendmail[15784]: mBH5an5X015784: mBH5an5Y015784: DSN: User unknown
Dec 17 05:36:49 EL385 sendmail[16160]: mBH5anfP016160: from=<>, size=1954, class=0, nrcpts=1, msgid=<200812170536.mBH5an5Y015784@EL385>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Dec 17 05:36:49 EL385 sendmail[15784]: mBH5an5Y015784: to=root, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=31075, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (mBH5anfP016160 Message accepted for delivery)
Dec 17 05:36:49 EL385 sendmail[16161]: mBH5anfP016160: to=<root@EL385>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=32134, dsn=2.0.0, stat=Sent

It seems that mail is being transferred from here as it says: Mail Sent at the end.
I am sorry if the O/p seems something different as I was making some modification for public docs.

Just i need to ask you something very serious.
Say I have a friend at UK and his machine name is there in my /etc/hosts file.
now When I sent her a mail from India it says "just the o/p above as sent mail.
but she says I am not getting mail.

How to troubleshoot the same?

tajamari 12-17-2008 12:03 AM

local host name is not a FQDN. Issue uname -a to check your hostname?. By the way what OS are you using? Post your OS so members can help you quickly

tajamari 12-17-2008 12:04 AM

Quote:

Originally Posted by tajamari (Post 3378144)
local host name is not a FQDN. Issue uname -a to check your hostname?. By the way what OS are you using? Post your OS so members can help you quickly

Sorry. Its already posted :) Anyway, check /etc/sysconfig/network file. Change the FQDN to something like this prefix.domain.com

WW125599 12-17-2008 12:16 AM

dear shadow

Two way to send transfer mail communication.

1) Through local network
2) Through internet service

for send the mail from command prompt u sould have configured the sendmail/postfix in the both end

and if ur using internet
ur machine should be in a qualified Domain.

ok...

your_shadow03 12-17-2008 01:24 AM

Tajamari,

Let you explain in detail.My machine is presently located in india.The Server has /etc/hosts entry correectly mentioned with the remote client machine ip and hostname.
The /etc/resolv.conf file has entry to search for the domain.
Whenever I am trying to send one of the remote machine mail it says :"Sent".
But the remote user says I havent received the mail.

For testing, What i did is I added my company mail server address mymail.intfo.com with IP in /etc/hosts.Wrote :
search intfo.com

in /etc/resolv.conf.
And sent the mail saying:
echo "hello"| mail "aaina@loga.com

And all it says:
Code:

, size=322, class=0, nrcpts=1, msgid=<200812170714.mBH7EVsu030770@BL18DL385>, pr                                            oto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Dec 17 07:14:32 EL385 sendmail[30770]: mBH7EVsu030770: to=aaina@loga.com, ctladdr=root (0/0), delay=00:00:01, xdelay=00:00:00, mailer=relay, pri=30054, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (mBH7EWuG030849 Message accepted for delivery)

Why am I not able to receive the mail now?

your_shadow03 12-17-2008 01:30 AM

Here's the complete log:

Dec 17 07:26:07 EL385sendmail[32111]: My unqualified host name (EL385) unknown; sleeping for retry
Dec 17 07:27:07 EL385sendmail[32111]: unable to qualify my own domain name (EL385) -- using short name
Dec 17 07:27:07 EL385sendmail[32111]: mBH7R7NZ032111: from=root, size=48, class=0, nrcpts=1, msgid=<200812170727.mBH7R7NZ032111@EL385>, relay=root@localhost
Dec 17 07:27:08 EL385sendmail[32401]: mBH7R75t032401: <am.uk.initooinfra.com@EL385>... User unknown
Dec 17 07:27:08 EL385sendmail[32111]: mBH7R7NZ032111: to=am.uk.initooinfra.com, ctladdr=root (0/0), delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=30048, relay=[127.0.0.1] [127.0.0.1], dsn=5.1.1, stat=User unknown
Dec 17 07:27:08 EL385sendmail[32401]: mBH7R75t032401: from=<root@EL385>, size=48, class=0, nrcpts=0, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Dec 17 07:27:08 EL385sendmail[32111]: mBH7R7NZ032111: mBH7R7Na032111: DSN: User unknown
Dec 17 07:27:08 EL385sendmail[32401]: mBH7R75v032401: from=<>, size=1951, class=0, nrcpts=1, msgid=<200812170727.mBH7R7Na032111@EL385>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Dec 17 07:27:08 EL385sendmail[32111]: mBH7R7Na032111: to=root, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=31072, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (mBH7R75v032401 Message accepted for delivery)
Dec 17 07:27:08 EL385sendmail[32402]: mBH7R75v032401: to=<root@EL385>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=32131, dsn=2.0.0, stat=Sent

p_s_shah 12-17-2008 02:05 AM

Hi there,

1. Is your system is working as SMTP server? OR is it relaying mails to other SMTP server?
Copy the output of :
#grep "DS" /path/to/sendmail.cf
#grep "SMART_HOST /path/to/sendmail.mc

2. Are you able to connect to smtp port and send mail using standard SMTP commands?
Link: http://postmaster.aol.com/tools/telnet.html
Please go through this link and test yourself.

billymayday 12-17-2008 02:23 AM

As already identified, the issue is your hostname is not fully qualified. /etc/hosts act like a mini nameserver, so when you type "ping myhost.mydomain.com" it finds the relevant IP in there.

Sendmail is complaining that your hostname is not fully qualified, and as already started, you can set this in /etc/sysconfig/network, or use the system-config-network utility (probably safer). Don't forget to restart the network service after any changes.

In case it isn't clear - /etc/hosts does not define your hostname.

WW125599, you deserve a RTFM for your reply - mail -vv is perfectly valid

Rgds

your_shadow03 12-17-2008 03:05 AM

#grep "DS" /etc/mail/sendmail.cf
DS
# Return-Receipt-To: header implies DSN request
# DHParameters (only required if DSA/DH is used)



#grep "SMART_HOST" /etc/mail/sendmail.mc
dnl define(`SMART_HOST',`smtp.your.provider')
[root@EL385 ~]#


The Test #telnet <> 25 works and tested successfuly.
But why the remote user not receiving the mail.


SMTP Server is a seperate server.

your_shadow03 12-17-2008 03:17 AM

Billymay,

What Can I see is hostname may not matter becoz':

Code:

Dec 17 07:27:07 EL385sendmail[32111]: unable to qualify my own domain name (EL385) -- using short name
Anyway it will use the short name for that .Right?

But the strange output :
Code:

Dec 17 07:27:08 EL385sendmail[32111]: mBH7R7Na032111: to=root, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=31072, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (mBH7R75v032401 Message accepted for delivery)
says Mail Sent.

Correct me if I am wrong.

billymayday 12-17-2008 03:24 AM

Did root receive that message? There is probably more in the logs than just that line.

your_shadow03 12-17-2008 03:27 AM

few more things I need to ask:
Whenever i do :

#service sendmail restart
it takes time at :
[root@bl18dl385 ~]# service sendmail restart
Shutting down sendmail: [ OK ]
Shutting down sm-client: [ OK ]
Starting sendmail: [ OK ]
Starting sm-client:



Takes a lot of time here in starting:




[code]

Dec 17 09:24:01 EL385 sendmail[15463]: unable to qualify my own domain name (EL385) -- using short name
Dec 17 09:24:01 EL385 sendmail[15463]: alias database /etc/aliases rebuilt by root
Dec 17 09:24:01 EL385 sendmail[15463]: /etc/aliases: 78 aliases, longest 10 bytes, 802 bytes total
Dec 17 09:24:02 EL385 sendmail[15718]: My unqualified host name (EL385) unknown; sleeping for retry

your_shadow03 12-17-2008 03:57 AM

Here's the appropriate maillog:
Code:

Dec 17 09:51:50  sendmail[21840]: unable to qualify my own domain name (EL385) -- using short name
Dec 17 09:51:50 sendmail[21840]: mBH9poOD021840: from=root, size=39, class=0, nrcpts=1, msgid=<200812170951.mBH9poOD021840@BL18DL385>, relay=root@localhost
Dec 17 09:51:51 sendmail[21938]: mBH9poEg021938: from=<root@EL385>, size=306, class=0, nrcpts=1, msgid=<200812170951.mBH9poOD021840@BL18DL385>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Dec 17 09:51:51 sendmail[21840]: mBH9poOD021840: to=aaina@logica.com, ctladdr=root (0/0), delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=30039, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (mBH9poEg021938 Message accepted for delivery)
Dec 17 09:51:58  sendmail[21942]: mBH9poEg021938: to=<aaina@logica.com>, ctladdr=<root@BL18DL385> (0/0), delay=00:00:07, xdelay=00:00:07, mailer=esmtp, pri=120306, relay=smtp.intooinfra.com. [10.226.32.71], dsn=5.0.0, stat=Service unavailable
Dec 17 09:51:58  sendmail[21942]: mBH9poEg021938: mBH9pwEg021942: DSN: Service unavailable
Dec 17 09:51:58  sendmail[21942]: mBH9pwEg021942: to=<root@BL18DL385>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=31543, dsn=2.0.0, stat=Sent


p_s_shah 12-17-2008 06:31 AM

please try following
 
Possible cause may be your system is not configured to relay mails to separate SMTP server.
Quote:

#grep "DS" /etc/mail/sendmail.cf
DS
# Return-Receipt-To: header implies DSN request
# DHParameters (only required if DSA/DH is used)

#grep "SMART_HOST" /etc/mail/sendmail.mc
dnl define(`SMART_HOST',`smtp.your.provider')
[root@EL385 ~]#
SMTP Server is a seperate server.

1. Take backup of sendmail.mc and sendmail.cf before editing them.
2. Replace "smtp.your.provider" with your SMTP server qualified name in sendmail.mc file. Make sure you are able to ping, as well as telnet <SMTP Server> 25 from konsole.
3. Regenerate sendmail.cf using
m4 /path/to/sendmail.mc > /path/to/sendmail.cf
4. Restart sendmail service.
5. Try sending mail and also paste logs.

Quote:

The Test #telnet <> 25 works and tested successfuly.
But why the remote user not receiving the mail.
Can you run the test again and copy/paste the complete session ?
Are you doing telenet to SMTP server or localhost ?
Can you double check that remote SMTP server has no restriction for relaying mail from your system ?

robertwolfe 12-17-2008 09:31 AM

Quote:

Originally Posted by your_shadow03 (Post 3378079)
Whenever I am running this command on the command line on RHEL I am getting the error:

Code:

[root@EL385 ~]# echo "it is my job"| mail -vv aaina@gmail.com
WARNING: local host name (EL385) is not qualified; see cf/README: WHO AM I?
aaina@gmail.com... Connecting to [127.0.0.1] via relay...
220 ssa.loga.com ESMTP Sendmail 8.13.1/8.13.1; Wed, 17 Dec 2008 04:36:20 GMT
>>> EHLO
250-ssa.loga.com Hello localhost.localdomain [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-AUTH GSSAPI DIGEST-MD5 CRAM-MD5
250-DELIVERBY
250 HELP
>>> MAIL From:<root@EL385> SIZE=39 AUTH=root@EL385
250 2.1.0 <root@EL385>... Sender ok
>>> RCPT To:<aaina@gmail.com>
>>> DATA

Code:

Dec 17 04:35:19 tuxbuddy sendmail[5834]: My unqualified host name (EL385) unknown; sleeping for retry
Dec 17 04:38:12 EL385 sendmail[2347]: mBC8ASsl014838: to=<root@bl18dl385>, delay=4+20:26:28, xdelay=00:00:35, mailer=esmtp, pri=10473308, relay=EL385.logica.com., dsn=4.0.0, stat=Deferred: Name server: bl18dl385.loga.com.: host name lookup failure
Dec 17 04:38:52 EL385 sendmail[2347]: mBC4ASsl010087: to=<root@EL385>, delay=5+00:06:30, xdelay=00:00:40, mailer=esmtp, pri=10833438, relay=EL385.loga.com., dsn=4.0.0, stat=Deferred: Name server: EL385.loga.com.: host name lookup failure
Dec 17 04:38:52 EL385 sendmail[2347]: mBC4ASsl010087: mBH4Aaab002347: return to sender: Cannot send message for 5 days
Dec 17 04:38:52 EL385 sendmail[2347]: mBH4Aaab002347: to=root, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=34994, dsn=2.0.0, stat=Sent

I checked /etc/hosts file too but everything seems right?
Completely confused !!!

Most likely this machine is not in DNS (as opposed to being in your /etc/hosts file). Check the DNS entry for this machine to see if it is indeed in DNS. If not, put in a record for it and you should be all set.


All times are GMT -5. The time now is 09:43 PM.