SPAWN(8postfix)

πŸ“¦
version 3.8.6 Β· 2 versions
, in debian bookworm, ubuntu noble

πŸ’– SPAWN(8postfix) πŸ’–

okay so bestie, we're reading the spawn(8postfix) page today and honestly? it's giving "the humble little overachiever of the Postfix family." let's get into it ✨


✨ NAME ✨

spawn β€” the Postfix external command spawner 🐣


🌸 SYNOPSIS 🌸

spawn [generic Postfix daemon options] command_attributes...

πŸ¦‹ DESCRIPTION πŸ¦‹

so the spawn(8) daemon is literally Postfix's version of inetd. iconic behavior, no cap. it sits there listening on a port (whatever port the Postfix master.cf file told it to use, bestie) and then β€” the moment a connection shows up β€” it spawns an external command. main character energy fr fr. πŸ’…

and that connection can come in over local IPC (think UNIX-domain sockets, the cozy ones) or over non-local IPC (think TCP sockets, the long-distance ones 🌈).

the command's standard input, output and error streams? they get wired directly to the communication endpoint. no middleman, no filter, just vibes.

lowkey important: this daemon expects to be run from the master(8) process manager. that's its whole situation. don't try to freelance it.

πŸŽ€ COMMAND ATTRIBUTE SYNTAX πŸŽ€

the external command attributes go in the master.cf file, at the end of a service definition. the syntax is literally this:

user=username (required)

user=username:groupname

  • the external command runs with the rights of the username you specified. periodt.
  • the software refuses to execute commands with root privileges, or with the privileges of the mail system owner. it said no and it meant no πŸ™…β€β™€οΈ
  • if you also give groupname, then that group ID is used instead of the group ID of username. mix and match, bestie.

argv=command... (required)

  • the command to be executed. this one must be specified as the last command attribute β€” it's the finale, the last song of the setlist 🎀
  • the command is executed directly, i.e. without interpretation of shell meta characters by a shell command interpreter. no shell, no drama, no sneaky $ expansion. just the raw command.

πŸ’€ BUGS πŸ’€

okay so here's the tea and it's a lil tragic. 😭

in order to enforce standard Postfix process resource controls, the spawn(8) daemon runs only one external command at a time. one. at a time. as such, it presents a noticeable overhead by wasting precious process resources. it's out here burning through the good stuff for no reason.

the spawn(8) daemon is expected to be replaced by a more structural solution. so like… it knows. we all know. it's a transitional era. 🫢


🩺 DIAGNOSTICS 🩺

the spawn(8) daemon reports abnormal child exits. if something's wrong, problems are logged to syslogd(8) or postlogd(8). so if you're confused, go read the logs, babe, the logs always know. πŸ”


πŸ”₯ SECURITY πŸ”₯

this program needs root privilege in order to execute external commands as the specified user. so yeah, it's security sensitive β€” highkey, not lowkey.

however (and this is the slay part ✨): the spawn(8) daemon does not talk to the external command, and thus is not vulnerable to data-driven attacks. it's the strong silent type. it just introduces people and leaves the group chat. πŸ‘‘


⭐ CONFIGURATION PARAMETERS ⭐

changes to main.cf are picked up automatically, because spawn(8) processes run for only a limited amount of time. if you're impatient (valid), use the command:

postfix reload

to speed up a change. ✨

the text below provides only a parameter summary. see postconf(5) for more details including examples. iykyk.

in the text below, transport is the first field of the entry in the master.cf file.

🌈 RESOURCE AND RATE CONTROL 🌈

  • transport_time_limit ($command_time_limit) β€” a transport-specific override for the command_time_limit parameter value, where transport is the master.cf name of the message delivery transport.

πŸ’œ MISCELLANEOUS πŸ’œ

  • config_directory (see postconf -d output) β€” the default location of the Postfix main.cf and master.cf configuration 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 (see postconf -d output) β€” 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 (see postconf -d output) β€” the location of the Postfix top-level queue directory.
  • syslog_facility (mail) β€” the syslog facility of Postfix logging.
  • syslog_name (see postconf -d output) β€” a prefix that is prepended to the process name in syslog records, so that, for example, smtpd becomes prefix/smtpd.

available in Postfix 3.3 and later: πŸŽ‰

  • service_name (read-only) β€” the master.cf service name of a Postfix daemon process.

πŸ‘€ SEE ALSO πŸ‘€


πŸ“œ 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 spawn(8postfix) manual page, bestie β€” you read the entire thing and i'm so proud of you πŸ₯ΉπŸ«Ά this was the SPAWN(8postfix) page, straight from the Postfix source, and we are officially obsessed. go forth and spawn responsibly. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from