How to increase sendmail queue runner check interval
Author's note: this is an older article I brought over from my prior blog by popular request. Some of the information may be a little dated.
By default, sendmail will attempt to process/retry deferred messages in hourly intervals. For most environments, that's usually fine. However, some admins may want sendmail to try more often and fortunately, there's a quick way to do that (in RHEL/CentOS at least):
1) When sendmail starts up in RHEL/CentOS, its respective init script references a parameter file: /etc/sysconfig/sendmail
. By default, this file contains the following:
DAEMON=yes
QUEUE=1h
2) The QUEUE=
parameter defines what value is used for the respective-q
switch (which defines how often the queue runner iterates through the queue). The DAEMON
param defines whether or not sendmail launches as a daemon. So for example, with the parameters/example above, sendmail would launch as sendmail -bd -q1h
3) To increase the retry interval, you can set the value for QUEUE=
to something lower. So for example, if you wanted sendmail to try retransmitting deferred messages every 30 minutes, you could change the config file to read:
DAEMON=yes
QUEUE=30m
4) After making the change, stop and start sendmail services:
[foo@examplesystem ~]# service sendmail stop
Shutting down sm-client: [ OK ]
Shutting down sendmail: [ OK ]
[foo@examplesystem ~]# service sendmail start
Starting sendmail: [ OK ]
Starting sm-client: [ OK ]
[foo@examplesystem ~]#
That's it! All set. A word of caution though: Be careful not to set this too low/frequent. Having the queue runner check queues too often (specifically very large queues) can cause multiple runner processes to check the same queue at the same time. This can affect system resources (particularly disk I/O) and potentially impact service availability.