Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 Dec 2005 19:52:12 +0200
From:      Giorgos Keramidas <keramida@ceid.upatras.gr>
To:        Charles Howse <chowse@charter.net>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: sendmail local-host-names
Message-ID:  <20051206175212.GA15873@flame.pc>
In-Reply-To: <BFBB1E7D.378B%chowse@charter.net>
References:  <20051206164519.GA15738@flame.pc> <BFBB1E7D.378B%chowse@charter.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2005-12-06 10:54, Charles Howse <chowse@charter.net> wrote:
>Giorgos Keramidas wrote:
>>On 2005-12-06 10:35, Charles Howse <chowse@charter.net> wrote:
>>> The hostname of my FreeBSD box is:
>>> moe.local
>>>
>>> User charles has an account, has been added to the qpopper authentication
>>> database, and sendmail_enable="NO" is in /etc/rc.conf.
>>>
>>> In /etc/mail/local-host-names, I have:
>>> moe.local
>>> larry.local
>>> local
>>>
>>> It's working, but I think I have too many entries in local-host-names.
>>> What entries are necessary?
>>
>> If your local hostnames are listed as names of one of the local IP
>> addresses in your /etc/hosts, then none is needed.  Sendmail will
>> discover the local addresses on its own.
>
> Not quite sure I understand.
> Here is /etc/hosts from FreeBSD:
>
> [charles@moe:~]$ cat /etc/hosts
> ::1                     localhost.local localhost
> 127.0.0.1               localhost.local localhost
> 192.168.254.4           moe.local moe
> 192.168.254.4           moe.local.
> 192.168.254.3           larry
> 192.168.254.3           larry.local
>
> Are you saying that since I have larry.local in /etc/hosts, then I don't
> need anything at all in local-host-names?

Exactly.  You can see the list of host names which Sendmail considers
local by running sendmail in "test mode" and expanding the $=w macro to
see what hostnames it has already "discovered" as local:

    $ echo '$=w' | sendmail -bt

This will print a list of hostnames much like the one shown below:

    flame:/home/keramida$ echo '$=w' | sendmail -bt
    ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
    Enter <ruleset> <address>
    >
    [IPv6:::1]
    ftp.pc
    [IPv6:fe80::1]
    irc.pc
    flame.pc
    www.pc
    mail.pc
    localhost.localdomain
    localhost
    flame
    [127.0.0.1]
    ns.pc
    localhost.pc
    [IPv6:fe80::211:95ff:feca:e5e8]
    flame.localdomain
    freebsd.pc
    >
    flame:/home/keramida$

If a hostname is listed in the $=w class, then Sendmail has already
discovered it as "local" and you don't need to add it to
/etc/mail/local-host-names.

> For clarity, I'm doing local mail only, no Internet mail.

It shouldn't make a big difference, in this case.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20051206175212.GA15873>