Tuesday, 9 August 2011

Quick Sendmail Cheatsheet

We received a support ticket today for a mail server that hasn't been working since July, yes, they noticed today... It's only used for mail from their website but managed to build up a queue of 3916 messages, so I figured it might be nice to blog a cheatsheet for sendmail:

Attempt to send messages by flushing the queue:
sendmail -q

See the entire queue:

Fast way to print how many messages are in the queue:
mailq –OmaxQueueRunSize=1

Delete all the e-mails in the queue without timing out any messages:
sendmail –q –Otimeout.queuereturn=99d

Delete from a specific sender:
sendmail -qS -v example.com

Delete to a specific recipient:
sendmail -qR -v example.com

No comments:

Post a Comment