set_sieve

Sets sieve rulesets and changes the active ruleset.

WARNING: this API call is an experimental work in progress. Sieve ruleset validation may not work correctly; it can be possible to set rules that will not function properly.

WARNING: this API call is able to set sieve rulesets that may be incompatible with webmail. If you need the rules to be viewable and editable inside webmail, set a few rules in webmail to understand the syntax it uses, then copy that syntax and use only actions and filters that webmail is able to support.

Request

{
    <credentials object>,
    "user": <mailbox_name>,
    "ruleset": <ruleset_name>,
    "data": <sieve_text> || <null>
    "active_rule": <ruleset_name> (optional)
}

If you are creating a new ruleset for a mailbox that has not previously been using sieve, make sure to set "active_rule".

"ruleset" is the ruleset name. Use only ASCII characters.

"data" is the content of the sieve ruleset, which can include multiple sieve rules.

Response

{
   "rulesets" : {
      "managesieve" : "updated"
   },
   "active_rule" : "updated to managesieve",
   "audit" : "rule15_6178470ab",
   "success" : true
}
{
   "audit" : "screw78_617846f6a",
   "success" : true,
   "active_rule" : "already set to managesieve",
   "rulesets" : {
      "managesieve" : "updated"
   }
}

If sieve ruleset validation fails, the response should contain a "hints" field with additional details.