Infomaniak Mail icon

Infomaniak Mail

Interact with Infomaniak Mail API

Actions118

Mailboxes > Sieve Filters → Add A Script

AI-generated

Summary

Adds a sieve filter script to a specified mailbox.

Inputs

  • authentication — Authentication method; OAuth2 or API Key.
  • path_mail_hosting_id (required) — Unique identifier of the mail hosting to request.
  • path_mailbox_name (required) — Username (part before @) of the email address for which to add the sieve filter.
  • body_content (required) — Content of the sieve filter script.
  • body_name (required) — Name of the sieve filter script.
  • bodyParameters — Additional parameters for the script; currently supports 'body_is_enabled' to toggle enablement.
  • returnFullResponse — Whether to return the full API response.

Output shape

a single record representing the added sieve filter

Contains details of the created filter; no pagination; returns an error envelope on failure.

Examples

Example 1: Add a sieve filter to block spam messages

authentication: OAuth2, path_mail_hosting_id: 42, path_mailbox_name: "user@example.com", body_name: "spam", body_content: "if (subject :contains "viagra" ) then reject", body_is_enabled: true, returnFullResponse: false

Links

Discussion