Sendmail connection timeout

51,751

The standard mail troubleshooting steps apply here... From the log, we see that you're able to resolve the MX/DNS records for the gmail.com destination you're sending to. So this isn't a DNS or routing issue.

Since this is a basic SMTP delivery, try using telnet to port 25 to make sure you're able to connect to the destination host...

I'd follow this sequence:

dig mx gmail.com
# Look for the mail destination IP in the output - "209.85.225.27" in this case

telnet 209.85.225.27 25
# This is an attempt to telnet to port 25 (smtp) on the recipient's server...

You should see something similar to:

Trying 209.85.225.27...
Connected to iy-in-f27.1e100.net (209.85.225.27).
Escape character is '^]'.
220 ***************************************

If you do not see the above, your outbound port 25 smtp traffic is being blocked either at the machine level (check iptables, etc.) or at the network level (check network firewall or ISP policies).

If you do see a similar message, then you're able to pass mail and shouldn't be receiving timeout errors.

Share:
51,751

Related videos on Youtube

JulienM
Author by

JulienM

Updated on September 18, 2022

Comments

  • JulienM
    JulienM almost 2 years

    I recently setup a new Debian server,

    After installing and setting up sendmail for the first time, I am not able to send e-mail.

    Reason : Connection timeout.

    Output from the /var/log/mail.log :

    > May  6 02:42:53 k***** sm-mta[15070]: q465gjxF013677:
    > to=<*****@gmail.com>, ctladdr=<*****@*****.ca> (1001/1001),
    > delay=01:00:08, xdelay=00:00:00, mailer=esmtp, pri=300329,
    > relay=alt4.gmail-smtp-in.l.google.com., dsn=4.0.0, stat=Deferred:
    > Connection timed out with alt4.gmail-smtp-in.l.google.com.
    

    Output from netstat :

    tcp        0      0 0.0.0.0:587             0.0.0.0:*   LISTEN   15069/sendmail: MTA
    tcp        0      0 0.0.0.0:25              0.0.0.0:*   LISTEN   15069/sendmail: MTA
    

    Telnet on 25 is also successful when ran from an other computer (telnet theserver.imworkingon.com 25) but not if I try to run it from the server im working on. This is telling me that somehow the outbound port 25 seems to be blocked...

    Anyone have any ideas?

    • ewwhite
      ewwhite about 12 years
      Can you send to any other addresses?
    • JulienM
      JulienM about 12 years
      Tried 4 other addresses, no succes.
    • adamo
      adamo about 12 years
  • Mike B
    Mike B about 12 years
    Minor point of clarification (that's probably obvious but I'll mention it anyway): not all people will see asterisks in the 220 banner greeting upon successful connections.
  • JulienM
    JulienM about 12 years
    For some reason, if I try "telnet the.server.imworkingon 25" is successful from any other computer. BUT if I try to telnet anyother address from the server i'm working on, I get a connection timeout. Port 25 is open with iptables, and it isn't my ISP (dedicated server).. Any other advice? Thank you for your help soo far.
  • ramruma
    ramruma about 12 years
    The incoming connection to port 25 of the.server.imworkingon does not matter. It still sounds like your ISP may be blocking outgoing email connections. As adamo says, check your ISP's documentation to see whether you are supposed to send all email via your ISP's relay and on a different port. Or use ewwhite's suggestion of trying to telnet to port 25 of your destination (gmail.com).