hostname variable in attachment replacement

Glenn Steen glenn.steen at
Fri Aug 7 15:34:41 IST 2009

2009/8/7 David Lee <t.d.lee at>:
> On Fri, 7 Aug 2009, Randal, Phil wrote:
>> Julian Field wrote:
>>> "$HOSTNAME" shouldn't work in the reports, only in MailScanner.conf.
>>> But "$hostname" should work in the reports.
>>> Jules
>> But it doesn't seem to.
>> It is a low priority for me at the moment, and my test box is a VM at
>> home, so it will take me a while to figure out what's going on.
>> Cheers,
>> Phil
> Hmmm... I think there are many of us here on this list who are expecting the
> variable to have been automatically set prior to the point of use with a
> reasonable default (e.g. from "uname -n" or "/bin/hostname" or similar) but
> who are finding it empty/unset.  (There may well be others here, for whom a
> default is being set.)
> The human expectation and the computer-code reality don't marry up;
> something somewhere (either human or machine) is going astray.
> Wouldn't it help if the MS start up code could have something like:
>   if not set/inherited ... then set to something '/bin/hostname'-ish.

Could you please just take a look at the standard MailScanner init
script? The second file that get sourced is /etc/sysconfig/network.

So the setting of the HOSTNAME variable derives solely from this
(taking precedence over any setting in the rc scripts). Sorry for not
checking this earlier.
Can someone who has this problem corroborate that they have either an
empty setting, or no setting at all, for HOSTNAME in that file, or
that the setting is just plain wrong?

-- Glenn
email: glenn < dot > steen < at > gmail < dot > com
work: glenn < dot > steen < at > ap1 < dot > se

More information about the MailScanner mailing list