URL and address substitution sequences

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


When specifying URLs, especially LDAP URLs and addresses for MTA use in places where some kind of expansion operation is underway, various substitution sequences, as shown in Table of URL and address substitution sequences, are generally available.

URL and address substitution sequences
Substitution Sequence Description
$$ Literal $ character
$~account Home directory of user account
$?string? (New in 8.0) Apply the Message Store's hashdir algorithm to string to produce a directory path
$\ Force subsequent material to lower case
$^ Force subsequent material to upper case
$_ Leave case as-is for subsequent material
$|/table-name/argument| Call out to mapping tabletable-name, probing with argument; if the mapping table is found and a $Y, $y, $T, or $t is returned, then use the returned string. Note that the slash shown before and after the table-name can in fact be any character; a character should be used that doesn't conflict with the expected characters in either table-name or argument.
$A Address
$nA Insert the nth character of the Address
$B LDAP user root; i.e., the value of the ugldapbasedn base option (in legacy configuration, the local.ugldapbasedn configutil parameter), or as overridden by the MTA-specific ldap_user_root MTA option
$C LDAP domain root; i.e., the value of the dcroot base option (in legacy configuration, the service.dcroot configutil parameter), or as overridden by the MTA-specific ldap_domain_root MTA option
$D Domain name
$E Synonymous with $1E; that is, substitute in the value of the LDAP attribute named by ldap_spare_1
$nE Substitute in the value of the LDAP attribute named by the ldap_spare_n MTA option, where n is in the range 1-18 (any other value is equivalent to 1); note that ldap_spare_6 was added for Messaging Server 7.0-3.01; ldap_spare_7 through ldap_spare_18 were added for Messaging Server 7.2-7.02.
$F Delivery filename; some syntax checking is done if the "name" is a file URL (file: syntax)
$G Synonymous with $2G; that is, substitute in the value of the LDAP attribute named by ldap_spare_2
$nG Similar to $nE, but with the default for n being 2 rather than 1
$H Host name (first portion of fully qualified domain name)
$I Host domain (the canonical domain name for the domain the user is in), unless the host domain is the same as the defaultdomain option (in legacy configuration, the service.defaultdomain configutil parameter), or the MTA-specific override option ldap_default_domain; when the host domain matches the defaultdomain, then a null string is substituted
$1I Host domain (the canonical domain name for the domain the user is in), unless the host domain is the same as the defaultdomain option (in legacy configuration, the service.defaultdomain configutil parameter), or the MTA-specific override option ldap_default_domain; when the host domain matches the defaultdomain, then the entire substitution operation fails.
$2I Host domain (the canonical domain name for the domain the user is in), unless the host domain is the same as the defaultdomain option (in legacy configuration, the service.defaultdomain configutil parameter), or the MTA-specific override option ldap_default_domain; when the host domain matches the defaultdomain, then no domain is inserted and also the leading character is removed. This substitution is typically used to remove a leading percent character, %, for such cases of the default domain.
$3I Host domain (the canonical domain name for the domain the user is in), unless the host domain is the same as the defaultdomain option (in legacy configuration, the service.defaultdomain configutil parameter), or the MTA-specific override option ldap_default_domain; when the host domain matches the defaultdomain, then no domain is inserted and also the next character in the template is omitted. This substitution is typically used to remove a trailing slash character, /, for such cases of the default domain.
$J Host domain minus its first chunk
$K Filter constructed from the user and group object classes, as specified via the ldap_user_object_classes and ldap_group_object_classes MTA options
$L Username minus any special leading characters such as ~ or _
$M For URL expansions this is a uid; when the URL relates to a user address, this would be the actual uid value (or whatever LDAP attribute is named by the ldap_permid MTA option, and if that attribute is not present, the attribute named by the ldap_uid MTA option), but in other contexts may have another meaning (as for instance, $M substitutes the detailed verdict string for spam/virus filter package integration spamfilterN_action_M MTA options)
$nM New in MS 6.2. For URL expansion, insert the nth character of the uid (or an " a" if the uid has no nth character)
$M New in MS 8.1.0.6. For address expansions this is a secondary address; in the specific case of smartsend return-path expansions this will be the MAIL FROM address.
$1M New in MS 8,1,0.6. For address expansions this will be the local-part of any secondary address
$2M New in MS 8,1,0.6. For address expansions this will be the domain part of any secondary address
$3M New in MS 8,1,0.6. For address expansions this will be the local-part and domain of any secondary address
$N Construct a comma-separated list of attributes (normally those to return in reverse_url lookups, hence a comma separated list of the attributes named by the ldap_capture, ldap_recipientlimit, ldap_recipientcutoff, ldap_sourceblocklimit, ldap_preferred_language, ldap_personal_name, ldap_primary_address, and ldap_equivalence_addresses MTA options, as well as (in MS 6.2 and later) ldap_source_conversion_tag, and (in MS 6.3-0.15 and later), ldap_blocklimit, ldap_source_channel, the ldap_source_optinN MTA options, ldap_preferred_country, and the ldap_spare_N MTA options)
$O (New in MS 6.1p1/6.2) Substitute the source route
$4O (New in MS 6.1p1/6.2) Substitute the source route if present; if no source route is present, then instead remove the following character (normally used in a pattern to remove the colon character subsequent to the---nonexistent---source route)
$P Program name, that is, the value of the attribute named by the ldap_program_info MTA option (hence normally the value of the mailProgramDeliveryInfo attribute)
$Q Filter for address reversal in iMS 5.2p2; that is, a filter constructed from the attribute names listed in the ldap_mail_reverses MTA option (or the appropriate default attribute names, depending upon the schema tag, if ldap_mail_reverses is not set); this substitution sequence was typically used as the filter in reverse_url lookups in iMS 5.2, but with the Messaging Server 6.0 MTA, the $R substitution sequence is normally used instead
$S Subaddress
$2S Subaddress if present, but if there is no subaddress, then remove the leading character (used to remove the plus character, +)
$R Filter for mail aliases; that is, a filter constructed from the attribute names listed in the ldap_mail_aliases MTA option (or with legacy configuration in the local.imta.mailaliases configutil parameter); as of MS 6.0 and later, also typically used as the search filter for reverse_url address reversal lookups
$T Turn domain name chunk1.chunk2...chunkn into dc=chunk1,dc=chunk2,...,dc=chunkn
$U The username portion of the address (that is, the local-part sans subaddress and sans any leading backwards-single-quote, tilde, or underscore character)
$nU Insert the nth character of the username
$V The base DN returned by calling domainMap on the domain in the address; note that this can be affected by the domain_uplevel MTA option
$1V A variant on the $V substitution, where if the $V domainMap sort of lookup fails (no inetDomainBaseDn or aliasedObjectName matching the domain name is found), then this $1V substitution instead returns the DN of the top of the user and group tree, that is, the value of the ugldapbasedn base option (in legacy configuration, the local.ugldapbasedn configutil parameter) or as overridden via the MTA-specific ldap_user_root MTA option
$W (New in MS 8.1.0.6) Insert a unique identifier string.
$X mailHost
$nX Insert the nth component of the mailHost


See also: