From: Wietse Venema on
Matt Hayes:
> Yes.. I know this has come up quite a bit, but on freenode in #postfix
> this discussion once again erupted when someone mentioned a bug in
> postfix and referencing this:
>
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=214741

They are talking about an eight-year old version of Postfix.

Wietse

From: Moe on
Wietse Venema wrote:
> Matt Hayes:
>> Yes.. I know this has come up quite a bit, but on freenode in #postfix
>> this discussion once again erupted when someone mentioned a bug in
>> postfix and referencing this:
>>
>> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=214741
>
> They are talking about an eight-year old version of Postfix.

I was the guy complaining on IRC, so I'd like to jump in and clarify:

* The bug is still present in 2.7.0, which is not 8 years old

* I think Mike Paul explains the problem pretty well on that ticket.

* The bug is not debian specific and not triggered by doing anything
"special" other than leaving myhostname and mydomainname out of
main.cf.

The problem boils down to postfix expecting 'gethostname()' to return
a FQDN. This not the case on a properly configured linux host,
regardless of the distribution (this is not debian specific).

I apologize if it's actually a debian patch that introduced this
behaviour, but from what I gather this is also how mainline postfix does it.

If postfix goes to guess the FQDN when it isn't hardcoded in
main.cf then it could just as well do it right, no?

The right way, as explained by Mike Paul in that ticket, would be to
call gethostbyname() on the return value of gethostname() and then split
the result of *that* into hostname and domainname.


Cheers, Moe

From: Victor Duchovni on
On Wed, Jun 02, 2010 at 10:46:47PM -0400, Matt Hayes wrote:

> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=214741
>
> Now, I'm not all that bright on how postfix sorts out the hostname, and
> frankly, I don't care, but I don't like people saying its a 'bug' when I
> have no problems following configuration directives.
>
> Can someone PLEASE explain this in clear terms as to what they are
> complaining about?

An MTA needs a stable set of names for the domains listed in mydestination,
so that locally originated mail delivered locally is repliable. A laptop
with a DHCP-based FQDN is not a good candidate for defaulting the local
domain to the (volatile) FQDN of the host.

Setting myhostname to "shortname.localdomain" is FAR preferable to picking
up some random DHCP (or reverse DNS lookup) supplied domain and becoming
an open relay for sub-domains of your ISP's domain or being unable to
reply to previously delivered local email.

In addition, Postfix operates correctly on stand-alone hosts, that
are not networked delivering local email between local users. There
must not be network dependencies in local mail delivery.

Operating Postfix on a laptop typically requires some of the configuration
options listed in SOHO_README.html.

The authors of the bug report have not thought this through. The bug
report is spurious.

If they want the O/S distribution to fully configure a SOHO Postfix during
system installation, the Debian laptop profile would have to ask the user
for a list of user accounts and their mappings to external ISP mailboxes,
as well as submission server settings and passwords, ... This is a lot
of complexity to deal with at install-time.

Far simpler to just deliver all local (cron, ...) mail locally, and
to expect the laptop user to use Thunderbird, Evolution, ... rather
than mutt or Pine via a local Postfix.

--
Viktor.

From: Victor Duchovni on
On Thu, Jun 03, 2010 at 07:44:58PM +0200, Moe wrote:

> I was the guy complaining on IRC, so I'd like to jump in and clarify:
>
> * The bug is still present in 2.7.0, which is not 8 years old

There is no bug. Postfix is working *exactly* as designed. And the
design has been given much thought.

> The problem boils down to postfix expecting 'gethostname()' to return
> a FQDN. This not the case on a properly configured linux host,
> regardless of the distribution (this is not debian specific).

No, Postfix does not expect this. Rather Postfix defaults the mydomain
setting from gethostname() if possible, but otherwise uses "localdomain".

> If postfix goes to guess the FQDN when it isn't hardcoded in
> main.cf then it could just as well do it right, no?

Postfix does the right thing.

> The right way, as explained by Mike Paul in that ticket, would be to
> call gethostbyname() on the return value of gethostname() and then split
> the result of *that* into hostname and domainname.

No, that would in fact be wrong, for reasons long ago considered and
settled.

--
Viktor.

From: Wietse Venema on
Moe:
[ Charset ISO-8859-1 unsupported, converting... ]
> Wietse Venema wrote:
> > Matt Hayes:
> >> Yes.. I know this has come up quite a bit, but on freenode in #postfix
> >> this discussion once again erupted when someone mentioned a bug in
> >> postfix and referencing this:
> >>
> >> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=214741
> >
> > They are talking about an eight-year old version of Postfix.
>
> I was the guy complaining on IRC, so I'd like to jump in and clarify:
>
> * The bug is still present in 2.7.0, which is not 8 years old
>
> * I think Mike Paul explains the problem pretty well on that ticket.
>
> * The bug is not debian specific and not triggered by doing anything
> "special" other than leaving myhostname and mydomainname out of
> main.cf.
>
> The problem boils down to postfix expecting 'gethostname()' to return
> a FQDN. This not the case on a properly configured linux host,
> regardless of the distribution (this is not debian specific).
>
> I apologize if it's actually a debian patch that introduced this
> behaviour, but from what I gather this is also how mainline postfix does it.
>
> If postfix goes to guess the FQDN when it isn't hardcoded in
> main.cf then it could just as well do it right, no?
>
> The right way, as explained by Mike Paul in that ticket, would be to
> call gethostbyname() on the return value of gethostname() and then split
> the result of *that* into hostname and domainname.

If this is a non-debian bug then I would like to see a bug report
that can be reproduced on a non-Debian host.

This is what happens on my non-Debian box when the kernel hostname
is not FQDN:

# The kernel hostname, as returned by gethostname(2)
tail% uname -n
tail

# The default mydomain "localdomain" when the kernel hostname is not FQDN.
tail% postconf -d mydomain
mydomain = localdomain

# The default myhostname, created from gethostname(2) and $mydomain.
tail% postconf -d myhostname
myhostname = tail.localdomain

As you see there is no guessing at all involved here.

Wietse