New functionality?

Kearney, Rob RKearney at AZERTY.COM
Mon Nov 17 17:28:53 GMT 2003


wow.. It still amazes me that I keep forgetting about using "functions"
instead of "values" for variables.   That makes MailScanner so versatile and
dynamic, its almost beyond belief.  Another testament to the coders of
MailScanner...


Thanks a lot Julian.  I guess I need to think more "outside-the-box".


-rob


-----Original Message-----
From: Julian Field [mailto:mailscanner at ECS.SOTON.AC.UK]
Sent: Monday, November 17, 2003 11:58 AM
To: MAILSCANNER at JISCMAIL.AC.UK
Subject: Re: New functionality?


At 14:54 17/11/2003, you wrote:
>After having some internal problems with my exchange server(cringe), which
>our MailScanner server, must forward all mail to afterwards, I thought of
>some cleaver ideas, perhaps they are not original, but here is something I
>would like to see:
>
>MailScanner to have the ability to specify separate outbound directories,
>and therefore Queue runners for the different levels of Mail:  1 for
>Non-Spam, 1 for Spam, 1 for High-Scoring Spam.
>
>so.. i.e. (sendmail)
>
>                 /var/spool/mqueue for non-spam email
>                 /var/spool/mqueue.spam for spam email
>                 /var/spool/mqueue.highspam for high scoring email.
>
>And in addition, each queue directory would have a Queue Runner associated
>for it.

You can do this already with a very simple Custom Function.
Here is how you do it:

In MailScanner.conf, set
Outgoing Queue Dir = &MyQueueDir

and then in CustomConfig.pm add this code.

sub MyQueueDir {
         my($message) = @_;

         return '/var/spool/mqueue' unless $message; # catch-all if message
is duff
         return '/var/spool/mqueue.highspam' if $message->{ishigh};
         return '/var/spool/mqueue.spam' if $message->{isspam};
         return '/var/spool/mqueue';
}

Note: I haven't tested that at all, but it should work okay.

Create the 2 new queue directories, restart MailScanner and run your new
extra queue runners like this
/usr/sbin/sendmail -q30m -OQueueDirectory=/var/spool/mqueue.highspam
/usr/sbin/sendmail -q20m -OQueueDirectory=/var/spool/mqueue.spam

--
Julian Field
www.MailScanner.info
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



More information about the MailScanner mailing list