How to transfer mail from your mail server to Zimbra?

    “You have to run as fast just to stay in the same place” - this phrase of Lewis Caroll can be safely applied to the work of IT specialists, because trends in the information technology industry are changing faster than anywhere else. So, for example, a corporate mail server, once introduced at an enterprise, no longer fully meets the needs of a modern business, which, in order to stay afloat, needs a complete collaboration system that can easily integrate with other enterprise information systems.


    IT managers who want to not only organize a working collaborative system at the enterprise, but also save the IT budget as much as possible, often pay attention to the Zimbra Open-Source Edition. The advantages of Zimbra OSE include the free and fully open source code of the solution, as well as the fact that tens of thousands of enterprises around the world successfully use Zimbra OSE in their work. But it’s not enough just to introduce the system in the enterprise, it is necessary to transfer all the accumulated correspondence from the old mail server into it.

    To solve this problem, there are several commercial products with different functionality. However, there is a free way to transfer letters from the old server to Zimbra using the imapsync application. It is he who is officially recommended. However, despite the apparent simplicity, there are still a few pitfalls that IT managers may encounter when synchronizing mail.

    Install imapsync on the source server. Correspondence transfer is carried out by a simple console command, in which the address of the source server and the address of the server with Zimbra, as well as the username and password of the user on both mail servers are indicated.

    imapsync --nosyncacls --subscribe --syncinternaldates \
    --host1 mail.server.local --user1% Login% --password1% Password% \
    --host2 zimbra.server.local --user2% ZimbraLogin% --password2% ZimbraPassword%

    In the event that there are too many users, you can try to automate the process by creating an imap_users file, into which then add information about domains, user names and passwords to their accounts. For example, like this:

    Now it remains only to write a simple script, give it permission to execute and run it. After running the script, the program automatically synchronizes the correspondence between the source mail server and the server with Zimbra. The resulting script will look something like this:

    . imap_users
    src_srv =
    dest_srv =
    for ((i = 0; i <$ {# users [@]}; i ++))
    / usr / bin / imapsync --noauthmd5 --syncinternaldates - -buffersize 65535000 --subscribe \
    -host1 $ src_srv --ssl1 --user1 $ {users [$ i]} --password1 $ {passwords [$ i]} --nofastio1
    --host2 $ dest_srv --ssl2 --user2 $ {users [$ i]} --password2 $ {passwords [$ i]} --nofastio2

    In the event that you are not going to decommission the old mail server after moving to Zimbra and new correspondence will appear on it, you can automate the execution of this script using cron.

    However, smoothly this process looks only on paper. Often, IT managers face unexpected problems. One of them is the default limit of 10 megabytes per letter in Zimbra, which is why an attempt to synchronize messages with large attachments can lead to an error.

    You can solve this issue by increasing the maximum allowable size of the letter. For example, the command zmprov mcf zimbraMtaMaxMessageSize 52428800 increases it to 50 megabytes.

    Errors can also occur when synchronizing large mailboxes with a huge number of folders and subfolders containing thousands of letters. Due to the large size of these mailboxes on the Zimbra server side, a connection loss may occur due to session timeout. To prevent this from happening, we recommend that you start synchronization with the --nofoldersizes --skipsize --fast options .

    For all questions related to the Zextras Suite, you can contact the representative of Zextras Katerina Triandafilidi by e-mail

    Also popular now: