23.7 Process Alternate Queues
The
sendmail
program provides the ability to use
queue directories other than the one listed in the configuration
file's
Note that the 23.7.1 Handling a Down SiteIf 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. To move the affected messages to a separate queue, you may use a Bourne shell script like the following:
#!/bin/sh set -u QUEUE=/var/spool/mqueue NEWQ=/var/spool/newqueue if [ ! -d $QUEUE ] then echo "${QUEUE}: Does not exist or is not a directory" exit 1 fi if [ ! -d $NEWQ ] then mkdir -p $NEWQ if [ $? -ne 0 ] then echo "${NEWQ}: Can't create" exit 2 fi fi find ${QUEUE} -type f -name qf* -print |\ while read QF do IDENT=`echo $QF | sed -e "s,^${QUEUE}/qf,,"` grep "^R" ${QUEUE}/qf${IDENT} echo -n "move ${IDENT}? (y/n) " read answer case $answer in [nN]*) continue;; *) ;; esac mv ${QUEUE}/*${IDENT} $NEWQ if [ $? -ne 0 ] then echo "Move failed" exit 3 else echo "Move succeeded" fi done /usr/lib/sendmail -OQueueDirectory=${NEWQ} -bp
This script creates a new queue directory, $NEWQ, if it doesn't
exist. It then prints the recipient list for each
% When the down site comes back up at a later time, the messages that have been saved in $NEWQ can be delivered by running the following command by hand:
%
The |
|