Sendmail w/ queue groups / Multiple queues

William Burns William.Burns at AEROFLEX.COM
Tue Apr 20 20:17:43 IST 2004


Kevin:

Hi... Thanks for the info. This is really interesting.

If someone could add to that the name of a variable containing the
full-path to a pair of spool files... I think I could make this work.
What variable(es) are these?

I see how you're doing multiple outbound mail queue directories. It's
coded to be dependent on an internal mailscanner variable.
So you can prioritize outbound delivery based on whether or not it's
tagged as SPAM. Very cool.

... I see what you mean about the StartInSendmail and StartOutSendmail
functions... W/ sendmail queue-groups I can already have a single
sendmail daemon process monitor multiple queue directories. ...So that
part's already handled.

The trick is going to be getting mailscanner to understand which
directory each spool file originally came from, and placing that info
into a variable that can be used in a MyQueueDir function.
So... logically... If I can write a function for "Outgoing Queue Dir"
then I can also write one for "Incoming Queue Dir"... But will that give
me access to the name and location of each queue file as mailscanner
picks it up?
Looking at the MailScanner.config file, there's an example of a wildcard
for "Incoming Queue Dir". I should use that...

Tracing the use of "Incoming Queue Dir" brings me to Config.pl and the
"inqueuedir" variable. (which looks like a list of directories that gets
passed to" ReadInQueueDirs()"? and gets pushed back into inqueuedir?)
Then I loose it. I can't find where that gets used.

-Bill

Shortt, Kevin wrote:

>Hi Bill,
>
>We've done multiple outbound queues, but not inbound.
>It worked wonderfully. It gave us the ability to offset
>bottleneck loads to our M$ Exchange servers (that also run our A/V).
>We held up the mail in the spam queues and delivered the non-spam
>mail right through during difficult times.
>
>We received some help from Julian when we did this.
>Here is what we did for multiple outbound queues.
>
>In /etc/MailScanner/MailScanner.conf
>change the "Outgoing Queue Dir" setting to a custom function
>that get's placed in CustomConfig.pm.
>
>   Outgoing Queue Dir = &MyQueueDir
>
>
>Then in /usr/lib/MailScanner/MailScanner/CustomConfig.pm
>add the following functions:
>
>   sub InitMyQueueDir {
>           MailScanner::Log::InfoLog("Initialising Custom Queue
>Directories");
>   }
>
>   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';
>   }
>
>   sub EndMyQueueDir {
>            MailScanner::Log::InfoLog("Ending Custom Queue Directories");
>   }
>
>
>Now you need queue runners that get started up....
>in /etc/init.d/MailScanner inside the "StartOutSendmail()" function
>add the following lines to the "elif...MTA = sendmail" section.
>
>        $SENDMAIL -q1m -OPidFile=$OUTPID1 -L sm-spam
>-OQueueDirectory=/var/spool/mqueue.spam
>        $SENDMAIL -q5m -OPidFile=$OUTPID2 -L sm-highspam
>-OQueueDirectory=/var/spool/mqueue.highspam
>
>
>
>Set your queue times to your appropriate needs.
>
>This system worked great for us.
>I would imagine you should be able to the something similar for the inbound
>by
>modifying the "StartInSendmail" and writing a custom function.
>
>I hope this helps you out.
>Let me know how it works out for you.
>
>-k
>
>
>



More information about the MailScanner mailing list