Tag Archives: mailq

postfix delete email by subject

postfix delete email by subject

postfix
postfix

To list From, To and Subject from all safematix.com emails

mailq | awk '/ Sep .*safematix.com/{ print $1 }' | tr -d \* | while read id; do postcat -q "$id" | egrep '^(Subject|From|To):'; echo; done

To delete all emails from safematix.com, with subject tbd

mailq | awk '/ Sep .*safematix.com/{ print $1 }' | tr -d \* | while read id; do postcat -q "$id" | grep "^Subject: tbd" > /dev/null && echo $id; done | postsuper -d -