Sun Java System Messaging Server 6.3 Administration Reference

Mapping Operations

All mappings in the mapping file are applied in a consistent way. The only things that change from one mapping to the next is the source of input strings and what the output from the mapping is used for.

A mapping operation always starts off with an input string and a mapping table. The entries in the mapping table are scanned one at a time from top to bottom in the order in which they appear in the table. The left side of each entry is used as pattern, and the input string is compared in a case-blind fashion with that pattern.

Mapping Entry Patterns

Patterns can contain wildcard characters. In particular, the usual wildcard characters are allowed: an asterisk (*) matches zero or more characters, and each percent sign (%) matches a single character. Asterisks, percent signs, spaces, and tabs can be quoted by preceding them with a dollar sign ($). Quoting an asterisk or percent sign robs it of any special meaning. Spaces and tabs must be quoted to prevent them from ending prematurely a pattern or template. Literal dollar sign characters should be doubled ($$), the first dollar sign quoting the second one.

Table 4–14 Mapping Pattern Wildcards

Wildcard  

Description  

Match exactly one character. 

Match zero or more characters, with maximal or “greedy” left-to-right matching 

Back match  

Description  

$ n* 

Match the nth wildcard or glob. 

Modifiers  

Description  

$_ 

Use minimal or “lazy” left-to-right matching. 

$@ 

Turn off “saving” of the succeeding wildcard or glob. 

$^ 

Turn on “saving” of the succeeding wildcard or glob; this is the default. 

Glob wildcard  

Description  

$A% 

Match one alphabetic character, A-Z or a-z. 

$A* 

Match zero or more alphabetic characters, A-Z or a-z. 

$B% 

Match one binary digit (0 or 1). 

$B* 

Match zero or more binary digits (0 or 1). 

$D% 

Match one decimal digit 0-9. 

$D* 

Match zero or more decimal digits 0-9. 

$H% 

Match one hexadecimal digit 0-9 or A-F. 

$H* 

Match zero or more hexadecimal digits 0-9 or A-F. 

$O% 

Match one octal digit 0-7. 

$O* 

Match zero or more octal digits 0-7. 

$S% 

Match one symbol set character, that is, 0-9, A-Z, a-z, _, $. 

$S* 

Match zero or more symbol set characters, that is, 0-9, A-Z, a-z, _, $. 

$T% 

Match one tab or vertical tab or space character. 

$T* 

Match zero or more tab or vertical tab or space characters. 

$X% 

A synonym for $H%. 

$X* 

A synonym for $H*. 

$[ c]% 

Match character c. 

$[ c]* 

Match arbitrary occurrences of character c. 

$[ c1 c2 ... cn ]%

Match exactly one occurrence of character c1, c2, or cn.

$[ c1 c2 ... cn ]*

Match arbitrary occurrences of any characters c1, c2, or cn.

$[ c1 -cn ]%

Match any one character in the range c1 to cn.

$[ c1 -cn ]*

Match arbitrary occurrences of characters in the range c1 to cn.

$< IPv4> 

Match an IPv4 address, ignoring bits. 

$(IPv4) 

Match an IPv4 address, keeping prefix bits. 

${IPv6} 

Match an IPv6 address. 

For more information about mapping pattern wildcards, see Mappings File in Sun Java System Messaging Server 6.3 Administration Guide.

Mapping Entry Templates

Table 4–15 lists the special substitution and standard processing metacharacters. Any other metacharacters are reserved for mapping-specific applications.

See the Sun Java System Messaging Server 6.3 Administration Guide for more discussion on mapping entry templates.

Table 4–15 Mapping Template Substitutions and Metacharacters

Substitution sequence  

Substitutes  

$n

The nth wildcarded field as counted from left to right starting from 0.

$#...#

Sequence number substitution. 

$]...[ 

LDAP search URL lookup; substitute in result. 

$|...|

Applies specified mapping table to supplied string. 

${...} 

General database substitution. 

$}domain,attribute{ 

Adds the capability to access per-domain attributes. domain is the domain in question and attribute is the attribute associated with the domain. If the domain exists and has the attribute, its initial value is substituted into the mapping result; if either the attribute or the domain does not exist, the mapping entry fails. 

Attributes can be domain LDAP attributes or the special attributes defined below: 

_base_dn_ - The base DN for user entries in the domain 

_domain_dn_ - The DN of the domain entry itself 

_domain_name_ - The name of the domain (as opposed to an alias) 

_canonical_name_ - The canonical name associated with the domain 

$[...]

Invokes site-supplied routine; substitute in result. 

Metacharacter  

Description  

$C

Continues the mapping process starting with the next table entry; uses the output string of this entry as the new input string for the mapping process. 

$E

Ends the mapping process now; uses the output string from this entry as the final result of the mapping process. 

$L

Continues the mapping process starting with the next table entry; use the output string of this entry as the new input string; after all entries in the table are exhausted, makes one more pass, starting with the first table entry. A subsequent match may override this condition with a $C, $E, or $R metacharacter.

$R

Continues the mapping process starting with the first entry of the mapping table; uses the output string of this entry as the new input string for the mapping process. 

$nA

Inserts the nth left character of the current address starting from position 0. The entire address is inserted if n is omitted. 

$nX

Inserts the nth left component of the mailhost starting from 0. The entire mailhost is inserted of n is omitted. 

$?x?

Mapping entry succeeds x percent of the time. 

$\

Forces subsequent text to lowercase. 

$^

Forces subsequent text to uppercase. 

$_

Leaves subsequent text in its original case. 

$=

Specifies that substituted characters undergo quoting appropriate for insertion into LDAP search filters. 

$:x

Match only if the specified flag is set. 

$;x

Match only if the specified flag is clear. 

For more information on Processing Control, see Processing Control ($C, $L, $R, $E) in Sun Java System Messaging Server 6.3 Administration Guide.

For more information on the substitution sequences and metacharacters, see Chapter 10, About MTA Services and Configuration, in Sun Java System Messaging Server 6.3 Administration Guide.

For details about which MTA processes use which tables and when, see Mappings File in Sun Java System Messaging Server 6.3 Administration Guide.