Sieve translate extension

New in MS 8.0.1, the MTA supports a private " " function, to translate a string (or a list) from one character set to another. No " " clause is needed to use this private extension.

Note that RFC 5228 requires that Sieve filters represent strings in UTF-8. Even strings that (in original messages) were in some other charset are converted to UTF-8 for purposes of Sieve processing. So usually the entire issue of character sets can be ignored for Sieve processing: everything is represented in UTF-8. However, on occasion malformed messages may be encountered that contain incorrectly labelled, or incorrectly structured MIME encoded-words, where proper conversion to UTF-8 cannot be performed. Or special purpose generation of explicitly encoded-in-a-specific-charset strings may be desired. These are cases where the " " function may be of use.

" " takes three (positional) arguments: the original string, the character set of the original string, and the character set to which to translate the string. Note that the original string remains unchanged; the translated string is returned as a function result.

Either of the following two Sieve sequences of commands will request " " (folder delivery) to the folder named " ". The first example does this making use of a variable, plus the MTA Sieve implementation feature of allowing an assignment statement: require &#x5b;"variables","fileinto"&#x5d;; set "string" "abcABC"; rotstring := translate "${string}" "US-ASCII" "ROT13"; fileinto "${rotstring}"; The second example does this by making use of the MTA Sieve implementation feature allowing expressions  where arguments are normally expected, to perform the " " in-line, without use of any named variable: require "fileinto"; fileinto (translate "abcABC" "US-ASCII" "ROT13");

See also:
 * Character set conversion
 * Sieve fileinto action
 * Sieve variables extension
 * Sieve expressions
 * Sieve supported extensions