Conversion entry scanning and application

The conversion channel processes each message routed through it,  part by part. The header of each part is read and its Content-type: and other header information  is extracted. (Note that composite media types, that is, MULTIPART/&#x2a; or MESSAGE/&#x2a; "parts", are not made available per se to the  conversion channel, though any component discrete body parts within  such composite types are made available to the conversion channel for  potential processing.)

The entries in the conversion file are then scanned in order from first to last; any    parameters present and the    parameter, if present, are checked. If all of these parameters match the corresponding information for the body part being processed,  then the conversion specified by the remainder of the entry is  performed. Note that an entry must include an   clause in order  to match. More specifically, the matching checks:



 if specified  and    parameters match the  channels1  through which the message  is passing; 

 and if the specified  matches the structured part  number2  of the message part; 

 and if the (required!)  parameter, as well as all specified ,  , and   parameters, match the Content-type: of the message part; 

 and if all specified ,  , and     parameters match the Content-disposition of the message part; 

 and if the   matches the Content-description of the  message part; 

 and if specified,  ,   , and   values match those of the headers of the immediately enclosing message (message/rfc822  part); 

 and (as of MS 7.0.5) if the    matches the Content-transfer-encoding of  the message part. 



Only if all specified parameters match is the entry considered to match. Scanning terminates once a matching entry has been found or all entries have been exhausted. If no entry matches, no conversion is performed.

If the matching entry specifies, then the message part is  deleted. Otherwise, the command specified by the   parameter is  executed.

Once an entry with a  parameter has been selected,  the body part  is extracted to a file. The converter execution environment is prepared as specified by the     parameters and   parameters. Finally, a subprocess is created to run the command specified by the     parameter. The command should perform the necessary conversion operation, reading the file specified by the   environment variable (UNIX) and producing the file  specified by the    environment  variable (UNIX).

The command may optionally set options in the  file to pass information back to the conversion channel.

Conversion operations are terminated and no conversion is performed if the  forked command returns an error.

If the command succeeds, the resulting output file is read as specified by the   parameter and a new body part containing the  converted  material is constructed according to the ,   ,   ,   ,  ,  ,   ,    parameters.

This process is repeated for each part of the message until all parts have been processed.

See Conversion entry parameters for a complete list of the parameters available to conversion entries.

<span id='conversion_entry_scan_footnote1'> 1The source channel and destination channel are normally the original source channel and original destination channel prior to the   mapping table applying and forcing a "hop" through the conversion channel: that is, the conversion channel itself is not normally the   or. However, see the  MTA option, and  explicit routing of an address through the conversion channel for exceptions.

<span id='conversion_entry_scan_footnote2'> 2 The structured part number is the         message part number as it would appear in PMDF MAIL. That is, a multipart message has outer "level" parts counted starting from 1, and with a part, if it is a multipart itself, the subparts count starting from 1, and so on for additional "levels". So a multipart with no additional sublevels may have part numbers 1, 2, 3, etc., while a multipart whose second part is itself a multipart, might have part numbers 1, 2.1, 2.2, etc., 3, etc..

See also:
 * Conversion channel
 * Conversion entry parameters
 * Conversion control