Delivery Status Notification Messages can be localized such that messages will be returned to different users in different languages. For example, French notifications could be returned to users who have expressed a preference for French.
Localizing or customizing status notification messages consists of two steps:
Create a set of localized/customized return_*.txt message files and store each set in a separate directory. This is described in 10.10.1 To Construct and Modify Status Notifications
Set up a NOTIFICATION_LANGUAGE mapping table.
The NOTIFICATION_LANGUAGE mapping table (located in msg-svr-base/config/mappings) specifies the set of localized or customized notification message files to use depending upon attributes (for example: language, country, domain, or address) of the originating message (the message causing the notification to be sent).
The original sender’s message is parsed to determine status notification type, source channel, preferred language, return address and first recipient. Depending on how the table is constructed, a set of notification files is selected depending on one or more of these attributes.
The format of the NOTIFICATION_LANGUAGE mapping table is as follows. The sample entry line has been wrapped for typographic reasons. The actual entry should appear on one physical line.
NOTIFICATION_LANGUAGE dsn-type-list|source-channel|preferred-language|return-address \ |first-recipient $Idirectory-spec |
dsn-type-list is a comma-separated list of delivery status notification types. If multiple types are specified, they must be separated by commas and without spaces (a space will terminate the pattern of the mapping table entry). The types are as follows:
failed - Generic permanent failure messages (for example, no such user). Uses the return_failed.txt file.
bounced - Notification message used in conjunction with manual “bounces.” Done by the postmaster. Uses the return_bounced.txt file.
timedout - The MTA has been unable to deliver the message within the time allowed for delivery. The message is now being returned. Uses the return_timedout.txt file.
delayed - The MTA has been unable to deliver the message, but will continue to try to deliver it. Uses the return_delayed.txt file.
deferred - Non-delivery notification similar to “delayed” but without an indication of how much longer the MTA will continue to try to deliver. Uses the return_deferred.txt file.
forwarded - A delivery receipt was requested for this message, however, this message has now been forwarded to a system that does not support such receipts. Uses the return_forwarded.txt file.
source-channel is the channel generating the notification message, that is, the channel at which the message is currently queued. For example, ims-ms for the message store’s delivery queue, tcp_local for outbound SMTP queues, etc.
preferred-language is the language expressed in the message being processed (the message for which the notification is being generated). The sources for this information are first the accept_language field. If that doesn’t exist the Preferred-language: header field and X-Accept-Language: header field are used. For a list of standard language code values, refer to the file msg-svr-base/config/languages.txt
This field, if not empty, will be whatever the originator of the message specified for the Preferred-language: or X-Accept-language: header line. As such, you may find nonsense characters in this field.
return-address is the envelope From: address of the originating message. This is the envelope address to which the notification message will be sent and hence a possible indicator of what language to use.
first-recipient is the envelope To: address (the first one, if the message is failing to more than one recipient) to which the original message was addressed. For example, in the notification “your message to dan@siroe.com could not be delivered”—in this case dan@siroe.com is the envelope To: address being reported on.
directory-spec is the directory containing the return_*.txt files to use if the mapping table probe matches. Note that a $I must precede the directory specification.
For instance, a site that stores French notification files (return_*.txt) in a directory /lc_messages/table/notify_french/ and Spanish notification files in return_*.txt files in a directory /lc_messages/table/notify_spanish/ might use a table as shown below. Note that each entry must start with one or more spaces, and that there can be no blank lines between entries.
NOTIFICATION_LANGUAGE ! Preferred-language: header value specified ! *|*|fr|*|* $I/lc_messages/table/notify_french/ *|*|es|*|* $IIMTA_TABLE/notify_spanish/ *|*|en|*|* $I/imta/lang/ ! ! If no Preferred-language value, then select notification based on the ! country code in the domain name. EX: PF=French Polynesia; BO=Bolivia ! *|*|*|*.fr|* $I/imta/table/notify_french/ *|*|*|*.fx|* $I/imta/table/notify_french/ *|*|*|*.pf|* $I/imta/table/notify_french/ *|*|*|*.tf|* $I/imta/table/notify_french/ *|*|*|*.ar|* $I/imta/table/notify_spanish/ *|*|*|*.bo|* $I/imta/table/notify_spanish/ *|*|*|*.cl|* $I/imta/table/notify_spanish/ *|*|*|*.co|* $I/imta/table/notify_spanish/ *|*|*|*.cr|* $I/imta/table/notify_spanish/ *|*|*|*.cu|* $I/imta/table/notify_spanish/ *|*|*|*.ec|* $I/imta/table/notify_spanish/ *|*|*|*.es|* $I/imta/table/notify_spanish/ *|*|*|*.gp|* $I/imta/table/notify_spanish/ *|*|*|*.gt|* $I/imta/table/notify_spanish/ *|*|*|*.gy|* $I/imta/table/notify_spanish/ *|*|*|*.mx|* $I/imta/table/notify_spanish/ *|*|*|*.ni|* $I/imta/table/notify_spanish/ *|*|*|*.pa|* $I/imta/table/notify_spanish/ *|*|*|*.ve|* $I/imta/table/notify_spanish/ |
A default mappings.locale file is provided with the installation and will be included in the mappings file to enable notification language mapping. To disable notification language mapping, comment out the include line as follows:
! <IMTA_TABLE:mappings.locale
(Read the comments in the file and modify to suit your needs.)