A chronological documentation test project, nothing serious, really!

21 Jul 2011 Migrate Zimbra mail filter rules between servers

Posted by

This is a short HOWTO migrate Zimbra mail filter rules from one server to another or even copy the rules from one user and import them to another. These commands are useful to use when you migrate user accounts between servers since mail filters are not migrated using the Zimbra to Zimbra migration script, zmztozmig . I might write a short post about migrating users between Zimbra servers later.

Export the rules to a file named filter_rules.sieve as the zimbra user

# zmprov ga zimbraMailSieveScript > filter_rules.sieve

The content of the file could look something like this

# name
zimbraMailSieveScript require ["fileinto", "reject", "tag", "flag"];

# Filtername
if anyof (header :contains ["to"] "root@localhost") {
    fileinto "foldername";

Copy the filter_rules.sieve file to the other server and import the filter rules by enclosing the filter rules with a single qoutes around the rules

# zmprov ma zimbraMailSieveScript 'require ["fileinto", "reject", "tag", "flag"];

# Filtername
if anyof (header :contains ["to"] "root@localhost") {
    fileinto "foldername";

This has been tested on a Zimbra 7.1.1 OSE server after migrating some users mailboxes from a 32-bit Zimbra server to a new 64-bit server.

Tags: , , , , , ,

Reader's Comments

  1. |

    This is all I get when I run this
    line 39: zimbraMailSieveScript: command not found

  2. | – Updated solution here