Help Expanding MultipleQueueDir function

Julian Field MailScanner at ecs.soton.ac.uk
Tue Jun 13 18:28:34 IST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



Errol Neal wrote:
> Thanks for your help Julian. This is the final result..
>
> my ($PriorityDomainListFile) =
> '/etc/MailScanner/rules/prioritylist.conf';
>   
Add the line
my %PriorityDomainList = ();
> use FileHandle;
>
> sub InitMultipleQueueDir {
>     MailScanner::Log::InfoLog("Initialising list for domains receiving
> priority service");
>                               #"from %s", $PriorityDomainListFile);
>     my $listfile = new FileHandle;
>
>     unless($listfile->open("<$PriorityDomainListFile")) {
>         MailScanner::Log::WarnLog("Could not read list of domains for
> priority service " .
>                                    "from %s", $PriorityDomainListFile);
>
>         return;
> }
>
>   my($fh, $line, %PriorityDomainList);
>   
Replace that with
my($fh, $line);
>   $line = 0;
>   while (<$listfile>) {
>       $line++;
>       chomp;
>       #print STDERR "Line is \"$_\"\n";
>       s/#.*$//; # Strip comments
>       s/\S*:\S*//g; # Strip any words with ":" in them
>       s/^\s+//g; # Strip leading whitespace
>       s/^(\S+)\s.*$/$1/; # Use only the 1st word
>       s/^\*\@//; # Strip any leading "*@" they might have put in
>       #print STDERR "Line is \"$_\"\n";
>       next if /^$/; # Strip blank lines
>       #$PriorityDomainList->{$PriorityDomainListFile}{lc($_)} = 1; #
> Store the domains
>       $PriorityDomainList{lc($_)} = 1;
>       return;
>   
Remove that return;
>     }
>     $fh->close();
>     MailScanner::Log::InfoLog("Read %d domains from %s", $line,
> $PriorityDomainListFile);
>
>     }
>
>
> sub EndMultipleQueueDir {
>     MailScanner::Log::InfoLog("Shutting down priority domain list");
>
> }
>
>
> sub MultipleQueueDir {
>   my($message) = @_;
>
>   return '/var/spool/mqueue' unless $message; # Sanity check the input
>
>   my(@todomain, $todomain, $isspam);
>   @todomain   = @{$message->{todomain}};
>   $todomain   = $todomain[0];
>   $isspam     = $message->{isspam};
>
>
>   return '/var/spool/mqueue.priority' if $PriorityDomainList{$todomain};
>   return '/var/spool/mqueue.spam' if $isspam;
>
>   # It is not in the list
>   return '/var/spool/mqueue';
> }
>
>
> I get an error though when starting it up.
>
>  Global symbol "%PriorityDomainList" requires explicit package name at
> /usr/lib/MailScanner/MailScanner/CustomConfig.pm line 718.
>
> Any thoughts?
>
>   

- -- 
Julian Field
www.MailScanner.info
Buy the MailScanner book at www.MailScanner.info/store
Professional Support Services at www.MailScanner.biz
MailScanner thanks transtec Computers for their support

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


-----BEGIN PGP SIGNATURE-----
Version: PGP Desktop 9.0.6 (Build 6060)

iQA/AwUBRI71wxH2WUcUFbZUEQL4/wCeNwQx6W/VW7TZcy76hXdQIe9d6oUAn2Yx
tiBOZxG94TF6nLXSPEKzccDq
=zaxR
-----END PGP SIGNATURE-----

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
MailScanner thanks transtec Computers for their support.



More information about the MailScanner mailing list