Multiple queues in sendmail

By default, sendmail sends from a single queue. Needless to say, this is not ideal from a performance perspective. Fortunately, setting up sendmail to use multiple queues is easy!

First, create a directory for each queue you want, e.g.

mkdir /var/spool/mqueue/q{1,2,3,4,5}

Ensure that the permissions and ownerships are correct for your mail install (should be the same as /var/spool/mqueue).

Edit /etc/mail/sendmail.cf to include a QUEUE_DIR definition with a wildcard including the appropriate directories:

define(`QUEUE_DIR', `/var/spool/mqueue/q*')dnl

Regenerate sendmail.cf if needed, and restart sendmail. You can verify that this worked with the mailq command. In the example here, we'd go from:

[root@www tmp]# mailq
/var/spool/mqueue is empty
                Total requests: 0

to

[root@www tmp]# mailq
/var/spool/q1 is empty
/var/spool/q2 is empty
/var/spool/q3 is empty
/var/spool/q4 is empty
/var/spool/q5 is empty
                Total requests: 0

Submitted by jkelly on Thu, 2006-09-07 07:01. categories [ | ] login or register to post comments