Pipe channel option file

Unless you have a pipe database, or have established delivery methods  for pipe channel addressees, each pipe channel must have an option  file. If there are no delivery methods set in the MTA profile database, nor a pipe channel option file, nor a pipe database, then the channel will  not operate.

The commands to execute for each envelope recipient address presented to the channel are specified in the MTA profile database, in the  pipe database or in the  pipe channel&#x27;s option file. If an address does not appear in one of these locations, then an error notification is sent  back to the message originator.

In legacy configuration, pipe channel option files are stored in the MTA configuration directory   and  have names of the form   , where   is the name of the pipe channel to which the  option file applies. (In most instances, the file name will be  ; i.e.,    on UNIX.)

To process the address    ,  the  pipe channel first probes the option file for an entry of the form user@host=command If no matching entry is found, the channel next probes the option file for an entry of the form host=command If still no matching entry is found, then the recipient address is deemed bad and an error notification is sent back to the message  originator. See Pipe entry match order below for an additional discussion of  the order in which probes of various forms are made to the various  possible entry sources.

If, however, a probe does find a matching entry, then the specified command,   ,  is executed. Prior to being executed, any occurrences of the phrase   or   appearing in     are replaced with the name of the  temporary file containing the message to be processed. It is important that the command to be executed neither delete nor otherwise alter the temporary message file as it may be needed for  further pipe channel recipients of the same message. If disruption of the message file cannot be prevented, then mark the channel with the     channel option.

In Unified Configuration, the pipe channel option file is replaced by settings under, e.g., msconfig&#x3e; set channel:pipe.options.user_host command msconfig# set channel:pipe.options.host command where all "@", "%", and "+" characters are replaced by underscores. Also note that any periods in the   will need to be backslash quoted. So for instance, if   is, then the commands would appear as: msconfig&#x3e; set channel:pipe.options.user_mailhost\.domain\.com command msconfig# set channel:pipe.options.mailhost\.domain\.com command The command to be executed will be run by a subprocess of the process running the pipe channel. As such, it will be running with the privileges of the user named as the pipe channel processing account via (prior to MS 8.0) the   channel option on the pipe channel or (preferred approach as of MS 8.0) the   option in  ,  or if no pipe channel user was specified, then it will be running with the privileges of the  MTA user account (see the   option in  ). See Pipe channels for a description of the exit or completion codes with which the command should exit the subprocess.

Note: As with any MTA option file, it is important that the option file not be world writable. This is especially true of pipe channel option files.

In addition to the command entries in the pipe channel option file, there are additional general options available:1

1General UNIX L channel/native channel options may also be specified in a pipe option file, though their relevance for the pipe channel tends to be limited.

SHELL_TIMEOUT (integer; UNIX only)
The SHELL_TIMEOUT option may be used to control how long in seconds the channel will wait for a shell command to complete. Upon such time outs, the message will be returned back to the original sender with an error  message along the lines of "Timeout waiting for ...&#x27;s shell  command ... to complete". The default value is 600 (corresponding to 10 minutes).

SHELL_TMPDIR (directory-specification)
The SHELL_TMPDIR option may be used to control where the pipe channel creates its temporary files when delivering to a shell command. By default, such temporary files are created in the home directory of the  MTA user (or the user specified by the    channel option). Via this option the MTA administrator may instead choose to have the temporary files created in some (single) other directory;  e.g. (legacy configuration): SHELL_TMPDIR=/tmp or (Unified Configuration): msconfig&#x3e; set channel:pipe.options.SHELL_TMPDIR /tmp

ADDRESS_TYPES (0-7)
New in MS 8.0.1.3, the ADDRESS_TYPES pipe channel option controls what kinds of addresses this pipe channel allows. This is a bit encoded value, with the individual bits defined as follows:

The default value of this option is 7, meaning all types of processing are enabled.

One use of the ADDRESS_TYPES option is to allow the use of subaddresses with default programs. This can be accomplished by disabling processing of a+b address forms: msconfig&#x3e; set channel:pipe.options.ADDRESS_TYPES 5

UNIX_STYLE (0 or 1)
Setting UNIX_STYLE=1 causes the pipe channel to write out a UNIX style mbox file, including a colonless From line, if a pipe command such as  cat %s &#x3e;&#x3e; filename.txt is used. UNIX_STYLE=1 is the default on UNIXplatforms. Setting UNIX_STYLE=0 tells the pipe channel not to write the colonless From line. E.g., in Unified Configuration: msconfig&#x3e; set channel:pipe.options.UNIX_STYLE 0

See also:
 * Pipe database
 * restricted.cnf file
 * user Option
 * Pipe entry match order
 * Pipe channel addressees and their handling