Guy Hulbert wrote:
On Thu, 2008-02-14 at 09:41 -0500, Chris Lewis wrote:
Like Solaris usually does (grr), "hostname" returns the host node
name (no dots), not the FQDN.

This is correct behaviour.

IYO, NMO ;-)

Sun's hostname command, iirc, uses the hosts table and is
well-documented[*].  You can have it return long names by default it you
like (reversing the order of entries following the IP address
in /etc/hosts may do it) but that's liable to break NIS or NIS+ if you
are using that.


I don't have a solaris box but you might try 'hostname -f' ...

I always use 'hostname -s' when I want the short name.

[*] The practice of using FQDN is an unfortunate linux novelty.  I
realize that it's over 10 years old now though ... :-(

Using FQDN in, say, "helo" isn't an unfortunate linux novelty, it's a requirement by RFC821/2821.

The point here really is that I'm trying to build code that is portable, and possibly quite widely deployed. Futzing around with what hostname returns on a given OS instance simply isn't an option. The real issue here is that $self->qp->config(me) is ignoring the config/me file, and appears to be unconditionally taking hostname. This will mostly be unnoticable on Linux, where hostname does return the FQDN.

BTW: On solaris, the only argument hostname takes is if you want to _set_ the hostname. "hostname -f" sets the hostname to "-f". So, don't try that on Solaris at home folks ;-)

I'm not asking how to fudge Solaris config to return the FQDN, or how to write a function that can return a FQDN (I can figure that out from /etc/hosts), but how to get qpsmtpd to return the value I'd expect from config(me). That will resolve various problems with generated Received lines, log files, and a number of other things. Eg: plugins that call Net::SMTP and want to set HELO and from lines etc.

As it stands, even tho qpsmtpd internally uses config(me), even if you set config/me to your FQDN, qpsmtpd on Solaris generates invalid Received lines, ala:

Received: from freebsd167.cost.it (HELO freebsd167.cost.it)
    (213.156.62.167) by ertps004 (qpsmtpd/0.42rc1) ...

Log files have:

2008/02/13-23:59:58 ertps004[10709]:

ALL plugins that uses config(me) (eg: spamassassin, rcpt_ok, queue/smtp-forward, various virus/*). get hostnames. queue/smtp-forward emits invalid HELOs via Net::SMTP) etc. etc. etc.




Reply via email to