Created
November 16, 2021 10:00
-
-
Save osallou/36c7d5bc1d106bfcf0ded067ff542b3a to your computer and use it in GitHub Desktop.
Cleanup postfix with string match
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
#!/bin/bash | |
[ ! -n "$1" ] && echo "Usage : $0 mail" && exit 1 | |
for mail in $( mailq|egrep '^[A-Z0-9]'|grep "$1"|awk '{print $1}'|sed 's/^\([0-9A-Z]*\).*$/\1/' ) | |
do | |
/usr/sbin/postsuper -d $mail | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment