Created
May 20, 2015 11:58
-
-
Save caugner/01c6013270405cf6bd7a to your computer and use it in GitHub Desktop.
Remove messages from mail queue by recipient
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Adapted from `man postsuper` (in earlier tail versions, one could write the shortcut `tail +2` to skip the first line) | |
mailq | tail -n +2 | grep -v '^ *(' | awk 'BEGIN { RS = "" } | |
# $7=sender, $8=recipient1, $9=recipient2 | |
{ if ($8 == "[email protected]" && $9 == "") | |
print $1 } | |
' | tr -d '*!' | postsuper -d - |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment