Sendmail w/ queue groups / Multiple queues

Shortt, Kevin KShortt at AZERTY.COM
Tue Apr 20 14:54:08 IST 2004


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