LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   Sendmail extremely slow establishing connctions (http://www.linuxquestions.org/questions/linux-server-73/sendmail-extremely-slow-establishing-connctions-4175444984/)

mcburton3 01-10-2013 07:40 AM

Sendmail extremely slow establishing connctions
 
I have a web application running on a Linux RedHat server that sends email notifications. In the past, I used our Internet providers SMTP server to relay emails but it was not reliable, so I just switched to using the localhost sendmail SMTP. However, I noticed that something is causing a huge delay when establishing a connection to the local sendmail SMTP server as it takes approximately 40 - 60 secs just to establish the connection. It is not a webserver issue as it happens if I try to connect from a remote machine as well.

I am not very knowledgeable when it comes to sendmail. Do any of you have any ideas what could be causing this or where I might start in finding the source of the delay? We tested this local SMTP server some time ago and it was fast in establishing connections, but someone else made some changes to it to prevent WAN servers from connecting and I suspect that had something to do with it.

Thank you in advance.

Matt

linosaurusroot 01-10-2013 07:58 AM

Is it DNS lookups that time out?

mcburton3 01-10-2013 08:48 AM

That's a good question. I am not sure and I don't know how to determine if it a dns lookup delay. However, I do know that the webapp connecting to the server us using an IP address not a server name, so I wouldn't think there is a DNS lookup happening. Likewise, when the webapp attempts to connect to the Internet provider SMTP server via full domain name, it is able to establish a connection in less than a second.

mcburton3 01-10-2013 08:52 AM

Okay, I ran dig from the server to www.yahoo.com and www.google.com and both DNS lookups completed in under 17ms. "dig www.faa.gov" took 135ms. So I think the DNS lookup is probably not the issue, but thank you for the suggestion as now I can rule that out.

linosaurusroot 01-10-2013 09:12 AM

I mean the reverse lookup from the mailserver on the source IP of the incoming SMTP connection.

mcburton3 01-10-2013 09:39 AM

Oh, I see. Would it do a reverse lookup for connections coming from localhost?

mcburton3 01-10-2013 08:14 PM

I caught a trace from the sendmail log, /var/log/maillog, where another web server (192.168.15.239) connects to the mail server on 192.168.15.110. You can see the long delay between the first log entry (connect from...) to the next entry (AUTH: ...). Any ideas on where I can look?

Jan 10 18:18:07 localhost sendmail[4652]: NOQUEUE: connect from [192.168.15.239]
Jan 10 18:19:00 localhost sendmail[4652]: AUTH: available mech=GSSAPI NTLM CRAM-MD5 LOGIN PLAIN DIGEST-MD5 ANONYMOUS, allowed mech=EXTERNAL GSSAPI KERBEROS_V4 DIGEST-MD5 CRAM-MD5
Jan 10 18:19:00 localhost sendmail[4652]: r0B0I7bO004652: Milter: no active filter
Jan 10 18:19:01 localhost sendmail[4652]: r0B0I7bO004652: to=<****@****.***>, delay=00:00:00, pri=0, stat=RSET
Jan 10 18:19:01 localhost sendmail[4652]: r0B0I7bO004652: to=<****@****.***>, delay=00:00:00, pri=0, stat=RSET
Jan 10 18:19:01 localhost sendmail[4652]: r0B0I7bO004652: to=<****@****.***>, delay=00:00:00, pri=0, stat=RSET
Jan 10 18:19:01 localhost sendmail[4652]: r0B0I7bO004652: from=<****@****.***>, size=0, class=0, nrcpts=3, proto=ESMTP, daemon=MTA, relay=[192.168.15.239]
Jan 10 18:19:17 localhost sendmail[4652]: r0B0I7bQ004652: from=<****@****.***>, size=304, class=0, nrcpts=3, msgid=<916631122.1357863648766.JavaMail.javamailuser@localhost>, proto=ESMTP, daemon=MTA, relay=[192.168.15.239]
Jan 10 18:19:17 localhost sendmail[4695]: r0B0I7bQ004652: SMTP outgoing connect on [192.168.15.110]
Jan 10 18:19:18 localhost sendmail[4695]: r0B0I7bQ004652: to=<****@****.***>, delay=00:00:01, xdelay=00:00:01, mailer=esmtp, pri=180304, relay=mx.coxmail.com. [68.99.120.4], dsn=2.0.0, stat=Sent (mQKh1k01107nTQg01QKi4C mail accepted for delivery - 1 ??)
Jan 10 18:19:18 localhost sendmail[4695]: r0B0I7bQ004652: SMTP outgoing connect on [192.168.15.110]
Jan 10 18:19:20 localhost sendmail[4695]: r0B0I7bQ004652: to****@****.***>, delay=00:00:03, xdelay=00:00:02, mailer=esmtp, pri=180304, relay=mta6.am0.yahoodns.net. [98.138.112.38], dsn=2.0.0, stat=Sent (okdirdel 2/0)
Jan 10 18:19:20 localhost sendmail[4695]: r0B0I7bQ004652: done;
delay=00:00:03, ntries=1


All times are GMT -5. The time now is 07:33 PM.