# Exim Internet Mailer

<-previous next->

## Chapter 60 - Internationalisation

Exim has support for Internationalised mail names. To include this it must be built with SUPPORT_I18N and the libidn library. Standards supported are RFCs 2060, 5890, 6530 and 6533.

If Exim is built with SUPPORT_I18N_2008 (in addition to SUPPORT_I18N, not instead of it) then IDNA2008 is supported; this adds an extra library requirement, upon libidn2.

### 1. MTA operations

The main configuration option smtputf8_advertise_hosts specifies a host list. If this matches the sending host and accept_8bitmime is true (the default) then the ESMTP option SMTPUTF8 will be advertised.

If the sender specifies the SMTPUTF8 option on a MAIL command international handling for the message is enabled and the expansion variable $message_smtputf8 will have value TRUE.

The option allow_utf8_domains is set to true for this message. All DNS lookups are converted to a-label form whatever the setting of allow_utf8_domains when Exim is built with SUPPORT_I18N.

Both localparts and domain are maintained as the original UTF-8 form internally; any comparison or regular-expression use will require appropriate care. Filenames created, eg. by the appendfile transport, will have UTF-8 names.

HELO names sent by the smtp transport will have any UTF-8 components expanded to a-label form, and any certificate name checks will be done using the a-label form of the name.

Log lines and Received-by: header lines will acquire a "utf8" prefix on the protocol element, eg. utf8esmtp.

The following expansion operators can be used:

    ${utf8_domain_to_alabel:str}
    ${utf8_domain_from_alabel:str}
    ${utf8_localpart_to_alabel:str}
    ${utf8_localpart_from_alabel:str}

The RCPT ACL may use the following modifier:

    control = utf8_downconvert
    control = utf8_downconvert/<value>

This sets a flag requiring that envelope addresses are converted to a-label form before smtp delivery. This is usually for use in a Message Submission Agent context, but could be used for any message.

If a value is appended it may be:

`1` | mandatory downconversion
`0` | no downconversion
`-1` | if SMTPUTF8 not supported by destination host

If no value is given, 1 is used.

If mua_wrapper is set, the utf8_downconvert control is initially set to -1.

The smtp transport has an option utf8_downconvert. If set it must expand to one of the three values described above, or an empty string. If non-empty it overrides value previously set (due to mua_wrapper or by an ACL control).

There is no explicit support for VRFY and EXPN. Configurations supporting these should inspect $smtp_command_argument for an SMTPUTF8 argument.

There is no support for LMTP on Unix sockets. Using the "lmtp" protocol option on an smtp transport, for LMTP over TCP, should work as expected.

There is no support for DSN unitext handling, and no provision for converting logging from or to UTF-8.

### 2. MDA operations

To aid in constructing names suitable for IMAP folders the following expansion operator can be used:

    ${imapfolder {<string>} {<sep>} {<specials>}}

The string is converted from the charset specified by the "headers charset" command (in a filter file) or headers_charset main configuration option (otherwise), to the modified UTF-7 encoding specified by RFC 2060, with the following exception: All occurrences of <sep> (which has to be a single character) are replaced with periods ("."), and all periods and slashes that are not <sep> and are not in the <specials> string are BASE64 encoded.

The third argument can be omitted, defaulting to an empty string. The second argument can be omitted, defaulting to "/".

This is the encoding used by Courier for Maildir names on disk, and followed by many other IMAP servers.

Examples:

    ${imapfolder {Foo/Bar}}        yields Foo.Bar
    ${imapfolder {Foo/Bar}{.}{/}}  yields Foo&AC8-Bar
    ${imapfolder {Räksmörgås}}     yields R&AOQ-ksm&APY-rg&AOU-s

Note that the source charset setting is vital, and also that characters must be representable in UTF-16.

<-previous Table of Contents next->