localhost.localdomain and sendmail
by Simon at 13:16 04/08/08 (Forum::Technical Advice::General)
Some keywords first, to help me find this back next time I'm Googling...

sendmail submit.mc msp /etc/hosts localhost.localdomain 127.0.0.1

Problem: appearance of localhost.localdomain (127.0.0.1) in Received lines for mail originating on a CentOS 4.6 server.

My /etc/hosts used to look like this ('example.com' is fictitious and for illustrative purposes only):

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 ptah.example.com ptah localhost.localdomain localhost

... the last two lines of my /etc/mail/submit.mc looked like this:

dnl If you use IPv6 only, change [127.0.0.1] to [IPv6:::1]
FEATURE(`msp', `[127.0.0.1]')dnl

... and I'd already told sendmail itself to listen on the public IP rather than just localhost by removing 127.0.0.1 from this line in /etc/mail/sendmail.mc:

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

However, mail from this machine was containing Received lines like this, containing 127.0.0.1 which (apparently) alerts some anti-spam mechanisms:

Received: from ptah.example.com (ptah.example.com [127.0.0.1])
by ptah.example.com (8.13.1/8.13.1) with ESMTP id m72322Dq015641
for <root@ptah.example.com>; Sat, 2 Aug 2008 04:02:02 +0100
Received: (from root@localhost)
by ptah.example.com (8.13.1/8.13.1/Submit) id m72322bV015639
for root; Sat, 2 Aug 2008 04:02:02 +0100

I first tried changing /etc/hosts to include the actual IP (a.b.c.d) of the machine, its fqdn and alias on a separate line:

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
a.b.c.d ptah.example.com ptah

... which changed the Received lines to this:

Received: from ptah.example.com (localhost.localdomain [127.0.0.1])
by ptah.example.com (8.13.1/8.13.1) with ESMTP id m74B4ZAt011770
for <root@ptah.example.com>; Mon, 4 Aug 2008 12:04:35 +0100
Received: (from root@localhost)
by ptah.example.com (8.13.1/8.13.1/Submit) id m74B4Zfq011769
for root; Mon, 4 Aug 2008 12:04:35 +0100

... so I then changed /etc/submit.mc to this:

dnl If you use IPv6 only, change [127.0.0.1] to [IPv6:::1]
FEATURE(`msp', `[a.b.c.d]')dnl

... and now my Received lines are how I want them, with the actual IP embedded:

Received: from ptah.example.com (ptah.example.com [a.b.c.d])
by ptah.example.com (8.13.1/8.13.1) with ESMTP id m74CARvF012184
for <root@ptah.example.com>; Mon, 4 Aug 2008 13:10:27 +0100
Received: (from root@localhost)
by ptah.example.com (8.13.1/8.13.1/Submit) id m74CARK0012183
for root; Mon, 4 Aug 2008 13:10:27 +0100

--
simon

<< Apple? Thecus? Well someone's ... Booted off internet and progam... >>
Powered by
Powered by Novacaster