メールキューの削除

大量にキューがたまってしまったので、久しぶりにpostfix manualを見ましたw
指定したsenderアドレスのキューを削除する
mailq | tail +2 | awk 'BEGIN { RS = "" }
# $7=sender, $8=recipient1, $9=recipient2
{ if ($7 == "user@example.com")
print $1 }
' | tr -d '*!' | postsuper -d -
指定したrecipientアドレスのキューを削除する
mailq | tail +2 | awk 'BEGIN { RS = "" }
# $7=sender, $8=recipient1, $9=recipient2
{ if ($8 == "user@example.com" && $9 == "")
print $1 }
' | tr -d '*!' | postsuper -d -
ちゃんと削除できました。