Test -mapping utility

Test an MTA mapping table.

Syntax
imsimta test -mapping &#x5b;input-string&#x5d;

Optional input string to run through the mapping.

Description
may be used to test the behavior of an MTA mapping table. The string resulting from mapping an input string will be output along with a list of any  metacharacters  specified in the output string.

If an input string is supplied on the command line, then only the result of mapping that input string will be output. If no input string is specified, then   will enter a loop,  prompting for an input string, mapping that string, and prompting again  for another input string. will exit when a CTRL/D (UNIX) is entered.

Note that this utility is testing only the formal syntax and formal result of a mapping table; it is not testing what the mapping table  means (the effect of the mapping table) for actual MTA  operation. In particular, for testing the effect of   sorts of  mapping tables,   see instead the    utility.

Or in the other (less semantic, more syntactic) direction, note that the matching of wildcards in mapping table patterns (left hand sides of entries) may be tested in detail via the   utility, which may be of  particular interest when using "complex" wildcards such as  character "glob" matches, or  IP address prefix matches.

(default),
(New in MS 7.0) The  switch is the default, and causes the mapping table to be probed as if operating in a normal, MTA usage, application (with normal MTA initialization having been performed). causes the mapping table to be probed as if operating in a mode without normal MTA initialization, and hence may be useful for testing mapping table operation in non-MTA contexts.

,  (default)
The mapping test process is capable of producing additional, detailed information about the sequence of steps in the mapping probe(s) and  match(es). Such information is particularly likely to be of interest (useful) with iterative mapping tables, or mapping tables that involve  callouts; that is, such debug information is most likely to be of  interest when exploring implications of  ,  , or    metacharacter use,  or effects of callouts such as to  other mapping tables, to the  general database, to  LDAP, or to  Oracle or site-supplied routines. The  switch enables  this output; it is disabled by default.

(New in MS 8.1.0.1) The  switch is used to specify a destination channel when the MTA is initialized for writing. The source channel is used if no desitnation channel is specified. See the documentation on the  switch below for additional information.

,  (default)
The  switch is used to specify particular flags  to set during the mapping testing; for instance, the E (envelope), B  (header/body), R (backwards pointing), or I (message id) flags when  testing a   mapping. Multiple flags may be specified by concatenating them, e.g.,.

(default),
When the  switch is  specified (the default), the MTA will load the compiled configuration  file CONFIGROOT   (located prior to MS 7.0 via the     MTA Tailor option). When  is specified, then    will unconditionally ignore any  compiled mapping information and instead read mapping information directly from  the named MTA   groups (Unified Configuration) or the mappings file (legacy configuration).

(New in MS 8.0) By default,  takes  input from. The  switch may be  used to specify a different source for input.

This switch instructs  to use the  specified mapping file rather than the default MTA mapping file,  CONFIGROOT  (located prior to MS 7.0 via the   MTA Tailor option). This switch has no effect unless   is specified or no compiled configuration  exists; use of any compiled configuration will preclude reading any  MTA   values (Unified Configuration) or physical mapping file (legacy configuration); this switch also has no effect when an XML configuration is in use.

,
This switch instructs  to use the  specified option file rather than the default MTA option file, CONFIGROOT  (prior to MS 7.0 located via the   MTA Tailor option). This switch has no effect unless   is specified or no compiled configuration  exists; use of any compiled configuration will preclude reading any  MTA options whether from  option-name (Unified Configuration) or from a physical option file (legacy configuration). Use of the switch   will prevent the MTA option file   from  being read in when there is no compiled configuration. These switches have no effect when an XML configuration is in use.

(New in MS 8.1.0.1) The  switch is used to specify the envelope from (MAIL FROM) address when the MTA is initialized for writing. The value "mail@fom" is used if no originator address is specified. See the documentation on the  switch below for additional information.

(New in MS 8.0) By default,  writes  output to. The  switch may  be used to direct the output of    elsewhere.

,  (default)
The  switch may be used to tell the utility to  reread MTA   group options (Unified Configuration) or the   file (legacy configuration)  if the mapping table name specified is not  found cached in memory.

(New in MS 8.1.0.1) Mappings do not depend on the MTA being initialized for writing a message, but some mapping plugins do. In order to test such plugins, the  can be used to cause the enqueue logic to be initialized using the specified channel. Also see the  and   switches, which can be used to specify the envelope from (MAIL FROM) address and destination channel, respectively.

(default),
(New in MS 8.0) The  switch may be used to  suppress the (new in MS 8.0) output of segment sources.

This switch specifies the name of the mapping table to test. If this switch is not specified, then    will prompt for the name of a table to use.

Examples
Enter table name: MAC-TO-MIME-CONTENT-TYPES Input string: BINHEX&#x7c;7344424e&#x7c;4d535744&#x7c;Test.doc Output string: APPLICATION/MSWORD Output flags: &#x5b;0, &#x27;Y&#x27; (89)&#x5d; Input string: ^D # In the above UNIX example, the sample     mapping  is tested. The  switch is used to select  the mapping file   instead of the  default mapping file. Input string: testing Output string: testing plus A flag Output flags: &#x5b;0, &#x27;Y&#x27; (89)&#x5d; Input string: ^D Input string: next Output string: next without A flag Output flags: &#x5b;0, &#x27;Y&#x27; (89)&#x5d; Input string: ^D The above example assumes that the mappings file contains a mapping table: X-FLAGS &#x2a;             $C$:A$0$ plus$ A$ flag$Y$E &#x2a;             $;A$0$ without$ A$ flag$Y That  mapping table outputs the original input string plus  suffix string " " if the input flag  " " was present, or outputs the original input  string plus suffix string " " if  the input flag " " was not set. In the above   utility output, it can be seen that input  flags, if any, do not carry over to being present amongst the  set of output flags: an input flag set via the    switch does not carry over to appear amongst the output flags in the  " " portion of the output. Input flags and output flags are distinct and separately stored. Also note how the entry with the   test has that test  "wrapped" with the  " ... "; this is to cause the  mapping process to "continue on" if that entry (in particular  the test for the presence of the input flag " ")  failed, but "end" if the test succeeded. In this particular example, the " " could have been omitted since  the only subsequent entry explicitly checked for the opposite  (" " flag not present) condition. However wrapping with " ... " is better  practice, and is commonly used in entries containing tests.
 * 1) imsimta test -mapping -noimage_file -mapping_file=IMTA_TABLE:mac_mappings.sample
 * 1) imsimta test -mapping -flags=A -table=X-FLAGS
 * 1) imsimta test -mapping -flags=B -table=X-FLAGS

See also:
 * test -rewrite utility
 * Mapping entry patterns
 * Mapping entry templates
 * test -match utility
 * Mapping entry templates
 * Mapping entry templates
 * Mapping entry templates
 * Mapping entry templates
 * Mapping entry templates
 * REVERSE mapping table
 * MAC-TO-MIME-CONTENT-TYPES mapping table
 * MTA command line utilities