Revision as of 16:04, 4 August 2012 by Shanxt (talk | contribs)

Zimbra Log Sorter

Script to sort Zimbra logs. Makes logs more legible, and can also show logs containing certain regexs. Use '--help' to see all options. Use '--examples' to see some examples.

Latest version of the script can be found here:

Simple archival server for Zimbra OSE


This document shows how to create a simple archiving server. If you have a user '', all mails sent to and from this email ID will be forwarded to ''.

We will need two servers for this. Both will be installed with Zimbra, one being the live mail server '', and the other the archiving server, ''. The archiving server should have a much larger HDD drive than the mail server, preferably formatted using LVM, to allow for expansion later.

The installation on each server will be independent, ie, this isn't a multi-server setup. Each server will be a single-server, with the only difference being the domain names.

In this example, let's assume the live server's domain is '', with IP, and the archiving server is '', with IP Install Zimbra on both as usual.


The servers will require a local DNS, as we use this to forward the mails. In this example, I will assume that we have set up a caching name server using bind on the live server. Typical entries would be something like this:       	IN A         IN A              IN MX           10

Along with this, we need to add an A and MX record for as well.    IN A      IN MX           10

Now all mails addressed to '' will be forwarded to the archive server.


In postfix, we can specify an email address to which all incoming and outgoing mails from a particular email ID will be forwarded to. This is done using 'sender_bcc_maps' and 'recipient_bcc_maps'. All these changes are done only on the main server.

We make the following entries at the end of /opt/zimbra/postfix/conf/

sender_bcc_maps = hash:/opt/zimbra/postfix/conf/archivelist
recipient_bcc_maps = hash:/opt/zimbra/postfix/conf/archivelist

The file '/opt/zimbra/postfix/conf/archivelist' will have users in the following format:

All mails to and from will be forwarded to

Manual addition

Create a user on the main server, and then the corresponding user on the archive server. Then add the users in the format as show above to the file '/opt/zimbra/postfix/conf/archivelist', and then run the postmap command as the zimbra user:

$ postmap /opt/zimbra/postfix/conf/archivelist
$ postfix reload


I wrote the following script to add users automatically on the archive server, and also to the 'archivelist' file. Run this on the main server, and all users will be automatically added. You can place it in the crontab for every half an hour, so that when a new user is created on the main server, he/she will be automatically added to the archive server. SSH using keys (password-less ssh) between the main and archive server is necessary for the script to function.

The latest version of the script can be found here:

NOTE: All mails, sent and received, will be stored in the inbox of the archive user.

Jump to: navigation, search