{
    "mode": "man",
    "parameter": "pipe",
    "section": "8",
    "url": "https://www.chedong.com/phpMan.php/man/pipe/8/json",
    "generated": "2026-08-31T22:12:50Z",
    "synopsis": "pipe [generic Postfix daemon options] commandattributes...",
    "sections": {
        "NAME": {
            "content": "pipe - Postfix delivery to external command\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "pipe [generic Postfix daemon options] commandattributes...\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "The  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",
            "subsections": []
        },
        "SINGLE-RECIPIENT DELIVERY": {
            "content": "Some  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",
            "subsections": []
        },
        "COMMAND ATTRIBUTE SYNTAX": {
            "content": "The 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",
            "subsections": [
                {
                    "name": "flags=BDFORXhqu.> (optional)",
                    "content": "Optional 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\nNOTE: DO NOT put quotes around the command, $sender, or $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"
                }
            ]
        },
        "STANDARDS": {
            "content": "RFC 3463 (Enhanced status codes)\n",
            "subsections": []
        },
        "DIAGNOSTICS": {
            "content": "Command  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",
            "subsections": []
        },
        "SECURITY": {
            "content": "This  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",
            "subsections": []
        },
        "CONFIGURATION PARAMETERS": {
            "content": "Changes  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",
            "subsections": []
        },
        "RESOURCE AND RATE CONTROLS": {
            "content": "In the text below, transport is the first field in a master.cf entry.\n",
            "subsections": [
                {
                    "name": "transport_time_limit ($command_time_limit)",
                    "content": "A 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"
                },
                {
                    "name": "transport_destination_concurrency_limit ($default_destination_concurrency_limit)",
                    "content": "A  transport-specific override for the defaultdestinationconcurrencylimit parameter\nvalue, where transport is the master.cf name of the message delivery transport.\n"
                },
                {
                    "name": "transport_destination_recipient_limit ($default_destination_recipient_limit)",
                    "content": "A transport-specific override for  the  defaultdestinationrecipientlimit  parameter\nvalue, where transport is the master.cf name of the message delivery transport.\n"
                }
            ]
        },
        "MISCELLANEOUS CONTROLS": {
            "content": "",
            "subsections": [
                {
                    "name": "config_directory (see 'postconf -d' output)",
                    "content": "The default location of the Postfix main.cf and master.cf configuration files.\n"
                },
                {
                    "name": "daemon_timeout (18000s)",
                    "content": "How  much time a Postfix daemon process may take to handle a request before it is ter‐\nminated by a built-in watchdog timer.\n"
                },
                {
                    "name": "delay_logging_resolution_limit (2)",
                    "content": "The maximal number of digits after the decimal point  when  logging  sub-second  delay\nvalues.\n"
                },
                {
                    "name": "export_environment (see 'postconf -d' output)",
                    "content": "The  list  of  environment variables that a Postfix process will export to non-Postfix\nprocesses.\n"
                },
                {
                    "name": "ipc_timeout (3600s)",
                    "content": "The time limit for sending or receiving information  over  an  internal  communication\nchannel.\n"
                },
                {
                    "name": "mail_owner (postfix)",
                    "content": "The UNIX system account that owns the Postfix queue and most Postfix daemon processes.\n"
                },
                {
                    "name": "max_idle (100s)",
                    "content": "The  maximum  amount of time that an idle Postfix daemon process waits for an incoming\nconnection before terminating voluntarily.\n"
                },
                {
                    "name": "max_use (100)",
                    "content": "The maximal number of incoming connections that a Postfix daemon process will  service\nbefore terminating voluntarily.\n"
                },
                {
                    "name": "process_id (read-only)",
                    "content": "The process ID of a Postfix command or daemon process.\n"
                },
                {
                    "name": "process_name (read-only)",
                    "content": "The process name of a Postfix command or daemon process.\n"
                },
                {
                    "name": "queue_directory (see 'postconf -d' output)",
                    "content": "The location of the Postfix top-level queue directory.\n"
                },
                {
                    "name": "recipient_delimiter (empty)",
                    "content": "The  set  of  characters that can separate an email address localpart, user name, or a\n.forward file name from its extension.\n"
                },
                {
                    "name": "syslog_facility (mail)",
                    "content": "The syslog facility of Postfix logging.\n"
                },
                {
                    "name": "syslog_name (see 'postconf -d' output)",
                    "content": "A 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"
                },
                {
                    "name": "pipe_delivery_status_filter ($default_delivery_status_filter)",
                    "content": "Optional  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"
                },
                {
                    "name": "enable_original_recipient (yes)",
                    "content": "Enable support for the original recipient address after an address is rewritten  to  a\ndifferent address (for example with aliasing or with canonical mapping).\n"
                },
                {
                    "name": "service_name (read-only)",
                    "content": "The master.cf service name of a Postfix daemon process.\n\nAvailable in Postfix 3.5 and later:\n"
                },
                {
                    "name": "info_log_address_format (external)",
                    "content": "The email address form that will be used in non-debug logging (info, warning, etc.).\n"
                }
            ]
        },
        "SEE ALSO": {
            "content": "qmgr(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",
            "subsections": []
        },
        "LICENSE": {
            "content": "The 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\nPIPE(8postfix)",
            "subsections": []
        }
    },
    "summary": "pipe - Postfix delivery to external command",
    "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"
        }
    ]
}