Mapping table format in legacy configuration

The mapping file consists of a series of separate tables. Each table begins with its name. Names always have an alphabetic character in the first column. The table name is followed by the the entries in the table. Entries consist of zero or more indented lines. Each entry line consists of two columns separated by one or more spaces or tabs. Prior to 7.0.5, any spaces within an entry must be quoted with the dollar sign,  ; in 7.0.5 or later unquoted spaces and tabs are allowed in the second column.

A backslash,, at the end of a line acts as a continuation character, causing the following line to be read and appended to the current line. A literal backslash may be placed at the end of a line by preceding it with a dollar sign,.

For clarity, it is recommended, but not required, that a blank line appear after each mapping table name and between each mapping table. Blank lines may also appear between successive mapping table entries but not after a continuation line, as it will terminate the continuation.

Trailing spaces and tabs are stripped from all lines, so lines containing nothing but spaces or tabs are considered "blank".

Comments are introduced by an exclamation mark,, appearing in the first column.

Pictorially, the format that results looks like this: ''TABLE-1-NAME pattern1-1   template1-1 pattern1-2   template1-2 pattern1-3   template1-3 .          .      .           .      .           .    pattern1-n    template1-n TABLE-2-NAME pattern2-1   template2-1 pattern2-2   template2-2 pattern2-3   template2-3 .          .      .           .      .           .    pattern2-n    template2-n .          .           . TABLE-m-NAME .          .           . In this example an application using the mapping table   would map the string   into whatever is specified by  ''.

A mapping table name may be up to 128 characters long. Each pattern and each template can contain up to 256 characters before substitutions; the result of applying substitutions must be no more than 1024 characters each. As of MS 6.3p1, the template (right hand side) limit has been increased to 1024 characters, and the overall length of each line in the mapping table has been increased to 4096 characters. (Prior to MS 6.0, the mapping table name was limited to 64 characters while the pattern and template were each individually limited to at most 252 characters.)  There is no limit to the number of entries that can appear in a mapping (although excessive numbers of entries may eat up huge amounts of CPU and can consume excessive amounts of memory).

When the MTA probes a mapping table, the overall probe length is also limited to 1024 characters.

The order in which mappings appear in the mappings file is not significant.

Duplicate mapping table names are not allowed in the mapping file.

Including other files in the mapping file
Other files may be included in the mapping file. This is done with a line of the form: &#x3c;file-spec This will effectively substitute the contents of the file   into the mapping file at the point where the include appears. The file specification should specify a full file path (device, directory, etc.). All files included in this fashion must be world readable. Comments are also allowed in such included mapping files. Includes can be nested up to three levels deep. Include files are loaded at the same time the mapping file is loaded --- they are not loaded on demand, so there is no performance or memory savings involved in using include files.

See also:
 * Mapping entry patterns
 * Mapping entry templates
 * Mapping table format