Email Rules Migration: Difference between revisions

No edit summary
 
(9 intermediate revisions by 3 users not shown)
Line 1: Line 1:
==  Thunderbird  ==
{{Archive}}{{Unsupported}}==  Thunderbird  ==
 
Try the add-on: Thunderbird Message Filter Import/Export
 
https://addons.mozilla.org/en-US/thunderbird/addon/2474


==  Outlook  ==
==  Outlook  ==
Note: The ZCS Connector doesn't migrate outlook 2003 mail rules, IIRC from a 200 user migration I did in the past ([[User:Gettyless|gettyless]] 4/26/2009)


==  .procmailrc  ==
==  .procmailrc  ==
Line 14: Line 20:


Here's the usage for addFilterRule
Here's the usage for addFilterRule
<code>
<pre>
[zimbra@qa03 ~]$ zmmailbox help filter
$ zmmailbox help filter
 
  addFilterRule(afrl)          [opts] {name}  [*active|inactive] [any|*all] {conditions}+ {actions}+
    -f/--first                  add as first filter rule
    -b/--before <arg>            add before filter-name
    -a/--after <arg>            add after filter-name
    -l/--last                    add as last filter rule
 
  addOutgoingFilterRule(aofrl) [opts] {name}  [*active|inactive] [any|*all] {conditions}+ {actions}+
    -f/--first                  add as first filter rule
    -b/--before <arg>            add before filter-name
    -a/--after <arg>            add after filter-name
    -l/--last                    add as last filter rule
 
  deleteFilterRule(dfrl)      {name}
 
  deleteOutgoingFilterRule(dofrl) {name}


   addFilterRule(afrl)                   add filter rule
   getFilterRules(gfrl)        


   deleteFilterRule(dfrl)                 add filter rule
   getOutgoingFilterRules(gofrl)  


   getFilterRules(gfrl)                   get filter rules
   modifyFilterRule(mfrl)       {name} [*active|inactive] [any|*all] {conditions}+ {actions}+


   modifyFilterRule(mfrl)                 add filter rule
   modifyOutgoingFilterRule(mofrl) {name} [*active|inactive] [any|*all] {conditions}+ {actions}+


   {conditions}:
   {conditions}:
     header "name" is|not_is|contains|not_contains|matches|not_matches "value"
     address "comma-separated-header-names" all|localpart|domain is|not_is|contains|not_contains|matches|not_matches [case_sensitive] "value"
     header "name" exists|not_exists
     addressbook in|not_in "header-name"
    attachment exists|not_exists
    body contains|not_contains [case_sensitive] "text"
    bulk [not]
    conversation where|not_where started|participated
    current_day_of_week is|not_is "comma-separated-days(0=Sun,6=Sat)"
    current_time before|not_before|after|not_after "HHmm"
     date before|not_before|after|not_after "YYYYMMDD"
     date before|not_before|after|not_after "YYYYMMDD"
    facebook [not]
    flagged [not] "flag"
    header "comma-separated-names" is|not_is|contains|not_contains|matches|not_matches [case_sensitive] "value"
    header "comma-separated-names" exists|not_exists
    importance is|not_is high|normal|low
    invite exists|not_exists
    linkedin [not]
    list [not]
    me in|not_in "header-name"
    mime_header "name" is|not_is|contains|not_contains|matches|not_matches [case_sensitive] "value"
    ranking in|not_in "header-name"
     size under|not_under|over|not_over "1|1K|1M"
     size under|not_under|over|not_over "1|1K|1M"
     body contains|not_contains "text"
     socialcast [not]
     addressbook in|not_in "header-name"
     twitter [not]
    attachment exists|not_exists


   {actions}:
   {actions}:
Line 38: Line 76:
     discard
     discard
     fileinto "/path"
     fileinto "/path"
     tag "/tag"
     tag "tag"
     mark read|flagged
    flag "flag"
     mark read|flagged|priority
     redirect "address"
     redirect "address"
    reply "body-template"
    notify "address" "subject-template" "body-template" ["max-body-size(bytes)"]
     stop
     stop


</code>
</pre>
Also, for add filter rule:
Also, for add filter rule:
mbox> afrl
mbox> afrl
Line 70: Line 111:
Then you can run it via <code>zmmailbox < scriptname</code>.
Then you can run it via <code>zmmailbox < scriptname</code>.


== Processing a Sieve script and inserting it via zmprov ==
=== Processing a Sieve script and inserting it via zmprov ===


Alternately you can process the existing Sieve scripts to conform to ZCS expectations and then insert the whole script via <code>zmprov ma account zimbraMailSieveScript ....</code>.  You'll need to restrict the entered rules to the Sieve commands as documented above (if ZWC or ZCO are expected to edit them).  Each filter rule will need a comment above it; this comment is the filter's name as identified in addFilterRule.  Creating one or two simple rules using the web client will give you a framework for the created rule.
Alternately you can process the existing Sieve scripts to conform to ZCS expectations and then insert the whole script via <code>zmprov ma account zimbraMailSieveScript ....</code>.  You'll need to restrict the entered rules to the Sieve commands as documented above (if ZWC or ZCO are expected to edit them).  Each filter rule will need a comment above it; this comment is the filter's name as identified in addFilterRule.  Creating one or two simple rules using the web client will give you a framework for the created rule.


[[Category:Pending Certification]]
[[Category:Migration]]

Latest revision as of 13:38, 31 March 2015

Thunderbird

Try the add-on: Thunderbird Message Filter Import/Export

https://addons.mozilla.org/en-US/thunderbird/addon/2474

Outlook

Note: The ZCS Connector doesn't migrate outlook 2003 mail rules, IIRC from a 200 user migration I did in the past (gettyless 4/26/2009)

.procmailrc

Sieve

You have a few options to migrate Sieve rules. Generally you can take existing rules and then just dump them into the account attribute zimbraMailSieveScript. The server will be able to process these rules. However, if you intend to enable the client to edit the rules you will need to make sure they conform to a ZCS-specific set of characteristics. There are two ways to do this.

Using zmmailbox addFilterRule

Within the zmmailbox command there is a "addFilterRule" command. This allows you to add a named filter to a particular user. Its usage defines the parameters that ZWC can understand for editing. Given that for any migration scenario you'll likely end up parsing the rules, this will let you reconstruct the rules in a syntax ZWC understands. You will need to find a "name" for each rule. It could be as simple as "rule1", "rule2", etc.

Here's the usage for addFilterRule

$ zmmailbox help filter

  addFilterRule(afrl)          [opts] {name}  [*active|inactive] [any|*all] {conditions}+ {actions}+
    -f/--first                   add as first filter rule
    -b/--before <arg>            add before filter-name
    -a/--after <arg>             add after filter-name
    -l/--last                    add as last filter rule

  addOutgoingFilterRule(aofrl) [opts] {name}  [*active|inactive] [any|*all] {conditions}+ {actions}+
    -f/--first                   add as first filter rule
    -b/--before <arg>            add before filter-name
    -a/--after <arg>             add after filter-name
    -l/--last                    add as last filter rule

  deleteFilterRule(dfrl)       {name}

  deleteOutgoingFilterRule(dofrl) {name}

  getFilterRules(gfrl)         

  getOutgoingFilterRules(gofrl) 

  modifyFilterRule(mfrl)       {name} [*active|inactive] [any|*all] {conditions}+ {actions}+

  modifyOutgoingFilterRule(mofrl) {name} [*active|inactive] [any|*all] {conditions}+ {actions}+

  {conditions}:
    address "comma-separated-header-names" all|localpart|domain is|not_is|contains|not_contains|matches|not_matches [case_sensitive] "value"
    addressbook in|not_in "header-name"
    attachment exists|not_exists
    body contains|not_contains [case_sensitive] "text"
    bulk [not]
    conversation where|not_where started|participated
    current_day_of_week is|not_is "comma-separated-days(0=Sun,6=Sat)"
    current_time before|not_before|after|not_after "HHmm"
    date before|not_before|after|not_after "YYYYMMDD"
    facebook [not]
    flagged [not] "flag"
    header "comma-separated-names" is|not_is|contains|not_contains|matches|not_matches [case_sensitive] "value"
    header "comma-separated-names" exists|not_exists
    importance is|not_is high|normal|low
    invite exists|not_exists
    linkedin [not]
    list [not]
    me in|not_in "header-name"
    mime_header "name" is|not_is|contains|not_contains|matches|not_matches [case_sensitive] "value"
    ranking in|not_in "header-name"
    size under|not_under|over|not_over "1|1K|1M"
    socialcast [not]
    twitter [not]

  {actions}:
    keep
    discard
    fileinto "/path"
    tag "tag"
    flag "flag"
    mark read|flagged|priority
    redirect "address"
    reply "body-template"
    notify "address" "subject-template" "body-template" ["max-body-size(bytes)"]
    stop

Also, for add filter rule: mbox> afrl usage:

 addFilterRule(afrl)          [opts] {name}  [*active|inactive] [any|*all] {conditions}+ {actions}+
   -a/--after <arg>             add after filter-name
   -f/--first                   add as first filter rule
   -l/--last                    add as last filter rule
   -b/--before <arg>            add before filter-name


Each zmmailbox script invokes a Java VM (just like zmprov). So you'll want to create a script to be loaded into zmmailbox. That script would look something like
adminAuthenticate ...
selectMailbox user1 ...
addFilterRule rule1 header "from" contains "kevin" discard
addFilterRule rule2 ....
...
selectMailbox user2
addFilterRule ....
...

Then you can run it via zmmailbox < scriptname.

Processing a Sieve script and inserting it via zmprov

Alternately you can process the existing Sieve scripts to conform to ZCS expectations and then insert the whole script via zmprov ma account zimbraMailSieveScript ..... You'll need to restrict the entered rules to the Sieve commands as documented above (if ZWC or ZCO are expected to edit them). Each filter rule will need a comment above it; this comment is the filter's name as identified in addFilterRule. Creating one or two simple rules using the web client will give you a framework for the created rule.

Jump to: navigation, search