Forcing the queue on individual email message

This is a post I made to comp.mail.sendmail

Paul Aviles wrote:

	> I know about sendmail -q, but is is possible to individually kill a
	> pending queued email or force it with or without an NDA?

This is simple. Use the mailq command to find the local queue ID of the message. It will look something like:


You can then flush the message with:

      sendmail -qIyourqueueID -oTnow

The "I" flag to the -q flag specifies which queue ID to use. The -oTnow flag sets the queue timeout to "now". Note sendmail will still try to deliver the message once when you do this. If this is not OK, then blow the message away with:

      rm /var/spool/mqueue/*yourqueueID

But the timeout is much recommended over blowing the message away.

Just another "Harker’s Helpful Hints"