Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#To first see what would be deleted. As root:
```
/opt/zimbra/postfix/sbin/postqueue -p | egrep -v '^ *\(|-Queue ID-' \
| awk 'BEGIN { RS = "" } { if ($7 == "email@domain.com") print $1} ' | tr -d '*!'
```
#If you get error about egrep, you might need to use this syntax:
```
/opt/zimbra/postfix/sbin/postqueue -p | /bin/egrep -v '*\(|-Queue ID-' \
| awk 'BEGIN { RS = "" } { if ($7 == "email@address.com") print $1} ' | tr -d '*!'
```
#To now delete, just include the postsuper -d at end:
```
/opt/zimbra/postfix/sbin/postqueue -p | egrep -v '^ *\(|-Queue ID-' \
| awk 'BEGIN { RS = "" } { if ($7 == "email@domain.com") print $1} ' \
| tr -d '*!' | /opt/zimbra/postfix/sbin/postsuper -d -
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment