Postfix queue management

Haven’t touched Postfix in a long time since I do very little administration work anymore, but recently found a server that had a ton of mail queued up.

The way I used to manage it was with You could find it here – – it shows a graphical (curses based) user interface that allows you to select messages, read them, delete them, etc.

What if I wanted to really delete a ton of messages though? I did a quick search and found and modified the command to work for me. I decided to run these commands:
mailq | tail +2 | awk ‘BEGIN { RS = “” } / MAILER-DAEMON*/ { print $1 }’ | tr -d ‘*!’ | postsuper -d –
mailq | tail +2 | awk ‘BEGIN { RS = “” } / [email protected]\.shocknetwork\.com$/ { print $1 }’ | tr -d ‘*!’ | postsuper -d –

This way, I’m getting rid of all of the bounce and double bounce messages and also the ones from root that probably aren’t important.

Zimbra – postfix transport

Instead of using the /etc/postfix/transport flat file for routing, Zimbra allows you to set this via the command line:
./zmprov cd zimbraMailTransport zimbraDomainType transport

In this case here, the mail domain we’re changing the MTA to is and the domain is so that all email to will go to

What changed on the back end is that there’s an entry written to the ldap server:
dn: dc=excite,dc=com
zimbraMailStatus: enabled
zimbraId: 50243e3e-2435-4366-8c18-33697b15f136
dc: excite
zimbraDomainType: transport
objectClass: dcObject
objectClass: organization
objectClass: zimbraDomain
o: domain

# people,
dn: ou=people,dc=excite,dc=com
ou: people
objectClass: organizationalRole
cn: people