Re: [Exim] Problems caused by localhost entry in Received

Top Page
Delete this message
Reply to this message
Author: Pat Lashley
Date:  
To: Toralf Lund, Exim Mailing List
Subject: Re: [Exim] Problems caused by localhost entry in Received
--On Tuesday, January 06, 2004 11:55:53 +0100 Toralf Lund <toralf@???> wrote:

>> Quoting Toralf Lund (toralf@???):
>>
>>
>>> Received: from localhost.localdomain ([127.0.0.1] helo=mydomain)
>>> Now, this seems to cause problems with some blacklists etc. on the net;
>>> apparently they think "localhost" is evil.


Can you provide us with an example bounce; so that we can determine
whether that is the actual reason?



>>> 2. Is there a good way to avoid including this localhost reference?
>>>
>>>
>>
>> Can you have your mailer connect to $your_internet_ip instead of
>> 127.0.0.1 or localhost? That might make a difference.
>>
>>
> I think the only way to do that would be to hardcode the address, and
> I'd rather not do that. Like I said, I want a *portable* config and the
> IP address may actually change, or the users might use the same mailer
> config on different hosts.


I don't think you're going to be able to fix the localhost.localdomain
reference easily without having some config that needs to change when
the machine moves; but it doesn't have to be either exim or the MUA.

First, make sure the machine actually has a proper domain name
set. (You've probably already done this; but it never hurts to
explicitly eliminate the simple and obvious.) I don't think you
said what OS you are using. On a BSD system, hostname(1) should
return the FQDN. On Linux, it requires the '--fqdn' parameter.
On Solaris, use domainname(1). (Note that the other systems also
have domainname; but what it returns varies and is unlikely to
be what you want...) If your host's FQDN includes 'localdomain',
that needs to be fixed. (The best way to do this and maintain
machine portability is via DHCP.)


You've already seen the discussion about DNS entries for localhost/
127.0.0.1. But depending on your system's configuration, it may
be using /etc/hosts before checking DNS. If so, and if you are
confidant that the localhost/127.0.0.1 entries are correct, see
if your system supports /etc/nsswitch.conf. If so, check it for
lookup order. Try putting dns before hosts.

If your system doesn't have /etc/nsswitch.conf; or changing the
order doesn't fix the problem, try fixing /etc/hosts. The entry
for 127.0.0.1 is probably something like:

    127.0.0.1    localhost localhost.localdomain


Change that to

    127.0.0.1    localhost localhost.DOMAIN


(where DOMAIN is your real domain) This should change the Received:
line to use localhost.DOMAIN. If that isn't enough; try changing
the entry to:

    127.0.0.1    localhost HOST.DOMAIN



(I suspect there's some way to automatically adjust this using
DHCP; but I have no idea what it would be.)




-Pat