Top Nav

Archive | Email

Alternate SMTP Port

Here’s a quick IPTables rule to setup an alternate non-standard SMTP port without reconfiguring the mail server software:


Export Zimbra mailbox

To export the mailbox for as a zip file use this command:

/opt/zimbra/bin/zmmailbox -z -m getRestURL \
‘//?fmt=zip&query=is:anywhere’ >

Here is the same as a tgz file:

/opt/zimbra/bin/zmmailbox -z -m getRestURL \
“//?fmt=tgz” > /tmp/account.tgz

And here’s a restore of the tgz file:

/opt/zimbra/bin/zmmailbox -z -m postRestURL \
“//?fmt=tgz&resolve=reset” /tmp/account.tgz


Zimbra Mailbox Size

Here’s a simple script that will provide a report on mailbox size for every mailbox on a Zimbra server. The report is sorted by box size in descending order:


Courier – Disable weak SSL ciphers

You can disable SSLv2 in Courier by adding the following line to both /etc/courier-imap/imapd-ssl and /etc/courier-imap/pop3d-ssl:

After restarting Courier you should test with openssl to verify SSLv2 has been disabled properly:

You can test that weak ciphers have been disabled with the following:


Postfix Mailtrap

Recently we needed to setup a postfix server that would route all email to a local mailbox regardless of original destination. Here’s the solution:

1) Add this line to /etc/postfix/ (if it’s not already present):

recipient_canonical_maps = regexp:/etc/postfix/canonical

2) Add the following line to /etc/postfix/canonical (replace “username”):

/.*/ username@localhost

3) Run “postfix reload”

That should make it deliver all mail to the specificed local user. Make sure localhost is in the mydomains file (or the mydomains setting in, if it doesn’t use a seperate file), or just use any valid local domain.