Backup/Export User Mail Filters

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
jstlouis
Posts: 18
Joined: Fri Sep 12, 2014 11:30 pm

Backup/Export User Mail Filters

Postby jstlouis » Wed Apr 08, 2009 3:01 pm

Hi everyone,
I was wondering if there was a way to export/backup the user's mail filter rules for each mailbox?
If there is a command-line tool or possibly a script to export/import this, that would be great.
I would like to export filter rules for about 7 user's from a ZCS 5.0.10 install to a ZCS 5.0.14 install, to save them the hassle of having to re-create.


Thanks in advance!


jstlouis
Posts: 18
Joined: Fri Sep 12, 2014 11:30 pm

Backup/Export User Mail Filters

Postby jstlouis » Wed Apr 08, 2009 3:05 pm

One more question, what about Saved Searches, can those be exported/backed up?
reinhard
Advanced member
Advanced member
Posts: 84
Joined: Sat Sep 13, 2014 12:04 am

Backup/Export User Mail Filters

Postby reinhard » Tue Jul 14, 2009 3:36 am

Is there a solution for this issue?
mlanner
Advanced member
Advanced member
Posts: 111
Joined: Fri Sep 12, 2014 11:13 pm

Backup/Export User Mail Filters

Postby mlanner » Sat Jul 18, 2009 4:10 pm

Same question here. Anyone?
phoenix
Ambassador
Ambassador
Posts: 26325
Joined: Fri Sep 12, 2014 9:56 pm
Location: Liverpool, England

Backup/Export User Mail Filters

Postby phoenix » Sun Jul 19, 2009 1:01 am

Dump the user account with zmprov and you'll find the filters in there.
Regards

Bill

Rspamd: A high performance spamassassin replacement

If you'd like to see this implemented in a future version of ZCS then please vote on Bugzilla entries 97706 & 108168
reinhard
Advanced member
Advanced member
Posts: 84
Joined: Sat Sep 13, 2014 12:04 am

Backup/Export User Mail Filters

Postby reinhard » Sun Jul 19, 2009 11:39 am

Thats it :-)
Thanks
balusss
Posts: 44
Joined: Fri Sep 12, 2014 11:41 pm

Backup/Export User Mail Filters

Postby balusss » Thu Oct 15, 2009 4:11 am

hi phoenix,
is there a way i export/backup the mail filters in zdesktop?
15520remedy
Posts: 1
Joined: Sat Sep 13, 2014 12:58 am

Backup/Export User Mail Filters

Postby 15520remedy » Tue Mar 15, 2011 2:57 pm

[quote user="10330phoenix"]Dump the user account with zmprov and you'll find the filters in there.[/QUOTE]

OK so how to you import the same said exported filters back into a new zimbra instance?
phoenix
Ambassador
Ambassador
Posts: 26325
Joined: Fri Sep 12, 2014 9:56 pm
Location: Liverpool, England

Backup/Export User Mail Filters

Postby phoenix » Tue Mar 15, 2011 3:17 pm

[quote user="15520remedy"]OK so how to you import the same said exported filters back into a new zimbra instance?[/QUOTE]You use zmprov to recreate the filter.
Regards

Bill

Rspamd: A high performance spamassassin replacement

If you'd like to see this implemented in a future version of ZCS then please vote on Bugzilla entries 97706 & 108168
unc0nnected
Posts: 34
Joined: Sat Sep 13, 2014 3:52 am

Backup/Export User Mail Filters

Postby unc0nnected » Wed May 28, 2014 5:00 am

Solution here
>

So first you want to export your mail rules from user A by doing this:
zmprov ga user@test.com zimbraMailSieveScript > /opt/backup/xferMailFilters.sh
now you need to import them into another user so go and edit this new mailFilters.sieve file and change the top 2 lines from this
[QUOTE]#Name user@test.com
zimbraMailSieveScript: require ["fileinto", "reject", "tag", "flag"];[/QUOTE]
to this
[QUOTE]#!/bin/bash
if [[ $1 ]];
then
zmprov ma $1 zimbraMailSieveScript 'require ["fileinto", "reject", "tag", "flag"];
[/QUOTE]
and add this to the very end of the file
[QUOTE]'
else
echo "You forgot to enter a user - Syntax: xferMailFilters.sh user@whatever.com"
fi[/QUOTE]

chmod your new script to 755 or add a +x to it and then run it with the username you want to xfer these files over to as your first variable. You can use this logic and add onto this to make a script that will export from one user($1) and xfer to another ($2) but that's out side of what I need right now so I'll leave that one up to you :) You can ignore the if then stuff if you just want to do this once, we setupt his script so we can import a template set of filters for every new user

Return to “Administrators”

Who is online

Users browsing this forum: Google [Bot], MSN [Bot] and 16 guests