pipe.8.html   [plain text]


<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html> <head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<title> Postfix manual - pipe(8) </title>
</head> <body> <pre>
PIPE(8)                                                   PIPE(8)

<b>NAME</b>
       pipe - Postfix delivery to external command

<b>SYNOPSIS</b>
       <b>pipe</b> [generic Postfix daemon options] command_attributes...

<b>DESCRIPTION</b>
       The  <b>pipe</b> daemon processes requests from the Postfix queue
       manager to deliver messages to  external  commands.   This
       program  expects to be run from the <a href="master.8.html"><b>master</b>(8)</a> process man-
       ager.

       Message  attributes  such  as  sender  address,  recipient
       address  and  next-hop  host name can be specified as com-
       mand-line macros that are  expanded  before  the  external
       command is executed.

       The  <b>pipe</b>  daemon updates queue files and marks recipients
       as finished, or it informs the queue manager that delivery
       should  be  tried  again  at a later time. Delivery status
       reports are sent to the <a href="bounce.8.html"><b>bounce</b>(8)</a>,  <a href="defer.8.html"><b>defer</b>(8)</a>  or  <a href="trace.8.html"><b>trace</b>(8)</a>
       daemon as appropriate.

<b>SINGLE-RECIPIENT DELIVERY</b>
       Some external commands cannot handle more than one recipi-
       ent per delivery request. Examples of such transports  are
       pagers, fax machines, and so on.

       To  prevent  Postfix  from sending multiple recipients per
       delivery request, specify

           <i>transport</i><b>_destination_recipient_limit = 1</b>

       in the Postfix <b>main.cf</b> file, where <i>transport</i> is  the  name
       in the first column of the Postfix <b>master.cf</b> entry for the
       pipe-based delivery transport.

<b>COMMAND ATTRIBUTE SYNTAX</b>
       The external command attributes are given in the <b>master.cf</b>
       file at the end of a service definition.  The syntax is as
       follows:

       <b>flags=BDFORhqu.</b>&gt; (optional)
              Optional message processing flags.  By  default,  a
              message is copied unchanged.

              <b>B</b>      Append  a blank line at the end of each mes-
                     sage. This is required  by  some  mail  user
                     agents  that  recognize  "<b>From</b>  " lines only
                     when preceded by a blank line.

              <b>D</b>      Prepend a "<b>Delivered-To:</b> <i>recipient</i>"  message
                     header  with the envelope recipient address.
                     Note: for this to work, the <i>transport</i><b>_desti-</b>
                     <b>nation_recipient_limit</b> must be 1.

              <b>F</b>      Prepend  a "<b>From</b> <i>sender time</i><b>_</b><i>stamp</i>" envelope
                     header to  the  message  content.   This  is
                     expected by, for example, <b>UUCP</b> software.

              <b>O</b>      Prepend  an  "<b>X-Original-To:</b> <i>recipient</i>" mes-
                     sage header with the  recipient  address  as
                     given  to  Postfix.  Note: for this to work,
                     the    <i>transport</i><b>_destination_recipient_limit</b>
                     must be 1.

              <b>R</b>      Prepend  a  <b>Return-Path:</b> message header with
                     the envelope sender address.

              <b>h</b>      Fold the command-line <b>$recipient</b> domain name
                     and  <b>$nexthop</b> host name to lower case.  This
                     is recommended for delivery via <b>UUCP</b>.

              <b>q</b>      Quote white space and other special  charac-
                     ters in the command-line <b>$sender</b> and <b>$recip-</b>
                     <b>ient</b> address localparts (text to the left of
                     the right-most <b>@</b> character), according to an
                     8-bit transparent version of <a href="http://www.faqs.org/rfcs/rfc822.html">RFC 822</a>.   This
                     is  recommended  for  delivery  via  <b>UUCP</b> or
                     <b>BSMTP</b>.

                     The result is compatible  with  the  address
                     parsing  of  command-line  recipients by the
                     Postfix <b>sendmail</b> mail submission command.

                     The <b>q</b> flag affects  only  entire  addresses,
                     not the partial address information from the
                     <b>$user</b>, <b>$extension</b> or  <b>$mailbox</b>  command-line
                     macros.

              <b>u</b>      Fold  the  command-line  <b>$recipient</b>  address
                     localpart (text to the left  of  the  right-
                     most  <b>@</b>  character)  to lower case.  This is
                     recommended for delivery via <b>UUCP</b>.

              <b>.</b>      Prepend <b>.</b> to lines starting with  "<b>.</b>".  This
                     is needed by, for example, <b>BSMTP</b> software.

              &gt;      Prepend  &gt;  to  lines starting with "<b>From</b> ".
                     This is expected by, for example, <b>UUCP</b> soft-
                     ware.

       <b>user</b>=<i>username</i> (required)

       <b>user</b>=<i>username</i>:<i>groupname</i>
              The external command is executed with the rights of
              the specified <i>username</i>.  The  software  refuses  to
              execute  commands with root privileges, or with the
              privileges of the mail system owner.  If  <i>groupname</i>
              is  specified,  the  corresponding group ID is used
              instead of the group ID of <i>username</i>.

       <b>eol=string</b> (optional, default: <b>\n</b>)
              The output record delimiter.  Typically  one  would
              use  either <b>\r\n</b> or <b>\n</b>. The usual C-style backslash
              escape sequences are recognized: <b>\a \b \f \n \r  \t</b>
              <b>\v \</b><i>octal</i> and <b>\\</b>.

       <b>size</b>=<i>size</i><b>_</b><i>limit</i> (optional)
              Messages greater in size than this limit (in bytes)
              will be bounced back to the sender.

       <b>argv</b>=<i>command</i>... (required)
              The command to be executed. This must be  specified
              as the last command attribute.  The command is exe-
              cuted  directly,  i.e.  without  interpretation  of
              shell  meta  characters  by  a shell command inter-
              preter.

              In  the  command  argument  vector,  the  following
              macros are recognized and replaced with correspond-
              ing information  from  the  Postfix  queue  manager
              delivery request:

              <b>${extension</b>}
                     This  macro expands to the extension part of
                     a recipient address.  For example,  with  an
                     address  <i>user+foo@domain</i>  the  extension  is
                     <i>foo</i>.

                     A  command-line   argument   that   contains
                     <b>${extension</b>}  expands  into as many command-
                     line arguments as there are recipients.

                     This information is modified by the  <b>u</b>  flag
                     for case folding.

              <b>${mailbox</b>}
                     This  macro  expands  to  the complete local
                     part of a recipient address.   For  example,
                     with  an address <i>user+foo@domain</i> the mailbox
                     is <i>user+foo</i>.

                     A  command-line   argument   that   contains
                     <b>${mailbox</b>} expands into as many command-line
                     arguments as there are recipients.

                     This information is modified by the  <b>u</b>  flag
                     for case folding.

              <b>${nexthop</b>}
                     This macro expands to the next-hop hostname.

                     This information is modified by the  <b>h</b>  flag
                     for case folding.

              <b>${recipient</b>}
                     This macro expands to the complete recipient
                     address.

                     A  command-line   argument   that   contains
                     <b>${recipient</b>}  expands  into as many command-
                     line arguments as there are recipients.

                     This information  is  modified  by  the  <b>hqu</b>
                     flags for quoting and case folding.

              <b>${sender</b>}
                     This  macro  expands  to the envelope sender
                     address.

                     This information is modified by the  <b>q</b>  flag
                     for quoting.

              <b>${size</b>}
                     This  macro expands to Postfix's idea of the
                     message size, which is an  approximation  of
                     the size of the message as delivered.

              <b>${user</b>}
                     This macro expands to the username part of a
                     recipient address.   For  example,  with  an
                     address <i>user+foo@domain</i> the username part is
                     <i>user</i>.

                     A  command-line   argument   that   contains
                     <b>${user</b>}  expands  into  as many command-line
                     arguments as there are recipients.

                     This information is modified by the  <b>u</b>  flag
                     for case folding.

       In  addition  to  the  form  ${<i>name</i>},  the forms $<i>name</i> and
       $(<i>name</i>) are also recognized.  Specify <b>$$</b> where a single  <b>$</b>
       is wanted.

<b>DIAGNOSTICS</b>
       Command  exit status codes are expected to follow the con-
       ventions defined in &lt;<b>sysexits.h</b>&gt;.

       Problems and transactions are logged to <b>syslogd</b>(8).   Cor-
       rupted  message files are marked so that the queue manager
       can move them to the <b>corrupt</b> queue for further inspection.

<b>SECURITY</b>
       This  program  needs  a  dual personality 1) to access the
       private Postfix queue and IPC mechanisms, and 2)  to  exe-
       cute external commands as the specified user. It is there-
       fore security sensitive.

<b>CONFIGURATION PARAMETERS</b>
       Changes to <b>main.cf</b> are picked up automatically as  <a href="pipe.8.html">pipe(8)</a>
       processes  run  for only a limited amount of time. Use the
       command "<b>postfix reload</b>" to speed up a change.

       The text below provides  only  a  parameter  summary.  See
       <a href="postconf.5.html">postconf(5)</a> for more details including examples.

<b>RESOURCE AND RATE CONTROLS</b>
       In  the text below, <i>transport</i> is the first field in a <b>mas-</b>
       <b>ter.cf</b> entry.

       <i>transport</i><b>_destination_concurrency_limit ($<a href="postconf.5.html#default_destination_concurrency_limit">default_destina</a>-</b>
       <b><a href="postconf.5.html#default_destination_concurrency_limit">tion_concurrency_limit</a>)</b>
              Limit the number of parallel deliveries to the same
              destination,  for delivery via the named <i>transport</i>.
              The limit is enforced by the Postfix queue manager.

       <i>transport</i><b>_destination_recipient_limit   ($<a href="postconf.5.html#default_destination_recipient_limit">default_destina</a>-</b>
       <b><a href="postconf.5.html#default_destination_recipient_limit">tion_recipient_limit</a>)</b>
              Limit  the  number of recipients per message deliv-
              ery, for delivery via  the  named  <i>transport</i>.   The
              limit is enforced by the Postfix queue manager.

       <i>transport</i><b>_time_limit ($<a href="postconf.5.html#command_time_limit">command_time_limit</a>)</b>
              Limit  the  time  for delivery to external command,
              for delivery via the named <i>transport</i>.  The limit is
              enforced by the pipe delivery agent.

<b>MISCELLANEOUS CONTROLS</b>
       <b><a href="postconf.5.html#config_directory">config_directory</a> (see 'postconf -d' output)</b>
              The  default  location  of  the Postfix main.cf and
              master.cf configuration files.

       <b><a href="postconf.5.html#daemon_timeout">daemon_timeout</a> (18000s)</b>
              How much time a Postfix daemon process may take  to
              handle  a  request  before  it  is  terminated by a
              built-in watchdog timer.

       <b><a href="postconf.5.html#export_environment">export_environment</a> (see 'postconf -d' output)</b>
              The list of environment variables  that  a  Postfix
              process will export to non-Postfix processes.

       <b><a href="postconf.5.html#ipc_timeout">ipc_timeout</a> (3600s)</b>
              The time limit for sending or receiving information
              over an internal communication channel.

       <b><a href="postconf.5.html#mail_owner">mail_owner</a> (postfix)</b>
              The UNIX system account that owns the Postfix queue
              and most Postfix daemon processes.

       <b><a href="postconf.5.html#max_idle">max_idle</a> (100s)</b>
              The  maximum  amount  of  time that an idle Postfix
              daemon process waits for the next  service  request
              before exiting.

       <b><a href="postconf.5.html#max_use">max_use</a> (100)</b>
              The  maximal number of connection requests before a
              Postfix daemon process terminates.

       <b><a href="postconf.5.html#process_id">process_id</a> (read-only)</b>
              The process ID of a Postfix command or daemon  pro-
              cess.

       <b><a href="postconf.5.html#process_name">process_name</a> (read-only)</b>
              The  process  name  of  a Postfix command or daemon
              process.

       <b><a href="postconf.5.html#queue_directory">queue_directory</a> (see 'postconf -d' output)</b>
              The location of the Postfix top-level queue  direc-
              tory.

       <b><a href="postconf.5.html#recipient_delimiter">recipient_delimiter</a> (empty)</b>
              The separator between user names and address exten-
              sions (user+foo).

       <b><a href="postconf.5.html#syslog_facility">syslog_facility</a> (mail)</b>
              The syslog facility of Postfix logging.

       <b><a href="postconf.5.html#syslog_name">syslog_name</a> (postfix)</b>
              The mail system name that is prepended to the  pro-
              cess  name  in  syslog  records,  so  that  "smtpd"
              becomes, for example, "postfix/smtpd".

<b>SEE ALSO</b>
       <a href="qmgr.8.html">qmgr(8)</a>, queue manager
       <a href="bounce.8.html">bounce(8)</a>, delivery status reports
       <a href="postconf.5.html">postconf(5)</a>, configuration parameters
       <a href="master.8.html">master(8)</a>, process manager
       syslogd(8), system logging

<b>LICENSE</b>
       The Secure Mailer license must be  distributed  with  this
       software.

<b>AUTHOR(S)</b>
       Wietse Venema
       IBM T.J. Watson Research
       P.O. Box 704
       Yorktown Heights, NY 10598, USA

                                                          PIPE(8)
</pre> </body> </html>