{
    "content": [
        {
            "type": "text",
            "text": "# PIPE(8postfix) (man)\n\n**Summary:** pipe - Postfix delivery to external command\n\n**Synopsis:** pipe [generic Postfix daemon options] commandattributes...\n\n## See Also\n\n- qmgr(8)\n- bounce(8)\n- postconf(5)\n- master(5)\n- master(8)\n- postlogd(8)\n- syslogd(8)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (2 lines)\n- **DESCRIPTION** (10 lines)\n- **SINGLE-RECIPIENT DELIVERY** (11 lines)\n- **COMMAND ATTRIBUTE SYNTAX** (24 lines) — 1 subsections\n  - flags=BDFORXhqu.> (optional) (228 lines)\n- **STANDARDS** (2 lines)\n- **DIAGNOSTICS** (16 lines)\n- **SECURITY** (4 lines)\n- **CONFIGURATION PARAMETERS** (6 lines)\n- **RESOURCE AND RATE CONTROLS** (16 lines)\n- **MISCELLANEOUS CONTROLS** (70 lines)\n- **SEE ALSO** (8 lines)\n- **LICENSE** (16 lines)\n\n## Full Content\n\n### NAME\n\npipe - Postfix delivery to external command\n\n### SYNOPSIS\n\npipe [generic Postfix daemon options] commandattributes...\n\n### DESCRIPTION\n\nThe  pipe(8)  daemon processes requests from the Postfix queue manager to deliver messages to\nexternal commands.  This program expects to be run from the master(8) process manager.\n\nMessage attributes such as sender address, recipient address and next-hop host  name  can  be\nspecified as command-line macros that are expanded before the external command is executed.\n\nThe  pipe(8)  daemon  updates queue files and marks recipients as finished, or it informs the\nqueue manager that delivery should be tried again at a later time.  Delivery  status  reports\nare sent to the bounce(8), defer(8) or trace(8) daemon as appropriate.\n\n### SINGLE-RECIPIENT DELIVERY\n\nSome  destinations  cannot  handle more than one recipient per delivery request. Examples are\npagers or fax machines.  In addition, multi-recipient delivery is undesirable when prepending\na Delivered-to: or X-Original-To: message header.\n\nTo prevent Postfix from sending multiple recipients per delivery request, specify\n\ntransportdestinationrecipientlimit = 1\n\nin  the  Postfix main.cf file, where transport is the name in the first column of the Postfix\nmaster.cf entry for the pipe-based delivery transport.\n\n### COMMAND ATTRIBUTE SYNTAX\n\nThe external command attributes are given in the master.cf file at the end of a service defi‐\nnition.  The syntax is as follows:\n\nchroot=pathname (optional)\nChange  the  process root directory and working directory to the named directory. This\nhappens before switching to the privileges specified with the user attribute, and  be‐\nfore executing the optional directory=pathname directive. Delivery is deferred in case\nof failure.\n\nThis feature is available as of Postfix 2.3.\n\ndirectory=pathname (optional)\nChange to the named directory before executing the external  command.   The  directory\nmust  be  accessible  for the user specified with the user attribute (see below).  The\ndefault working directory is $queuedirectory.  Delivery is deferred in case of  fail‐\nure.\n\nThis feature is available as of Postfix 2.2.\n\neol=string (optional, default: \\n)\nThe  output  record  delimiter.  Typically  one would use either \\r\\n or \\n. The usual\nC-style backslash escape sequences are recognized: \\a \\b \\f \\n \\r \\t \\v  \\ddd  (up  to\nthree octal digits) and \\\\.\n\n#### flags=BDFORXhqu.> (optional)\n\nOptional message processing flags. By default, a message is copied unchanged.\n\nB      Append  a  blank line at the end of each message. This is required by some mail\nuser agents that recognize \"From \" lines only when preceded by a blank line.\n\nD      Prepend a \"Delivered-To: recipient\" message header with the envelope  recipient\naddress. Note: for this to work, the transportdestinationrecipientlimit must\nbe 1 (see SINGLE-RECIPIENT DELIVERY above for details).\n\nThe D flag also enforces loop detection (Postfix 2.5 and later): if  a  message\nalready  contains  a Delivered-To: header with the same recipient address, then\nthe message is returned as undeliverable. The address comparison is case insen‐\nsitive.\n\nThis feature is available as of Postfix 2.0.\n\nF      Prepend  a  \"From  sender  timestamp\"  envelope header to the message content.\nThis is expected by, for example, UUCP software.\n\nO      Prepend an \"X-Original-To: recipient\" message header with the recipient address\nas  given to Postfix. Note: for this to work, the transportdestinationrecipi‐‐\nentlimit must be 1 (see SINGLE-RECIPIENT DELIVERY above for details).\n\nThis feature is available as of Postfix 2.0.\n\nR      Prepend a Return-Path: message header with the envelope sender address.\n\nX      Indicate that the external command performs final delivery.  This flag  affects\nthe  status  reported in \"success\" DSN (delivery status notification) messages,\nand changes it from \"relayed\" into \"delivered\".\n\nThis feature is available as of Postfix 2.5.\n\nh      Fold the command-line $originalrecipient and $recipient  address  domain  part\n(text  to  the right of the right-most @ character) to lower case; fold the en‐\ntire command-line $domain and $nexthop host  or  domain  information  to  lower\ncase.  This is recommended for delivery via UUCP.\n\nq      Quote  white  space  and  other special characters in the command-line $sender,\n$originalrecipient and $recipient address localparts (text to the left of  the\nright-most  @ character), according to an 8-bit transparent version of RFC 822.\nThis is recommended for delivery via UUCP or BSMTP.\n\nThe result is compatible with the address parsing of command-line recipients by\nthe Postfix sendmail(1) mail submission command.\n\nThe  q  flag affects only entire addresses, not the partial address information\nfrom the $user, $extension or $mailbox command-line macros.\n\nu      Fold the command-line  $originalrecipient  and  $recipient  address  localpart\n(text to the left of the right-most @ character) to lower case.  This is recom‐\nmended for delivery via UUCP.\n\n.      Prepend \".\" to lines starting with \".\". This is needed by, for  example,  BSMTP\nsoftware.\n\n>      Prepend  \">\"  to lines starting with \"From \". This is expected by, for example,\nUUCP software.\n\nnullsender=replacement (default: MAILER-DAEMON)\nReplace the null sender address (typically used  for  delivery  status  notifications)\nwith the specified text when expanding the $sender command-line macro, and when gener‐\nating a From or Return-Path: message header.\n\nIf the null sender replacement text is a non-empty string then it is affected by the q\nflag for address quoting in command-line arguments.\n\nThe  null  sender  replacement text may be empty; this form is recommended for content\nfilters that feed mail back into Postfix. The empty sender address is not affected  by\nthe q flag for address quoting in command-line arguments.\n\nCaution:  a  null  sender address is easily mis-parsed by naive software. For example,\nwhen the pipe(8) daemon executes a command such as:\n\nWrong: command -f$sender -- $recipient\n\nthe command will mis-parse the -f option value when  the  sender  address  is  a  null\nstring.  For correct parsing, specify $sender as an argument by itself:\n\nRight: command -f $sender -- $recipient\n\nThis feature is available as of Postfix 2.3.\n\nsize=sizelimit (optional)\nDon't  deliver  messages  that  exceed  this size limit (in bytes); return them to the\nsender instead.\n\nuser=username (required)\n\nuser=username:groupname\nExecute the external command with the user ID and group ID of the specified  username.\nThe  software refuses to execute commands with root privileges, or with the privileges\nof the mail system owner. If groupname is specified, the  corresponding  group  ID  is\nused instead of the group ID of username.\n\nargv=command... (required)\nThe command to be executed. This must be specified as the last command attribute.  The\ncommand is executed directly, i.e. without interpretation of shell meta characters  by\na shell command interpreter.\n\nSpecify  \"{\" and \"}\" around command arguments that contain whitespace (Postfix 3.0 and\nlater). Whitespace after the opening \"{\" and before the closing \"}\" is ignored.\n\nIn the command argument vector, the following macros are recognized and replaced  with\ncorresponding information from the Postfix queue manager delivery request.\n\nIn  addition  to the form ${name}, the forms $name and the deprecated form $(name) are\nalso recognized.  Specify $$ where a single $ is wanted.\n\n${clientaddress}\nThis macro expands to the remote client network address.\n\nThis feature is available as of Postfix 2.2.\n\n${clienthelo}\nThis macro expands to the remote client HELO command parameter.\n\nThis feature is available as of Postfix 2.2.\n\n${clienthostname}\nThis macro expands to the remote client hostname.\n\nThis feature is available as of Postfix 2.2.\n\n${clientport}\nThis macro expands to the remote client TCP port number.\n\nThis feature is available as of Postfix 2.5.\n\n${clientprotocol}\nThis macro expands to the remote client protocol.\n\nThis feature is available as of Postfix 2.2.\n\n${domain}\nThis macro expands to the domain portion of the recipient address.   For  exam‐\nple, with an address user+foo@domain the domain is domain.\n\nThis information is modified by the h flag for case folding.\n\nThis feature is available as of Postfix 2.5.\n\n${extension}\nThis  macro expands to the extension part of a recipient address.  For example,\nwith an address user+foo@domain the extension is foo.\n\nA command-line argument that contains ${extension} expands into  as  many  com‐\nmand-line arguments as there are recipients.\n\nThis information is modified by the u flag for case folding.\n\n${mailbox}\nThis  macro expands to the complete local part of a recipient address.  For ex‐\nample, with an address user+foo@domain the mailbox is user+foo.\n\nA command-line argument that  contains  ${mailbox}  expands  to  as  many  com‐\nmand-line arguments as there are recipients.\n\nThis information is modified by the u flag for case folding.\n\n${nexthop}\nThis macro expands to the next-hop hostname.\n\nThis information is modified by the h flag for case folding.\n\n${originalrecipient}\nThis macro expands to the complete recipient address before any address rewrit‐\ning or aliasing.\n\nA command-line argument that contains ${originalrecipient} expands to as  many\ncommand-line arguments as there are recipients.\n\nThis information is modified by the hqu flags for quoting and case folding.\n\nThis feature is available as of Postfix 2.5.\n\n${queueid}\nThis macro expands to the queue id.\n\nThis feature is available as of Postfix 2.11.\n\n${recipient}\nThis macro expands to the complete recipient address.\n\nA  command-line  argument  that  contains  ${recipient} expands to as many com‐\nmand-line arguments as there are recipients.\n\nThis information is modified by the hqu flags for quoting and case folding.\n\n${saslmethod}\nThis macro expands to the name of the SASL authentication mechanism in the AUTH\ncommand when the Postfix SMTP server received the message.\n\nThis feature is available as of Postfix 2.2.\n\n${saslsender}\nThis  macro expands to the SASL sender name (i.e. the original submitter as per\nRFC 4954) in the MAIL FROM command when the Postfix SMTP  server  received  the\nmessage.\n\nThis feature is available as of Postfix 2.2.\n\n${saslusername}\nThis  macro  expands to the SASL user name in the AUTH command when the Postfix\nSMTP server received the message.\n\nThis feature is available as of Postfix 2.2.\n\n${sender}\nThis macro expands to the envelope sender address. By default, the null  sender\naddress  expands to MAILER-DAEMON; this can be changed with the nullsender at‐\ntribute, as described above.\n\nThis information is modified by the q flag for quoting.\n\n${size}\nThis macro expands to Postfix's idea of the message size, which is an  approxi‐\nmation of the size of the message as delivered.\n\n${user}\nThis  macro  expands to the username part of a recipient address.  For example,\nwith an address user+foo@domain the username part is user.\n\nA command-line argument that contains ${user} expands into as many command-line\narguments as there are recipients.\n\nThis information is modified by the u flag for case folding.\n\n### STANDARDS\n\nRFC 3463 (Enhanced status codes)\n\n### DIAGNOSTICS\n\nCommand  exit  status  codes  are expected to follow the conventions defined in <sysexits.h>.\nExit status 0 means normal successful completion.\n\nIn the case of a non-zero exit status, a limited amount of command output is logged, and  re‐\nported  in  a delivery status notification.  When the output begins with a 4.X.X or 5.X.X en‐\nhanced status code, the status code takes precedence over the non-zero exit  status  (Postfix\nversion 2.3 and later).\n\nAfter  successful  delivery  (zero exit status) a limited amount of command output is logged,\nand reported in \"success\" delivery status notifications (Postfix 3.0 and later).   This  com‐\nmand output is not examined for the presence of an enhanced status code.\n\nProblems  and  transactions are logged to syslogd(8) or postlogd(8).  Corrupted message files\nare marked so that the queue manager can move them to the corrupt queue for  further  inspec‐\ntion.\n\n### SECURITY\n\nThis  program  needs a dual personality 1) to access the private Postfix queue and IPC mecha‐\nnisms, and 2) to execute external commands as the specified user. It  is  therefore  security\nsensitive.\n\n### CONFIGURATION PARAMETERS\n\nChanges  to  main.cf  are picked up automatically as pipe(8) processes run for only a limited\namount of time. Use the command \"postfix reload\" to speed up a change.\n\nThe text below provides only a parameter summary. See postconf(5) for more details  including\nexamples.\n\n### RESOURCE AND RATE CONTROLS\n\nIn the text below, transport is the first field in a master.cf entry.\n\ntransporttimelimit ($commandtimelimit)\nA transport-specific override for the commandtimelimit parameter value, where trans‐\nport is the master.cf name of the message delivery transport.\n\nImplemented in the qmgr(8) daemon:\n\ntransportdestinationconcurrencylimit ($defaultdestinationconcurrencylimit)\nA transport-specific override for the defaultdestinationconcurrencylimit  parameter\nvalue, where transport is the master.cf name of the message delivery transport.\n\ntransportdestinationrecipientlimit ($defaultdestinationrecipientlimit)\nA  transport-specific  override  for the defaultdestinationrecipientlimit parameter\nvalue, where transport is the master.cf name of the message delivery transport.\n\n### MISCELLANEOUS CONTROLS\n\nconfigdirectory (see 'postconf -d' output)\nThe default location of the Postfix main.cf and master.cf configuration files.\n\ndaemontimeout (18000s)\nHow much time a Postfix daemon process may take to handle a request before it is  ter‐\nminated by a built-in watchdog timer.\n\ndelayloggingresolutionlimit (2)\nThe  maximal  number  of  digits after the decimal point when logging sub-second delay\nvalues.\n\nexportenvironment (see 'postconf -d' output)\nThe list of environment variables that a Postfix process will  export  to  non-Postfix\nprocesses.\n\nipctimeout (3600s)\nThe  time  limit  for  sending or receiving information over an internal communication\nchannel.\n\nmailowner (postfix)\nThe UNIX system account that owns the Postfix queue and most Postfix daemon processes.\n\nmaxidle (100s)\nThe maximum amount of time that an idle Postfix daemon process waits for  an  incoming\nconnection before terminating voluntarily.\n\nmaxuse (100)\nThe  maximal number of incoming connections that a Postfix daemon process will service\nbefore terminating voluntarily.\n\nprocessid (read-only)\nThe process ID of a Postfix command or daemon process.\n\nprocessname (read-only)\nThe process name of a Postfix command or daemon process.\n\nqueuedirectory (see 'postconf -d' output)\nThe location of the Postfix top-level queue directory.\n\nrecipientdelimiter (empty)\nThe set of characters that can separate a  user  name  from  its  extension  (example:\nuser+foo), or a .forward file name from its extension (example: .forward+foo).\n\nsyslogfacility (mail)\nThe syslog facility of Postfix logging.\n\nsyslogname (see 'postconf -d' output)\nA  prefix  that is prepended to the process name in syslog records, so that, for exam‐\nple, \"smtpd\" becomes \"prefix/smtpd\".\n\nAvailable in Postfix version 3.0 and later:\n\npipedeliverystatusfilter ($defaultdeliverystatusfilter)\nOptional filter for the pipe(8) delivery agent to change the delivery status  code  or\nexplanatory text of successful or unsuccessful deliveries.\n\nAvailable in Postfix version 3.3 and later:\n\nenableoriginalrecipient (yes)\nEnable  support  for the original recipient address after an address is rewritten to a\ndifferent address (for example with aliasing or with canonical mapping).\n\nservicename (read-only)\nThe master.cf service name of a Postfix daemon process.\n\nAvailable in Postfix 3.5 and later:\n\ninfologaddressformat (external)\nThe email address form that will be used in non-debug logging (info, warning, etc.).\n\n### SEE ALSO\n\nqmgr(8), queue manager\nbounce(8), delivery status reports\npostconf(5), configuration parameters\nmaster(5), generic daemon options\nmaster(8), process manager\npostlogd(8), Postfix logging\nsyslogd(8), system logging\n\n### LICENSE\n\nThe Secure Mailer license must be distributed with this software.\n\nAUTHOR(S)\nWietse Venema\nIBM T.J. Watson Research\nP.O. Box 704\nYorktown Heights, NY 10598, USA\n\nWietse Venema\nGoogle, Inc.\n111 8th Avenue\nNew York, NY 10011, USA\n\n\n\nPIPE(8postfix)\n\n"
        }
    ],
    "structuredContent": {
        "command": "PIPE",
        "section": "8postfix",
        "mode": "man",
        "summary": "pipe - Postfix delivery to external command",
        "synopsis": "pipe [generic Postfix daemon options] commandattributes...",
        "flags": [],
        "examples": [],
        "see_also": [
            {
                "name": "qmgr",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/qmgr/8/json"
            },
            {
                "name": "bounce",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/bounce/8/json"
            },
            {
                "name": "postconf",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/postconf/5/json"
            },
            {
                "name": "master",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/master/5/json"
            },
            {
                "name": "master",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/master/8/json"
            },
            {
                "name": "postlogd",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/postlogd/8/json"
            },
            {
                "name": "syslogd",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/syslogd/8/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 10,
                "subsections": []
            },
            {
                "name": "SINGLE-RECIPIENT DELIVERY",
                "lines": 11,
                "subsections": []
            },
            {
                "name": "COMMAND ATTRIBUTE SYNTAX",
                "lines": 24,
                "subsections": [
                    {
                        "name": "flags=BDFORXhqu.> (optional)",
                        "lines": 228
                    }
                ]
            },
            {
                "name": "STANDARDS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DIAGNOSTICS",
                "lines": 16,
                "subsections": []
            },
            {
                "name": "SECURITY",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "CONFIGURATION PARAMETERS",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "RESOURCE AND RATE CONTROLS",
                "lines": 16,
                "subsections": []
            },
            {
                "name": "MISCELLANEOUS CONTROLS",
                "lines": 70,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "LICENSE",
                "lines": 16,
                "subsections": []
            }
        ]
    }
}