Delete one message with the named queue ID from the named mail queue(s) (default: hold, incoming, active and deferred).
If a queue_id of – is specified, the program reads queue IDs from standard input. For example, to delete all mail with
exactly one recipient user@example.com:
Thanks dude! Just what I was looking for!
Hi Its helpfull but i need command to delete some particular mails from queue
type man postsuper for details…
Delete one message with the named queue ID from the named mail queue(s) (default: hold, incoming, active and deferred).
If a queue_id of – is specified, the program reads queue IDs from standard input. For example, to delete all mail with
exactly one recipient user@example.com:
mailq | tail +2 | grep -v ’^ *(’ | awk ´BEGIN { RS = “” }
# $7=sender, $8=recipient1, $9=recipient2
{ if ($8 == “user@example.com” && $9 == “”)
print $1 }
´ | tr -d ’*!’ | postsuper -d -
That wont work, script fails at +2
Thanks dude. Works like a charm on MAMP (Mac OSX) as well.
Saved me a lot of time.