hostname variable in attachment replacement

Julian Field MailScanner at
Thu Aug 6 14:42:15 IST 2009

On 06/08/2009 14:24, Erik Bloodaxe wrote:
> Julian Field wrote:
>>> # grep Hostname /opt/MailScanner/etc/MailScanner.conf
>>> # definition of "Hostname" for an example.
>>> # Hostname = the %org-name% ($HOSTNAME) MailScanner
>>> #Hostname = the %org-name% ($HOSTNAME) MailScanner
>>> Hostname = the %org-name% MailScanner (on $HOSTNAME)
>>> And HOSTNAME cones out as blank.
>> Unfortunate.
> Am I to conclude that there is no solution then?
If "$HOSTNAME" in MailScanner.conf comes out blank, then you'll have to 
set it in the MailScanner.conf file by hand (or by your own 
install/config script or whatever of course).

Just had a look at the code, and ${KEYWORD} and $KEYWORD are translated 
into $ENV{KEYWORD}, so if $HOSTNAME is set in your environment variables 
when you start MailScanner, $HOSTNAME or ${HOSTNAME} will both work in 
your MailScanner.conf.

If you need to use some other shell variable $FOOBAR, then you can use 
any old ${FOOBAR} or $FOOBAR in MailScanner.conf as you choose.


Julian Field MEng CITP CEng
Buy the MailScanner book at

Need help customising MailScanner?
Contact me!
Need help fixing or optimising your systems?
Contact me!
Need help getting you started solving new requirements from your boss?
Contact me!

PGP footprint: EE81 D763 3DB0 0BFD E1DC 7222 11F6 5947 1415 B654
Follow me at and

This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

More information about the MailScanner mailing list