To delete from a postfix mail queue, those stucked emails from a particular address, use this:
mailq | tail -n +2 | grep -v '^ *('| awk 'BEGIN { RS = "" } { if ($7 == "from@addr" && $9 == "") print $1 } '|tr -d '*!' | postsuper -d -
Can be costumized to extract different type of emails, instead of those “from@addr”.
Recent Comments