refresh -s sendmail savemail panic in sendmail

“savemail panics” occur when sendmail is unable to deliver a bounced message to the postmaster alias. After being unable to deliver a message for 5 days (by default), sendmail will bounce email to the postmaster alias.

If this alias is not properly configured, sendmail will have a savemail panic: it will not attempt future delivery of the message, but the message remains in the mail queue directory for examination by the system administrator. sendmail renames the header of the queued message from qf to Qf, making it easy to identify these messages in your mail queue. These “lost” messages may also be identified with the mailq -qL command

To diagnose the cause of a savemail panic, first make sure you have the following entries in /etc/aliases: Basic system aliases – these MUST be present MAILER-DAEMON: postmaster postmaster: root

If these entries are present, try running sendmail -bv MAILER-DAEMON and sendmail -bv postmaster. If these commands hang, rebuild the aliases database with by running newaliases or sendmail -bi.

If you still experience savemail panics, gather one or more “lost” message IDs with mailq -qL, rename the appropriate Qf file to qf, and execute the following command

sendmail -v -qImessage_ID -d11

After you have fixed the savemail panic problem, you will want to examine, move, or delete messages that have been preserved by sendmail as a result of a savemail panic.

The following commands will delete messages preserved by a savemail panic (using multiple mail queues):

for queue_dir in q1 q2 q3 q4 q5 
  do 
  cd /var/spool/mqueue/$queue_dir 
  for i in `ls Qf* | cut -c3-`; do rm *$i; done 
done

The following commands will delete messages preserved by a savemail panic (using a single mail queue):

cd /var/spool/mqueue/$queue_dir 
for i in `ls Qf* | cut -c3-`; do rm *$i; done

On AIX:

for i in `ls Qf* | cut -c3-`; do rm *$i; done