This section describes how to keep the mail service running smoothly.
You can print the contents of the queue with mailq.This command is equivalent to specifying the -bp flag to sendmail.
Type /usr/bin/mailq | more and press Return.
A list of the queue IDs, the size of the message, the date the message entered the queue, the message status, and the sender and recipients are displayed.
Type /usr/lib/sendmail -q -v and press Return.
This forces the processing of the queue and displays progress of the jobs as the queue is cleared.
You can run a subset of the queue at any time with the -qRstring (run queue where any recipient name matches string) or with -qInnnnn (run just one message with queue ID nnnnn). The string can also match host names, so any substring of user@host.domain will match.
This example processes everything in the queue for recipient wnj.
# /usr/lib/sendmail -qRwnj |
Type /etc/init.d/sendmail stop and press Return.
This kills the old sendmail daemon to keep it from trying to process the old queue directory.
Type cd /var/spool and press Return.
Type mv mqueue omqueue; mkdir mqueue and press Return.
This moves the directory, mqueue, and all its contents to the omqueue directory and then creates a new empty Rmqueue directory.
Type chmod 755 mqueue; chown daemon.daemon mqueue and press Return.
These commands set the permissions of the directory to read/write/execute by owner, and read/execute by group and others; these commands also set the owner and group to daemon.
Type /etc/init.d/sendmail start and press Return.
This starts a new sendmail daemon.
Type /usr/lib/sendmail -oQ/var/spool/omqueue -q and press Return.
The -oQ flag specifies an alternate queue directory and the -q flag says to run every job in the queue. Use the -v flag if you want to see the verbose output displayed on the screen.
When the queue is finally emptied type rmdir /var/spool/omqueue and press Return.
This removes the empty directory.