Handling a Down Site
If a site is down, messages to that site can collect in the queue. If the site is expected to be down for a protracted period of time, those queued messages will begin to time out and bounce. To prevent them from bouncing, you can move them to a separate queue directory. Later, when the down site comes back up, you can process that separate queue.
There are two ways to move mail to a holding queue. One way is to simply move them to a different directory, but you cannot do that if you are using queue groups. The other way is to use queue groups, as we show later.
Move mail with qtool.pl
If you are not using queue groups, you can move the affected messages to a separate queue using the contrib/qtool.pl script supplied with the sendmail source. If you are using queue groups, you should skip to the next section.
To use qtool.pl, you first make a destination directory, if one does not already exist:
#mkdir /var/spool/newqueue
#chmod 700 /var/spool/newqueue
Next, run qtool.pl to move messages from the regular queue to the new holding queue:[190]
# contrib/qtool.pl /var/spool/newqueue /var/spool/mqueues/q.1
When the down site comes back up at a later time (say, 50 days later), the messages that have been saved in the holding directory can be delivered by running the following command by hand (it has been wrapped to fit the page):
%/usr/sbin/sendmail -OQueueDirectory=/var/spool/newqueue -OTimeout.queuereturn=51d
-OTimeout.queuewarn=0 -q
The -OTimeout.queuereturn=51d
causes ...
Get sendmail, 4th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.