Linux – Sendmail: Have to add NAT IP to access list to relay, why

emaillinuxsendmailsmtp

I have sendmail set up with smarthost to Google Apps (using AuthInfo in /etc/mail/access for authentication).

I noticed last night that e-mail was not going through. I send an e-mail like so:

 echo "I am testing this" | sendmail -f server@example.com server@example.com

Logs look like this:

May 19 18:53:08 starks sendmail[1658]: p4JMr7mw001658: from=server@example.com, size=157, class=0, nrcpts=1, msgid=<201105192253.p4JMr7mw001658@starks.example.lan>, relay=root@localhost
May 19 18:53:08 starks sendmail[1658]: STARTTLS=client, relay=[127.0.0.1], version=TLSv1/SSLv3, verify=FAIL, cipher=DHE-RSA-AES256-SHA, bits=256/256
May 19 18:53:08 starks sendmail[1665]: STARTTLS=server, relay=starks.example.lan [192.168.8.5] (may be forged), version=TLSv1/SSLv3, verify=NO, cipher=DHE-RSA-AES256-SHA, bits=256/256
May 19 18:53:08 starks sendmail[1658]: p4JMr7mw001658: to=server@example.com, ctladdr=server@example.com (0/0), delay=00:00:01, xdelay=00:00:00, mailer=relay, pri=30157, relay=[127.0.0.1] [127.0.0.1], dsn=5.7.1, stat=User unknown
May 19 18:53:08 starks sendmail[1658]: p4JMr7mw001658: p4JMr7mx001658: DSN: User unknown

(There's a bunch of other log entries but it has to do with the postmaster alias pointing to the server@example.com address)

However, if I add the following like to /etc/mail/access, everything works fine:

Connect:192.168.8.5    RELAY

All mail is delivered as expected.
Anyone have any ideas?

Best Answer

"starks.example.lan [192.168.8.5]"

Your SMTP "host announce" (starks.example.lan) resolves back to your NAT address (192.168.8.5) where maybe your actual host/system name is something else?

Related Topic