In this article you will learn how to migrate filter rules from one user to another user. These are the steps to export and import filter rules from the command line, don’t forget to use the zimbra OS user:
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"
Further reading
No comments yet.