LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   sendmail: getting stat=Deferred: Connection timed out with server - any help? (https://www.linuxquestions.org/questions/linux-server-73/sendmail-getting-stat%3Ddeferred-connection-timed-out-with-server-any-help-768435/)

samengr 11-11-2009 11:25 AM

sendmail: getting stat=Deferred: Connection timed out with server - any help?
 
Hi All,

I am using RHEL5 on boxes.
client: web04.example.com
server: web05.example.com

I am trying to confiugre sendmail client and server environment. A very simple environment. On server side I configured sendmail and relaying the requests from other linux machines. On a server end emails are going out fine but on client side its not working with Deffered message in log. I tried to find any solution online but couldnt get any exact info to sort out this issue.


On server side there is a entry of client machine in /etc/mail/access and I created access.db as well with make hash command.

makemap hash /etc/mail/access.db < /etc/mail/access


Now on client linux machine I just made two changes in sendmail.mc

dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
dnl define(`SMART_HOST', `web05.example.com')dnl

used m4 utility to create sendmail.cf. Also used make -C /etc/mail


Testing by mail client at client machine

# echo "testing 04 delivery" | mail -s "testing" smk@gmail.com


#tail -f /var/log/mail.info

Nov 11 16:07:21 dwweb04 sendmail[10032]: nABG7K7t010032: from=root, size=66, class=0, nrcpts=1, msgid=<200911111607.nABG7K7t010032@web04.example.com>, relay=root@localhost
Nov 11 16:07:21 dwweb04 sendmail[10033]: nABG7LBh010033: from=<root@web04.example.com>, size=368, class=0, nrcpts=1, msgid=<200911111607.nABG7K7t010032@web04.example.com>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Nov 11 16:07:21 dwweb04 sendmail[10032]: nABG7K7t010032: to=smk@gmail.com, ctladdr=root (0/0), delay=00:00:01, xdelay=00:00:00, mailer=relay, pri=30066, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (nABG7LBh010033 Message accepted for delivery)

Nov 11 16:09:09 dwweb04 sendmail[10019]: nABE4r0i009143: to=<smk@gmail.com>, ctladdr=<backup@web04.example.com> (503/503), delay=02:04:16, xdelay=00:02:00, mailer=relay, pri=390353, relay=web05.example.com. [*.*.*.*] (external IP), dsn=4.0.0, stat=Deferred: Connection timed out with web05.example.com.


Note: I have changed mydomain.com to example.com here


There are some other outputs that can help

At client machine (web04)

# telnet web05.example.com 25
Trying 192.168.1.107...
Connected to web05.example.com (192.168.1.107).
Escape character is '^]'.
220 web05.example.com ESMTP Sendmail 8.13.8/8.13.8; Wed, 11 Nov 2009 16:18:03 GMT


Is there something on server end that is not responding? or if I am doing something wrong please point out.

Many thanks.

centosboy 11-11-2009 11:32 AM

Quote:

Originally Posted by samengr (Post 3753068)
Hi All,

I am using RHEL5 on boxes.
client: web04.example.com
server: web05.example.com

I am trying to confiugre sendmail client and server environment. A very simple environment. On server side I configured sendmail and relaying the requests from other linux machines. On a server end emails are going out fine but on client side its not working with Deffered message in log. I tried to find any solution online but couldnt get any exact info to sort out this issue.


On server side there is a entry of client machine in /etc/mail/access and I created access.db as well with make hash command.

makemap hash /etc/mail/access.db < /etc/mail/access


Now on client linux machine I just made two changes in sendmail.mc

dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
dnl define(`SMART_HOST', `web05.example.com')dnl

used m4 utility to create sendmail.cf. Also used make -C /etc/mail


Testing by mail client at client machine

# echo "testing 04 delivery" | mail -s "testing" smk@gmail.com


#tail -f /var/log/mail.info

Nov 11 16:07:21 dwweb04 sendmail[10032]: nABG7K7t010032: from=root, size=66, class=0, nrcpts=1, msgid=<200911111607.nABG7K7t010032@web04.example.com>, relay=root@localhost
Nov 11 16:07:21 dwweb04 sendmail[10033]: nABG7LBh010033: from=<root@web04.example.com>, size=368, class=0, nrcpts=1, msgid=<200911111607.nABG7K7t010032@web04.example.com>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Nov 11 16:07:21 dwweb04 sendmail[10032]: nABG7K7t010032: to=smk@gmail.com, ctladdr=root (0/0), delay=00:00:01, xdelay=00:00:00, mailer=relay, pri=30066, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (nABG7LBh010033 Message accepted for delivery)

Nov 11 16:09:09 dwweb04 sendmail[10019]: nABE4r0i009143: to=<smk@gmail.com>, ctladdr=<backup@web04.example.com> (503/503), delay=02:04:16, xdelay=00:02:00, mailer=relay, pri=390353, relay=web05.example.com. [*.*.*.*] (external IP), dsn=4.0.0, stat=Deferred: Connection timed out with web05.example.com.


Note: I have changed mydomain.com to example.com here


There are some other outputs that can help

At client machine (web04)

# telnet web05.example.com 25
Trying 192.168.1.107...
Connected to web05.example.com (192.168.1.107).
Escape character is '^]'.
220 web05.example.com ESMTP Sendmail 8.13.8/8.13.8; Wed, 11 Nov 2009 16:18:03 GMT


Is there something on server end that is not responding? or if I am doing something wrong please point out.

Many thanks.

web05.example.com must allow relaying from web04.example.com in /etc/mail/access

you will also need to change this line too

Code:

dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
so the Addr=0.0.0.0 or specific ip or add another line

Code:

dnl DAEMON_OPTIONS(`Port=smtp,Addr=<ipaddress>, Name=MTA')dnl

samengr 11-11-2009 12:07 PM

When I do this on web04 (client side) it works...

$ telnet web05.example.com 25
Trying 192.168.1.107...
Connected to web05.example.com (192.168.1.107).
Escape character is '^]'.
220 web05.example.com ESMTP Sendmail 8.13.8/8.13.8; Wed, 11 Nov 2009 16:49:01 GMT
helo gmail.com
250 web05.example.com Hello web04.example.com [192.168.1.105], pleased to meet you
MAIL FROM: dwadmin@web04.example.com
250 2.1.0 dwadmin@web04.example.com... Sender ok
RCPT TO: skm@gmail.com
250 2.1.5 skm@gmail.com... Recipient ok
DATA
354 Enter mail, end with "." on a line by itself
Subject: web04 delivery Test
Hi I am testing web04 delivery at 16:51 11/11/2009.
...
.
250 2.0.0 nABGn1Dd021907 Message accepted for delivery



Can see the delivery at server side in mail log as well

# cat /var/log/mail.info | grep nABGn1Dd021907
Nov 11 16:52:08 web05 sendmail[21907]: nABGn1Dd021907: from=dwadmin@web04.example.com, size=84, class=0, nrcpts=1, msgid=<200911111651.nABGn1Dd021907@web05.example.c om>, proto=SMTP, daemon=MTA, relay=web04.example.com [192.168.1.105]
Nov 11 16:52:09 web05 sendmail[23420]: nABGn1Dd021907: to=smk@gmail.com, delay=00:01:01, xdelay=00:00:01, mailer=esmtp, pri=120084, relay=gmail-smtp-in.l.google.com. [72.14.221.114], dsn=2.0.0, stat=Sent (OK 1257958329 e11si11155778fga.7)


Any idea why it doesnt work in other way? I mean with sending email through mail or mutt client?

samengr 11-11-2009 12:09 PM

Hi centosboy

I believe this line in sendmail.mc

dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl

is just allowing all smtp to listen on all network cards.

centosboy 11-11-2009 02:00 PM

Quote:

Originally Posted by samengr (Post 3753105)
Hi centosboy

I believe this line in sendmail.mc

dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl

is just allowing all smtp to listen on all network cards.

nope - not allowing all smtp but smtp on localhsot only. basically what it says

if you want to send mail via a remote server - that server has to allow the client connection AND it has to be listening on a valid IP address and the client IP must be allowed to RELAY


All times are GMT -5. The time now is 11:51 AM.