Subaddressexact, subaddressrelaxed, subaddresswild Channel Options

From Messaging Server Technical Reference Wiki
Jump to: navigation, search

Subaddresses and alias matching (subaddressexact, subaddressrelaxed, subaddresswild)

A subaddress consists of extra detail information in the RFC 5322 "local-part" of an address (the portion to the left of the "@" sign); the subaddress is typically encoded into the local-part by using a separator character such as the plus character, +, and is subject to site-specific interpretation. (See for instance the discussion in the introduction of RFC 5233, Sieve: Subaddress Extension.) Use of subaddresses can be a convenient way to, e.g.:

  • Request delivery directly to a named folder.
  • Indicate that a message is being received due to membership of some mailing list.
  • Request other special delivery handling, such as delivery to a voice mailbox.

In regard to subaddresses, the Messaging Server ims-ms and tcp_lmtps* channels interpret a + character in the local portion of an address (the mailbox portion) specially: in an address of the form name+subaddress@domain the Messaging Server Message Store delivery code considers the portion of the mailbox after the plus character a subaddress; if either the subaddress is "trusted" (as in the case of a subaddress added due to a Sieve filter "fileinto" action and confirmed for the channel via the fileinto channel option), or the folder has the IMAP post ACL set, then such channels may treat a subaddress as a request to deliver directly into the correspondingly named folder.

Subaddresses also affect the lookup of aliases by the local channel and the lookup of aliases by any channel marked with the aliaslocal channel option, and the lookup of mailboxes by the directory channel. The exact handling of subaddresses for such matching is configurable: when comparing an address against an entry, the MTA always first checks the entire mailbox including the subaddress for an exact match; whether or not the MTA performs additional checks after that is configurable. As of MS 6.1, the subaddress support in aliases includes alias_urlN alias lookups; that is, as of MS 6.1, the subaddress* channel options apply for alias_urlN lookups.

The subaddressexact channel option instructs the MTA to perform no special subaddress handling during entry matching; the entire mailbox, including the subaddress, must match an entry in order for the alias to be considered to match. No additional comparisons (in particular, no wildcarded comparisons or comparisons with the subaddress removed) will be performed. The subaddresswild channel option instructs the MTA that after looking for an exact match including the entire subaddress, the MTA should next look for an entry of the form name+*. (For wildcarding the entire localpart, not just the subaddress, see the alias_domains MTA option.) The subaddressrelaxed channel option instructs the MTA that after looking for an exact match and then a match of the form name+*, that the MTA should make one additional check for a match on just the name portion. With subaddressrelaxed, an alias entry of the form

name:   newname+*

will match either name or name+subaddress, transforming a plain name to newname, and transforming name+subaddress to newname+subaddress. The LDAP entry equivalent with subaddressrelaxed set, to get the "transfer" of the subaddress to the forwarded-to address, would be to set:

mailDeliveryOption: forward
mailForwardingAddress: newname+*@newdomain

The default is subaddressrelaxed.

Thus the subaddresswild channel option or the subaddressrelaxed channel option may be useful when aliases or a directory channel are in use yet users wish to receive mail addressed using arbitrary subaddresses. These channel options obviate the need for a separate entry for every single subaddress variant on an address.

For the Messaging Server MTA, these channel options make sense on the L channel as a destination (or rather, as an alias application) channel.

New in 7.0.5, a subaddress* channel option setting on a source channel will affect address reversal performed on messages coming in that source channel. Previously, the presence of a subaddress would prevent address reversal from occurring. (This long-standing behavior was a remnant of the past when if a user was sophisticated enough to put on a subaddress, one might presume that the user was sophisticated enough to have already specified the exact address that they wanted to send from -- so altering such an address wouldn't be necessary and indeed would be dubious. However, nowadays many other behaviors and side-effects are triggered via address reversal so matching regardless of subaddress is typically desirable; the old assumption that reversal was not desirable in such cases is outdated.) As of 7.0.5, the default behavior is to attempt to match the address with or without the subaddress. If there's a match, then the subaddress will be transferred to any rewritten address. This behavior may be explicitly specified by setting the subaddressrelaxed channel option (the default) on the source channel. subaddresswild, if set, will match against subaddresses but disables transfer of the subaddress to the rewritten address. Finally, subaddressexact disables special subaddress handling during the reversal process.

See also: