Skip to content

Instantly share code, notes, and snippets.

@leogallego
Last active October 1, 2018 06:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leogallego/b99be6b47010608d500928b9e116469f to your computer and use it in GitHub Desktop.
Save leogallego/b99be6b47010608d500928b9e116469f to your computer and use it in GitHub Desktop.
#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