The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 2,466 other followers

a few notes on sendmail and re-trying deferred messages

Posted by jpluimers on 2013/07/05

My sendmail setup is a 2-staged one.
Every once in a while one of the stages stops, and mostly they recover.
Sometimes the second stage doesn’t, which causes a lot of messages in the queue get the deferred status.

Re-trying those deferred messages was a bit of a trial and error case, as my search efforts resulted in a lot of messages telling me what should work, but not what actually works.

First of all, mailq shows you what is stuck in the queue.

snap:~ # mailq
                /var/spool/mqueue (2 requests)
-----Q-ID----- --Size-- -----Q-Time----- ------------Sender/Recipient-----------
q9FLFBkD002197    11967 Mon Oct 15 23:15 MAILER-DAEMON
                 (Deferred: Connection timed out with
q7S6oxgS023145     5067 Tue Aug 28 08:50 MAILER-DAEMON
      8BITMIME   (Deferred: Connection timed out with
                Total requests: 2

You can add some parameters for it to show other queues.

So I have a little mq script that shows all queues:

echo "Outgoing mailq";
sudo mailq;
echo " ";
echo "Submit mailq";
sudo mailq -Ac;
echo " ";
echo "Incoming mailq";
sudo mailq -C/etc/;

These are the commands I tried to flush the outgoing mailq:

sendmail -v -q
sendmail -v -q -OTimeout.hoststatus=0m
sendmail -v -qR@

Only the last one worked correctly.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: