Skip to main content

Create a filter

POST 

/api/accounts/:accountId/sieve/filters

Adds a server-side filter and returns it with its new id. It is appended to the end of the list and starts enabled; id and enabled in the body are ignored.

A filter needs a name (up to 200 characters), 1 to 20 conditions and 1 to 10 actions. delete actions are always pointed at the Trash folder, and spam actions without a folder at the Spam folder. The active Sieve script is then rewritten, checked by the server and activated; content outside the app's blocks is kept, and a script named cloudron-mail-filters is created if none is active.

Invalid input, a Sieve extension the server lacks (for example body for body conditions), or a missing Spam or Trash folder returns 400.

Request​

Responses​

Created filter.