Sieve Extension for Converting Messages before Delivery
Extracted elements (14)
Defining 'convert' as a testable action does not imply that other Sieve actions can be used as tests; this is a unique property of the 'convert' action. Future extensions wishing to define testable actions must explicitly specify that capability.
Implementations may defer actual conversion until results are needed for script processing, to avoid doing conversions unnecessarily. For example, if a 'convert' action is processed but a 'discard' action results, the conversion need not actually be performed.
The 'convert' action can be used with Sieve MIME Part Tests (RFC 5703) via the 'foreverypart' loop when only some body parts need conversion or different parts require different conversions.
The Sieve 'convert' action reuses conversion parameters and framework established by the IMAP CONVERT extension (RFC 5259). Each transcoding parameter value has the syntax '<transcoding-param-name>=<transcoding-param-value>' as defined in RFC 5259.
If a 'convert' action cannot be completed — because the conversion failed or is not available — it MUST terminate and leave the message unchanged, rolling back any other conversions done by that action. No partial conversions from a single 'convert' action are allowed.
Servers MAY refuse conversions or perform them at lower priority to avoid negative effects on service to other processes, since computationally expensive conversions of many body parts can constitute an attack vector or create unacceptable server load.
When a disposition-type action (e.g., 'fileinto' or 'redirect') is encountered, the implementation MUST perform the action on the message as it stood at that point in script processing, and MUST NOT include subsequent conversions encountered later in the script.
A single 'convert' action applies only once to any body part; it will not re-process the result of its own conversion as a new body part to transform again.
Convert actions are cumulative: each conversion operates on the message as it stands after all prior conversions. The implicit keep, if in effect, acts on the final state of the message after all conversions are performed.
The 'convert' action can also be used as a test ('testable action'): it attempts the requested conversion(s) and evaluates to 'false' if and only if at least one conversion failed, whether due to an unsupported conversion or corrupted/mislabeled data.
The 'convert' action takes three arguments: a quoted-from-media-type string, a quoted-to-media-type string, and a transcoding-params string-list. It converts all body parts matching the source media type to the target type using the specified parameters.
When the 'convert' action appears inside a 'foreverypart' loop, it applies only to the body part currently being processed. When it appears outside a loop, conversion applies equally to all matching body parts.
IANA has added a 'convert' entry to the 'Sieve Extensions' registry (defined in RFC 5228), with capability name 'convert', contact address [email protected], and RFC number 6558.
Security considerations from IMAP CONVERT (RFC 5259) and Sieve (RFC 5228) apply to this document. Computationally expensive conversions of many body parts can constitute an attack vector and servers may throttle or refuse such conversions.