hostname variable in attachment replacement

Erik Bloodaxe E.Bloodaxe at gold.ac.uk
Thu Aug 6 12:27:19 IST 2009


Julian Field wrote:
>
>
> On 06/08/2009 11:09, Erik Bloodaxe wrote:
>> Julian Field wrote:
>>> As clearly shown in the example file supplied in 
>>> /etc/MailScanner/reports/en/stored.filename.message.txt,
>>>
>>> Note to Help Desk: Look on $hostname in $quarantinedir/$datenumber 
>>> (message $id).
>>>
>>> Note the "$hostname" in the line above.
>>>
>>> On 06/08/2009 10:13, Erik Bloodaxe wrote:
>>>> Is there a way to have a variable in the attachements that replace 
>>>> unacceptable file types and content that expands to the host names.
>>>>
>>>> I.e. in stored.filename.message.txt in etc/reports/en
>>>>
>>>> I want a line saying
>>>>
>>>> File is in: $(HOSTNAME) in $quarantinedir/$datenumber/$id
>>>>
>>>> so that my sysadmins can see which of the many servers the file is 
>>>> on as the standard reports give them no indication of which server 
>>>> to get the file from.
>>>>
>>>> I have tried all the obvious
>>>>
>>>> Regards
>>>>
>>>> Erik
>>>>
>>>
>>> Jules
>>>
>> This does not seem to work - $hostname expands to a blank, the 
>> enviroment variable $HOSTNAME is set in the environment for login 
>> shells but appears not to be set for system started scripts, very few 
>> changes have been made to the default install.  This is on RedHat 5.
> Have you set the "Hostname" setting in MailScanner.conf?
>
> Jules
>
yes:

# 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.  %hostname% does not work either.

Erik



More information about the MailScanner mailing list