POSTFIX(1)
postfix(1) โ General Commands Manual ๐
okay so bestie, this is postfix(1) โ yes, the General Commands Manual one โ and it's giving major main-character Unix energy. iykyk. Let's unpack it. ๐
โจ NAME โจ
postfix โ Postfix control program ๐
๐ SYNOPSIS ๐
postfix [-Dv] [-c config_dir] command
๐ DESCRIPTION ๐
okay so first vibe check: this command is reserved for the superuser. If you just wanna submit mail, use the Postfix sendmail(1) command โ that's the one for sending, bestie, not this. ๐ญ
The postfix(1) command controls the operation of the Postfix mail system: start or stop the master(8) daemon, do a health check, and other maintenance. Iconic behavior, honestly.
By default, the postfix(1) command sets up a standardized environment and runs the postfix-script shell script to do the actual work.
However, when support for multiple Postfix instances is configured, postfix(1) executes the command specified with the multi_instance_wrapper configuration parameter. This command will execute the command for each applicable Postfix instance. no cap.
The following commands are implemented:
checkโ Warn about bad directory/file ownership or permissions, and create missing directories. permissions vibe check, slay.startโ Start the Postfix mail system. This also runs the configuration check described above.start-fgโ Likestart, but keep themaster(8)daemon running in the foreground, and enablemaster(8)"init" mode when running as PID 1. This command requires that multi-instance support is disabled (i.e. themulti_instance_directoriesparameter value must be empty). When running Postfix inside a container, seeMAILLOG_READMEfor logging to stdout. Postfix logs to syslog by default, which requires a) running asyslogdprocess inside the container, or b) mounting the container host's/dev/logsocket inside the container (example:docker run -v /dev/log:/dev/log ...), and c) a distinct Postfix"syslog_name"prefix that identifies logging from the Postfix instance. container besties, take notes.stopโ Stop the Postfix mail system in an orderly fashion. If possible, running processes are allowed to terminate at their earliest convenience.
Note: in order to refresh the Postfix mail system after a configuration change, do not use thestartandstopcommands in succession. Use thereloadcommand instead. not me catching you doing start-then-stop โ don't. fr fr.
abortโ Stop the Postfix mail system abruptly. Running processes are signaled to stop immediately.flushโ Force delivery: attempt to deliver every message in the deferred mail queue. Normally, attempts to deliver delayed mail happen at regular intervals, the interval doubling after each failed attempt.
Warning: flushing undeliverable mail frequently will result in poor delivery performance of all other mail. this is the messy part, bestie.
reloadโ Re-read configuration files. Running processes terminate at their earliest convenience.statusโ Indicate if the Postfix mail system is currently running (zero exit status) or stopped (non-zero exit status).set-permissions [name=value ...]โ Set the ownership and permissions of Postfix related files and directories, as specified in thepostfix-filesfile. Specifyname=valueto override and update specificmain.cfconfiguration parameters. Use this, for example, to change themail_ownerorsetgid_groupsetting for an already installed Postfix system. This feature is available in Postfix 2.1 and later. With Postfix 2.0 and earlier, use"$config_directory/post-install set-permissions".logrotateโ Rotate the logfile specified with$maillog_file, by appending a time-stamp suffix that is formatted according to$maillog_file_rotate_suffix, and by compressing the file with the command specified with$maillog_file_compressor. This will not rotate/dev/*files. log glow-up, but only for non-dev files.non-bdbsubcommand โ Migrate a Postfix configuration that uses Berkeley DBhash:orbtree:tables, to a configuration that useslmdb:or a combination ofcdb:andlmdb:. This is needed because some (Linux) distributions have removed Berkeley DB support. Seepostfix-nbdb(1)for documentation. This feature is available in Postfix 3.11 and later. periodt.tlssubcommand โ Enable opportunistic TLS in the Postfix SMTP client or server, and manage Postfix SMTP server TLS private keys and certificates. Seepostfix-tls(1)for documentation. This feature is available in Postfix 3.1 and later.upgrade-configuration [name=value ...]โ Update themain.cfandmaster.cffiles with information that Postfix needs in order to run: add or update services, and add or update configuration parameter settings. Specifyname=valueto override and update specificmain.cfconfiguration parameters. This feature is available in Postfix 2.1 and later. With Postfix 2.0 and earlier, use"$config_directory/post-install upgrade-configuration".
The following options are implemented:
-c config_dirโ Read themain.cfandmaster.cfconfiguration files in the named directory instead of the default configuration directory. Use this to distinguish between multiple Postfix instances on the same host. With Postfix 2.6 and later, this option forces thepostfix(1)command to operate on the specified Postfix instance only. This behavior is inherited bypostfix(1)commands that run as a descendant of the current process. instance-selection slay.-D(withpostfix startonly) โ Run each Postfix daemon under control of a debugger as specified via thedebugger_commandconfiguration parameter.-vโ Enable verbose logging for debugging purposes. Multiple-voptions make the software increasingly verbose. more v's, more lore.
๐ ENVIRONMENT ๐
The postfix(1) command exports the following environment variables before executing the postfix-script file:
MAIL_CONFIGโ This is set when the-ccommand-line option is present. With Postfix 2.6 and later, this environment variable forces thepostfix(1)command to operate on the specified Postfix instance only. This behavior is inherited bypostfix(1)commands that run as a descendant of the current process.MAIL_VERBOSEโ This is set when the-vcommand-line option is present.MAIL_DEBUGโ This is set when the-Dcommand-line option is present.
When the internal logging service is enabled (by setting a non-empty maillog_file parameter value) the postfix(1) command exports settings that are used by child processes before they have processed main.cf or command-line settings.
POSTLOG_SERVICEโ The name of the publicpostlogservice endpoint.POSTLOG_HOSTNAMEโ The hostname to prepend to internal logging.
โจ CONFIGURATION PARAMETERS โจ
okay so these main.cf parameters are exported as environment variables with the exact same names, periodt:
config_directory(default: seepostconf -doutput) โ the default location of the Postfixmain.cfandmaster.cfconfiguration files.command_directory(default: seepostconf -doutput) โ the location of all Postfix administrative commands.daemon_directory(default: seepostconf -doutput) โ the directory with Postfix support programs and daemon programs.html_directory(default: seepostconf -doutput) โ the location of Postfix HTML files that describe how to build, configure or operate a specific Postfix subsystem or feature.mail_owner(default:postfix) โ the UNIX system account that owns the Postfix queue and most Postfix daemon processes.mailq_path(default: seepostconf -doutput) โ Sendmail compatibility feature that specifies where the Postfixmailq(1)command is installed.manpage_directory(default: seepostconf -doutput) โ where the Postfix manual pages are installed.newaliases_path(default: seepostconf -doutput) โ Sendmail compatibility feature that specifies the location of thenewaliases(1)command.queue_directory(default: seepostconf -doutput) โ the location of the Postfix top-level queue directory.readme_directory(default: seepostconf -doutput) โ the location of Postfix README files that describe how to build, configure or operate a specific Postfix subsystem or feature.sendmail_path(default: seepostconf -doutput) โ a Sendmail compatibility feature that specifies the location of the Postfixsendmail(1)command.setgid_group(default:postdrop) โ the group ownership of set-gid Postfix commands and of group-writable Postfix directories.
no cap, this is the whole parameter list โ every default stays exactly as written ๐
๐ฆ Available in Postfix version 2.5 and later ๐ฆ
data_directory(default: seepostconf -doutput) โ the directory with Postfix-writable data files, for example: caches, pseudo-random numbers.
๐ฆ Available in Postfix version 3.0 and later ๐ฆ
compatibility_level(default:0) โ a safety net that causes Postfix to run with backwards-compatible default settings after an upgrade to a newer Postfix version.meta_directory(default: seepostconf -doutput) โ the location of non-executable files that are shared among multiple Postfix instances, such aspostfix-files,dynamicmaps.cf, and the multi-instance template filesmain.cf.protoandmaster.cf.proto.shlib_directory(default: seepostconf -doutput) โ the location of Postfix dynamically-linked libraries (libpostfix-*.so), and the default location of Postfix database plugins (postfix-*.so) that have a relative pathname in thedynamicmaps.cffile.
๐ฆ Available in Postfix version 3.1 and later ๐ฆ
openssl_path(default:openssl) โ the location of the OpenSSL command line programopenssl(1).
๐ Other configuration parameters ๐
import_environment(default: seepostconf -doutput) โ the list of environment variables that a privileged Postfix process will import from a non-Postfix parent process, orname=valueenvironment overrides.syslog_facility(default:mail) โ the syslog facility of Postfix logging.syslog_name(default: seepostconf -doutput) โ a prefix that is prepended to the process name in syslog records, so that, for example,"smtpd"becomes"prefix/smtpd".
๐ฆ Available in Postfix version 2.6 and later ๐ฆ
multi_instance_directories(default:empty) โ an optional list of non-default Postfix configuration directories; these directories belong to additional Postfix instances that share the Postfix executable files and documentation with the default Postfix instance, and that are started, stopped, etc., together with the default Postfix instance.multi_instance_wrapper(default:empty) โ the pathname of a multi-instance manager command that thepostfix(1)command invokes when themulti_instance_directoriesparameter value is non-empty.multi_instance_group(default:empty) โ the optional instance group name of this Postfix instance.multi_instance_name(default:empty) โ the optional instance name of this Postfix instance.multi_instance_enable(default:no) โ allow this Postfix instance to be started, stopped, etc., by a multi-instance manager.
๐ฆ Available in Postfix version 3.4 and later ๐ฆ
maillog_file(default:empty) โ the name of an optional logfile that is written by the Postfixpostlogd(8)service.maillog_file_compressor(default:gzip) โ the program to run after rotating$maillog_filewithpostfix logrotate.maillog_file_prefixes(default:/var,/dev/stdout) โ a list of allowed prefixes for amaillog_filevalue.maillog_file_rotate_suffix(default:%Y%m%d-%H%M%S) โ the format of the suffix to append to$maillog_filewhile rotating the file withpostfix logrotate.postlog_service_name(default:postlog) โ the name of thepostlogd(8)service entry inmaster.cf.
๐๏ธ FILES ๐๏ธ
Prior to Postfix version 2.6, all of the following files were in $config_directory. Some files are now in $daemon_directory or $meta_directory so that they can be shared among multiple instances that run the same Postfix version.
Use the command postconf config_directory or postconf daemon_directory to expand the names into their actual values.
$config_directory/main.cfโ Postfix configuration parameters$config_directory/master.cfโ Postfix daemon processes$daemon_directory/postfix-scriptโ administrative commands$daemon_directory/post-installโ post-installation configuration$meta_directory/dynamicmaps.cfโ plug-in database clients$meta_directory/postfix-filesโ file/directory permissions
๐ SEE ALSO ๐
bestie, the link list is huge and every single one is here, no skips:
๐ Commands ๐
postalias(1)โ create/update/query alias databasepostcat(1)โ examine Postfix queue filepostconf(1)โ Postfix configuration utilitypostdrop(1)โ Postfix mail posting utilitypostfix(1)โ Postfix control programpostfix-non-bdb(1)โ Postfix Non-Berkeley-DB migrationpostfix-tls(1)โ Postfix TLS managementpostkick(1)โ trigger Postfix daemonpostlock(1)โ Postfix-compatible lockingpostlog(1)โ Postfix-compatible loggingpostmap(1)โ Postfix lookup table managerpostmulti(1)โ Postfix multi-instance managerpostqueue(1)โ Postfix mail queue controlpostsuper(1)โ Postfix housekeepingmailq(1)โ Sendmail compatibility interfacenewaliases(1)โ Sendmail compatibility interfacesendmail(1)โ Sendmail compatibility interface
๐ Postfix configuration ๐
bounce(5)โ Postfix bounce message templatesmaster(5)โ Postfixmaster.cffile syntaxpostconf(5)โ Postfixmain.cffile syntaxpostfix-wrapper(5)โ Postfix multi-instance API
๐ Table-driven mechanisms ๐
access(5)โ Postfix SMTP access control tablealiases(5)โ Postfix local aliasingcanonical(5)โ Postfix input address rewritinggeneric(5)โ Postfix output address rewritingheader_checks(5),body_checks(5)โ Postfix content inspectionrelocated(5)โ Users that have movedtransport(5)โ Postfix routing tablevirtual(5)โ Postfix virtual aliasing
๐ Table lookup mechanisms ๐
cidr_table(5)โ Associate CIDR pattern with valueldap_table(5)โ Postfix LDAP clientlmdb_table(5)โ Postfix LMDB database drivermemcache_table(5)โ Postfix memcache clientmongodb_table(5)โ Postfix MongoDB clientmysql_table(5)โ Postfix MYSQL clientnisplus_table(5)โ Postfix NIS+ clientpcre_table(5)โ Associate PCRE pattern with valuepgsql_table(5)โ Postfix PostgreSQL clientregexp_table(5)โ Associate POSIX regexp pattern with valuesocketmap_table(5)โ Postfix socketmap clientsqlite_table(5)โ Postfix SQLite database drivertcp_table(5)โ Postfix client-server table lookup
๐ Daemon processes ๐
anvil(8)โ Postfix connection/rate limitingbounce(8),defer(8),trace(8)โ Delivery status reportscleanup(8)โ canonicalize and enqueue messagediscard(8)โ Postfix discard delivery agentdnsblog(8)โ DNS allow/denylist loggererror(8)โ Postfix error delivery agentflush(8)โ Postfix fast ETRN servicelocal(8)โ Postfix local delivery agentmaster(8)โ Postfix master daemonoqmgr(8)โ old Postfix queue managerpickup(8)โ Postfix local mail pickuppipe(8)โ deliver mail to non-Postfix commandpostlogd(8)โ Postfix internal logging servicepostscreen(8)โ Postfix zombie blockerproxymap(8)โ Postfix lookup table proxy serverqmgr(8)โ Postfix queue managerqmqpd(8)โ Postfix QMQP serverscache(8)โ Postfix connection cache managershowq(8)โ list Postfix mail queuesmtp(8),lmtp(8)โ Postfix SMTP+LMTP clientsmtpd(8)โ Postfix SMTP serverspawn(8)โ run non-Postfix servertlsmgr(8)โ Postfix TLS cache and randomness managertlsproxy(8)โ Postfix TLS proxy servertrivial-rewrite(8)โ Postfix address rewritingverify(8)โ Postfix address verificationvirtual(8)โ Postfix virtual delivery agent
๐ Other ๐
syslogd(8)โ system logging
๐ README FILES ๐
Use postconf readme_directory or postconf html_directory to locate this information.
OVERVIEWโ overview of Postfix commands and processesBASIC_CONFIGURATION_READMEโ Postfix basic configurationADDRESS_REWRITING_READMEโ Postfix address rewritingSMTPD_ACCESS_READMEโ SMTP relay/access controlCONTENT_INSPECTION_READMEโ Postfix content inspectionQSHAPE_READMEโ Postfix queue analysis
๐ 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. - TLS support by: Lutz Jaenicke โ Brandenburg University of Technology, Cottbus, Germany.
- Victor Duchovni โ Morgan Stanley.
- SASL support originally by: Till Franke โ SuSE Rhein/Main AG,
65760 Eschborn, Germany. - LMTP support originally by: Philip A. Prindeville โ Mirapoint, Inc., USA.
- Amos Gouaux โ University of Texas at Dallas,
P.O. Box 830688, MC34, Richardson, TX 75083, USA. - IPv6 support originally by:
- Mark Huizer โ Eindhoven University, The Netherlands
- Jun-ichiro 'itojun' Hagino โ KAME project, Japan
- The Linux PLD project
- Dean Strik โ Eindhoven University, The Netherlands
Final footer vibe check: the footer is just POSTFIX(1) โ thatโs the source/version tag โ and no date line is shown, so thatโs the whole sign-off. Bye bestie, go config slay ๐
โจ
๐ฆ where this page comes from
- 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
- nixos 26.05: postfix 3.11.7
- nixpkgs unstable: postfix 3.11.7
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms