MailScanner.conf and MailScanner.conf.local

Rick Cooper rcooper at dwford.com
Wed Jul 11 22:51:05 IST 2007


 

 > -----Original Message-----
 > From: mailscanner-bounces at lists.mailscanner.info 
 > [mailto:mailscanner-bounces at lists.mailscanner.info] On 
 > Behalf Of Nigel Kendrick
 > Sent: Thursday, July 12, 2007 4:53 AM
 > To: 'MailScanner discussion'
 > Subject: MailScanner.conf and MailScanner.conf.local
 > 
 > Julian et al.
 > 
 > It occurs to me that over my not-very-massive pile of 4 mail 
 > servers, many
 > of the settings are common to the lot and if I tweak a 
 > 'generic' setting on
 > one I generally tweak it on all of them. To this end, is it 
 > possible (or
 > would it be possible) to have the site-specific settings in 
 > one config file
 > and generic ones in another (MailScanner.conf.local and 
 > MailScanner.conf?)
 > so I could arrange for a replication script to keep the 
 > generics in sync? 
 > 

I don't know what your "generic" settings are but I have about a dozen
things that change depending on which server mailscanner is installed in.
Most of them have to do with site names and such. I use
lib/MailScanner/CustomConfig.pm to set environment variables for the items I
need changed for example:

Each server has a file (example) /SomeDir/ThisSig that contains an (Unique)
entry like:
ABC

my %Sigs = (
 			'ABC' => "company1.com:My First
Company:www.company1.com/mailrejected.php",
			'EFG' => "company1.com:My First
Company:www.company1.com/mailrejected.php",
			'HIJ' => "company1.com:My First
Company:www.company1.com/mailrejected.php"
);

my $CoSig;
$CoSig = `/bin/cat /SomeDir/ThisSig`;
chomp($CoSig);
my $SigStr = $Sigs{$CoSig};
my ($OrgName,$OrgNameLong,$WebSite) = split(/:/,$SigStr);
$ENV{ORGNAME} = $OrgName;
$ENV{ORGNAMELONG} = $OrgNameLong;
$ENV{MSWEB} = $WebSite;
$ENV{COSIG} = $CoSig;

Now in MailScanner.Conf I use settings like

%org-name% = ${ORGNAME}
%org-long-name% = ${ORGNAMELONG}
%web-site% = ${MSWEB}
Spam Header = X-${COSIG}-MailScanner-SpamCheck

If you didn't want to maintain the %Sigs part (not a problem for me because
I don't add or subtract servers very often)
You could just eliminate that part and set the entries in /SomeDir/ThisSig
like

ABC::ParamOne::ParamTwo::ParamThree:ParamFour

And then 

$CoSig = `/bin/cat /SomeDir/ThisSig`;
chomp($CoSig);
my ($OrgKey,$ParamOne,$ParamTwo,$ParamThree,$ParamFour) =
split(/::/,$CoSig);
$ENV{P1} = $OrgKey;
$ENV{P2} = $ParamOne;
$ENV{P3} = $ParamTwo;
$ENV{P4} = $ParamThree;
$ENV{P5} = $ParamFour;

And then in MailScanner.conf : Some Setting = ${P4}/other/stuff

Now I can (and do) push out one MailScanner.conf that will handle all the
servers based on their specific information contained in /SomeDir/ThisSig. I
don't think there is a setting in MailScanner that could pertain to site
specific information that will not allow the ${ENV_VAR} format.

Rick


--
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