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
- 201
- 400
- 401
- 404
- 424
Created filter.
Request failed.
The session has no mailbox access token. code is mail_token_missing; sign in again.
The account does not exist or belongs to another user.
The IMAP, SMTP or Sieve server, or the platform, refused the request or could not be reached.