hostname variable in attachment replacement

Michael Mansour micoots at yahoo.com
Fri Aug 7 09:51:32 IST 2009


Hi,

--- On Fri, 7/8/09, Randal, Phil <prandal at herefordshire.gov.uk> wrote:

> From: Randal, Phil <prandal at herefordshire.gov.uk>
> Subject: RE: hostname variable in attachment replacement
> To: "MailScanner discussion" <mailscanner at lists.mailscanner.info>
> Received: Friday, 7 August, 2009, 5:07 PM
> Julian Field wrote:
> > On 06/08/2009 16:21, David Lee wrote:
> >> Dare I say "me, too"?
> >> 
> >> I seem to recall reporting this (empty 'HOSTNAME')
> a few years ago.
> >> We're now on CentOS 5.3 with MS 4.76.24, and a
> configuration that
> >> tries not to change things unnecessarily. 
> Still seeing it (although
> >> our MS configuration only rarely invokes pathways
> that need it.)
> >> 
> >> I get the feeling that the _intended_ behaviour is
> for MS's
> >> "HOSTNAME" variable to try to inherit a default
> value from somewhere
> >> (i.e. to try to avoid being empty). 
> >> 
> >> This intention might be the result of "uname -n"
> or similar, and
> >> probably for a shell HOSTNAME variable, if any, to
> override it.  Fair
> >> enough. Indeed, when I ssh to a box, there is such
> a variable
> >> present on such a login. 
> >> 
> >> But I suspect that, on a reasonably "out of the
> box"
> >> Fedora/CentOS/Redhat installation, by the time
> "/etc/init.d" is
> >> starting MS, neither is HOSTNAME yet set, nor is
> MS getting it from
> >> executing "uname -n" (or similar).
> >> 
> >> Shouldn't the startup algorithm be something like
> (pseudo-perl):
> >> 
> >>    $HOSTNAME = if $ENV{'HOSTNAME'} was
> set
> >>             
>   then $ENV{'HOSTNAME'}
> >>             
>   else `uname -n`;
> >>             
>   # i.e. inherit env.var. HOSTNAME
> >>             
>   # else fall back to using system hostname
> >> 
> >> Sorry that's so vague.  But I hope it helps.
> >> 
> >> 
> >> Jules: could you (a) confirm the intention (for
> HOSTNAME to be
> >> non-empty) (b) outline the intended algorithm to
> achieve that at
> >> "/etc/init.d"-driven startup?
> > It doesn't currently call uname or anything like that
> at all. If
> > $ENV{'HOSTNAME'} is not set, and you had "Hostname =
> $HOSTNAME" or
> > similar in your MailScanner.conf, then you will end up
> with an empty
> > "Hostname" setting.   
> > 
> > Jules
> 
> Well, it is set on my boxes, and not messed with in the
> init scripts, so
> I'm still at a loss.

I did some trouble-shooting (and querying in this list) some year(s) ago too on this very same behaviour and was never able to solve it.

Looking at my setup now, I have a ruleset for Hostname = %rules-dir%/hostnames.rules and in there I have various items with the default being:

FromOrTo:       default                         the %org-name% ($HOSTNAME) Mailscanner

But as I said, the $HOSTNAME has never worked in the reports.

I also use RHEL 4/5 derivative servers.

Regards,

Michael.

> Phil
> -- 
> Phil Randal | Networks Engineer
> Herefordshire Council | Deputy Chief Executive's Office |
> I.C.T.
> Services Division Thorn Office Centre, Rotherwas, Hereford,
> HR2 6JT
> Tel: 01432 260160
> email: prandal at herefordshire.gov.uk
> 
> Any opinion expressed in this e-mail or any attached files
> are those of
> the individual and not necessarily those of Herefordshire
> Council. 
> 
> This e-mail and any attached files are confidential and
> intended solely
> for the use of the addressee. This communication may
> contain material
> protected by law from being passed on. If you are not the
> intended
> recipient and have received this e-mail in error, you are
> advised that
> any use, dissemination, forwarding, printing or copying of
> this e-mail
> is strictly prohibited. If you have received this e-mail in
> error
> please contact the sender immediately and destroy all
> copies of it.    
> --
> MailScanner mailing list
> mailscanner at lists.mailscanner.info
> http://lists.mailscanner.info/mailman/listinfo/mailscanner
> 
> Before posting, read http://wiki.mailscanner.info/posting
> 
> Support MailScanner development - buy the book off the
> website!
> 


      __________________________________________________________________________________
Find local businesses and services in your area with Yahoo!7 Local.
Get started: http://local.yahoo.com.au


More information about the MailScanner mailing list