Migrate filter rules from one user to another user

The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

How to migrate filter rules from one user to another user?


   KB 24345        Last updated on 2023-12-20  




0.00
(0 votes)

Problem

How to migrate filter rules from one user to another user?


Solution

These are the steps to export and import filter rules.

1) Export exiting filter rules of a user and save into a file.

zmprov -l ga UserA@DOMAIN.COM zimbraMailSieveScript > /tmp/filter_rules.txt  


2) Prepare the output file "/tmp/filter_rules.txt".

sed -i -e "1d" /tmp/filter_rules.txt 
sed -i -e 's/zimbraMailSieveScript: //g' /tmp/filter_rules.txt


3) Check required folders' path for the filter rules.

cat /tmp/filter_rules.txt | grep 'fileinto ' 

Example:

zimbra@mail:~$ cat /tmp/filter_rules.txt | grep 'fileinto '
    fileinto "TestEmail/TEST2";
    fileinto "User5";
    fileinto "Admin";
zimbra@mail:~$


4) Import prepared filter rules on another user.

zmprov ma UserB@DOMAIN.COM zimbraMailSieveScript "`cat /tmp/filter_rules.txt`"  


5) Create all required folders for the imported filter rules from the step 3.

zmmailbox -z -m UserB@DOMAIN.COM cf -V message /"FolderName"

Example:

zmmailbox -z -m UserB@DOMAIN.COM cf -V message /"User5" 


Submitted by: Heera Singh Koranga
Verified Against: Date Created:
Article ID: https://wiki.zimbra.com/index.php?title=Migrate_filter_rules_from_one_user_to_another_user Date Modified: 2023-12-20



Try Zimbra

Try Zimbra Collaboration with a 60-day free trial.
Get it now »

Want to get involved?

You can contribute in the Community, Wiki, Code, or development of Zimlets.
Find out more. »

Looking for a Video?

Visit our YouTube channel to get the latest webinars, technology news, product overviews, and so much more.
Go to the YouTube channel »


Jump to: navigation, search