2010-06-11

Cutting mailq

Removing selected mail messages from postfix's mail queue based on sender on recipients:


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 -

No comments: