SPAWN(8)
π SPAWN(8) π
okay bestie, gather round, because we're about to talk about the Postfix external command spawner and honestly? it's giving chaos gremlin with a job β¨
β¨ NAME β¨
spawn β Postfix external command spawner π«Ά
πΈ SYNOPSIS πΈ
spawn [generic Postfix daemon options] command_attributes...
π¦ DESCRIPTION π¦
so the spawn(8) daemon is out here monitoring a TCP or UNIX-domain stream socket, and you set that up in master.cf with a service type of inet or unix. periodt.
and the way that it works is: every single time a connection gets established, this daemon spawns an external command β and it hooks up the standard input, output and error file descriptors straight to the remote client. literally just hands the whole convo over. iconic behavior honestly π
now, the command process is subject to the time limit specified with the parameter transport_time_limit (default: command_time_limit), where transport equals the service name field in master.cf. and if a process exceeds that time limit?? it receives a SIGKILL signal. π no warning, no negotiation, just gone.
also, the spawn(8) daemon service typically has a process limit > 1 in its master.cf service definition, so that the number of processes can scale with demand. she grows when she needs to. main character energy fr fr π
π COMMAND ATTRIBUTE SYNTAX π
the external command attributes go in the master.cf file, at the end of a service definition. here's the syntax, bestie, take notes π
user=username(required) β yep, mandatory, no skipping.user=username:groupnameβ the external command gets executed with the rights of the specified username. but β and this is the important part β the software refuses to execute commands with root privileges, or with the privileges of the mail system owner. nope. absolutely not. π« If groupname is specified, the corresponding group ID is used instead of the group ID of username.argv=command...(required) β the command to be executed. this one must be specified as the last command attribute, no exceptions. and it's executed directly, i.e. without interpretation of shell meta characters by a shell command interpreter. so no sneaky shell nonsense, okay? π
now, if a command argument must contain whitespace, or if a command argument must begin with {, you enclose the argument with { and }. this form will ignore whitespace after the outer { and before the outer }. example time, babes:
argv=/bin/sh -c { shell syntax here }
π₯ DIAGNOSTICS π₯
the spawn(8) daemon reports abnormal child exits. problems get logged to syslogd(8) or postlogd(8). so if something goes sideways, it will be documented, and everyone will know π
π SECURITY π
okay this is the serious bit so listen up fr fr.
the spawn(8) daemon needs root privilege in order to execute external commands as the specified user. it is therefore security sensitive. like, highkey. treat it with respect. π«‘
however β and this is the slay part β the spawn(8) daemon does not receive data from or about service clients or external commands, and thus is not vulnerable to data-driven attacks. she's locked in. she doesn't take input from strangers. boundaries, bestie. π
π CONFIGURATION PARAMETERS π
changes to main.cf are picked up automatically as spawn(8) processes run for only a limited amount of time. use the command postfix reload to speed up a change. go on, you know you want to β¨
the text below provides only a parameter summary. see postconf(5) for more details including examples.
in the text below, transport is the first field of the entry in the master.cf file. iykyk π§
β RESOURCE AND RATE CONTROL β
transport_time_limit($command_time_limit) β a transport-specific override for thecommand_time_limitparameter value, where transport is themaster.cfname of the message delivery transport.
π MISCELLANEOUS π
config_directory(seepostconf -doutput) β the default location of the Postfixmain.cfandmaster.cfconfiguration files.daemon_timeout(18000s) β how much time a Postfix daemon process may take to handle a request before it is terminated by a built-in watchdog timer. β°export_environment(seepostconf -doutput) β the list of environment variables that a Postfix process will export to non-Postfix processes.ipc_timeout(3600s) β the time limit for sending or receiving information over an internal communication channel.mail_owner(postfix) β the UNIX system account that owns the Postfix queue and most Postfix daemon processes.max_idle(100s) β the maximum amount of time that an idle Postfix daemon process waits for an incoming connection before terminating voluntarily.max_use(100) β the maximal number of incoming connections that a Postfix daemon process will service before terminating voluntarily.process_id(read-only) β the process ID of a Postfix command or daemon process.process_name(read-only) β the process name of a Postfix command or daemon process.queue_directory(seepostconf -doutput) β the location of the Postfix top-level queue directory.syslog_facility(mail) β the syslog facility of Postfix logging.syslog_name(seepostconf -doutput) β a prefix that is prepended to the process name in syslog records, so that, for example,smtpdbecomesprefix/smtpd.
π available in Postfix 3.3 and later:
service_name(read-only) β themaster.cfservice name of a Postfix daemon process.
π«Ά SEE ALSO π«Ά
postconf(5), configuration parametersmaster(8), process managerpostlogd(8), Postfix loggingsyslogd(8), system logging
π LICENSE π
The Secure Mailer license must be distributed with this software.
π AUTHOR(S) π
Wietse Venema IBM T.J. Watson Research P.O. Box 704 Yorktown Heights, NY 10598, USA
Wietse Venema Google, Inc. 111 8th Avenue New York, NY 10011, USA
and that's the whole page bestie!! π this was SPAWN(8) from the System Manager's Manual β huge thank you to Wietse Venema for the lore, mwah π now go forth and spawn responsibly, and remember: no root privileges, no mail system owner privileges, and absolutely no shell meta character interpretation. slay π
β¨π¦
π¦ where this page comes from
- alpine 3.22: postfix-doc 3.10.13-r0 Β· IPL-1.0 EPL-2.0
- alpine 3.23: postfix-doc 3.10.13-r0 Β· IPL-1.0 EPL-2.0
- alpine 3.24: postfix-doc 3.11.7-r0 Β· IPL-1.0 EPL-2.0
- arch rolling: postfix 3.11.7-1 Β· EPL-2.0 OR IPL-1.0 AND BSD-4-Clause-UC
- debian trixie: postfix 3.10.13-0+deb13u1
- fedora 43: postfix 2:3.10.14-1.fc43 Β· (IPL-1.0 OR EPL-2.0) AND GPL-2.0-or-later AND BSD-4-Clause-UC
- fedora 43: postfix 2:3.10.3-3.fc43 Β· (IPL-1.0 OR EPL-2.0) AND GPL-2.0-or-later AND BSD-4-Clause-UC
- fedora 44: postfix 2:3.10.14-1.fc44 Β· (IPL-1.0 OR EPL-2.0) AND GPL-2.0-or-later AND BSD-4-Clause-UC
- fedora 44: postfix 2:3.10.7-2.fc44 Β· (IPL-1.0 OR EPL-2.0) AND GPL-2.0-or-later AND BSD-4-Clause-UC
- nixos 26.05: postfix 3.11.7
- nixpkgs unstable: postfix 3.11.7
- opensuse-leap 16.0: postfix 3.10.2-160000.3.1 Β· EPL-2.0 OR IPL-1.0
- opensuse-leap 16.0: postfix 3.10.2-160000.3.1 Β· EPL-2.0 OR IPL-1.0
- opensuse-leap 16.0: postfix 3.10.2-160000.3.1 Β· EPL-2.0 OR IPL-1.0
- opensuse-leap 16.0: postfix 3.10.2-160000.3.1 Β· EPL-2.0 OR IPL-1.0
- opensuse-leap 16.0: postfix-bdb 3.10.2-160000.3.1 Β· EPL-2.0 OR IPL-1.0
- opensuse-leap 16.0: postfix-bdb 3.10.2-160000.3.1 Β· EPL-2.0 OR IPL-1.0
- opensuse-leap 16.0: postfix-bdb 3.10.2-160000.3.1 Β· EPL-2.0 OR IPL-1.0
- opensuse-leap 16.0: postfix-bdb 3.10.2-160000.3.1 Β· EPL-2.0 OR IPL-1.0
- ubuntu questing: postfix 3.10.2-1ubuntu2
- ubuntu questing: postfix 3.10.2-1ubuntu2.1
- ubuntu resolute: postfix 3.10.6-4ubuntu2
- ubuntu resolute: postfix 3.10.6-4ubuntu2.1
- ubuntu resolute: postfix 3.10.6-4ubuntu2.2
- ubuntu stonking: postfix 3.11.7-1ubuntu2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms