Home

postfix(1)

POSTFIX(1)General Commands ManualPOSTFIX(1)

postfix - Postfix control program

postfix [-Dv] [-c config_dir] command


This command is reserved for the superuser. To submit mail, use the Postfix sendmail(1) command.

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.

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.

The following commands are implemented:

Warn about bad directory/file ownership or permissions, and create missing directories.
Start the Postfix mail system. This also runs the configuration check described above.
Like start, but keep the master(8) daemon running in the foreground, and enable master(8) "init" mode when running as PID 1. This command requires that multi-instance support is disabled (i.e. the multi_instance_directories parameter value must be empty).

When running Postfix inside a container, see MAILLOG_README for logging to stdout. Postfix logs to syslog by default, which requires a) running a syslogd process inside the container, or b) mounting the container host's /dev/log socket 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.

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 the start and stop commands in succession. Use the reload command instead.

Stop the Postfix mail system abruptly. Running processes are signaled to stop immediately.
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.

Re-read configuration files. Running processes terminate at their earliest convenience.
Indicate if the Postfix mail system is currently running.
Set the ownership and permissions of Postfix related files and directories, as specified in the postfix-files file.

Specify name=value to override and update specific main.cf configuration parameters. Use this, for example, to change the mail_owner or setgid_group setting 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-installset-permissions".

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.

This feature is available in Postfix 3.4 and later.

Enable opportunistic TLS in the Postfix SMTP client or server, and manage Postfix SMTP server TLS private keys and certificates. See postfix-tls(1) for documentation.

This feature is available in Postfix 3.1 and later.

Update the main.cf and master.cf files with information that Postfix needs in order to run: add or update services, and add or update configuration parameter settings.

Specify name=value to override and update specific main.cf configuration parameters.

This feature is available in Postfix 2.1 and later. With Postfix 2.0 and earlier, use "$config_directory/post-installupgrade-configuration".

The following options are implemented:

Read the main.cf and master.cf configuration 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 the postfix(1) command to operate on the specified Postfix instance only. This behavior is inherited by postfix(1) commands that run as a descendant of the current process.

Run each Postfix daemon under control of a debugger as specified via the debugger_command configuration parameter.
Enable verbose logging for debugging purposes. Multiple -v options make the software increasingly verbose.

The postfix(1) command exports the following environment variables before executing the postfix-script file:

This is set when the -c command-line option is present.

With Postfix 2.6 and later, this environment variable forces the postfix(1) command to operate on the specified Postfix instance only. This behavior is inherited by postfix(1) commands that run as a descendant of the current process.

This is set when the -v command-line option is present.
This is set when the -D command-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.

The name of the public postlog service endpoint.
The hostname to prepend to internal logging.

The following main.cf configuration parameters are exported as environment variables with the same names:

The default location of the Postfix main.cf and master.cf configuration files.
The location of all postfix administrative commands.
The directory with Postfix support programs and daemon programs.
The location of Postfix HTML files that describe how to build, configure or operate a specific Postfix subsystem or feature.
The UNIX system account that owns the Postfix queue and most Postfix daemon processes.
Sendmail compatibility feature that specifies where the Postfix mailq(1) command is installed.
Where the Postfix manual pages are installed.
Sendmail compatibility feature that specifies the location of the newaliases(1) command.
The location of the Postfix top-level queue directory.
The location of Postfix README files that describe how to build, configure or operate a specific Postfix subsystem or feature.
A Sendmail compatibility feature that specifies the location of the Postfix sendmail(1) command.
The group ownership of set-gid Postfix commands and of group-writable Postfix directories.

Available in Postfix version 2.5 and later:

The directory with Postfix-writable data files (for example: caches, pseudo-random numbers).

Available in Postfix version 3.0 and later:

A safety net that causes Postfix to run with backwards-compatible default settings after an upgrade to a newer Postfix version.
The location of non-executable files that are shared among multiple Postfix instances, such as postfix-files, dynamicmaps.cf, and the multi-instance template files main.cf.proto and master.cf.proto.
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 the dynamicmaps.cf file.

Available in Postfix version 3.1 and later:

The location of the OpenSSL command line program openssl(1).

Other configuration parameters:

The list of environment variables that a privileged Postfix process will import from a non-Postfix parent process, or name=value environment overrides.
The syslog facility of Postfix logging.
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:

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.
The pathname of a multi-instance manager command that the postfix(1) command invokes when the multi_instance_directories parameter value is non-empty.
The optional instance group name of this Postfix instance.
The optional instance name of this Postfix instance.
Allow this Postfix instance to be started, stopped, etc., by a multi-instance manager.

Available in Postfix version 3.4 and later:

The name of an optional logfile that is written by the Postfix postlogd(8) service.
The program to run after rotating $maillog_file with "postfix logrotate".
A list of allowed prefixes for a maillog_file value.
The format of the suffix to append to $maillog_file while rotating the file with "postfix logrotate".
The name of the postlogd(8) service entry in master.cf.

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

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-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 interfacePostfix configuration:bounce(5), Postfix bounce message templatesmaster(5), Postfix master.cf file syntaxpostconf(5), Postfix main.cf file syntaxpostfix-wrapper(5), Postfix multi-instance APITable-driven mechanisms:access(5), Postfix SMTP access control tablealiases(5), Postfix alias databasecanonical(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 aliasingTable 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 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 lookupDaemon 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 agentOther:syslogd(8), system logging

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

The Secure Mailer license must be distributed with this software.

Wietse VenemaIBM T.J. Watson ResearchP.O. Box 704Yorktown Heights, NY 10598, USAWietse VenemaGoogle, Inc.111 8th AvenueNew York, NY 10011, USATLS support by:Lutz JaenickeBrandenburg University of TechnologyCottbus, GermanyVictor DuchovniMorgan StanleySASL support originally by:Till FrankeSuSE Rhein/Main AG65760 Eschborn, GermanyLMTP support originally by:Philip A. PrindevilleMirapoint, Inc.USA.Amos GouauxUniversity of Texas at DallasP.O. Box 830688, MC34Richardson, TX 75083, USAIPv6 support originally by:Mark Huizer, Eindhoven University, The NetherlandsJun-ichiro 'itojun' Hagino, KAME project, JapanThe Linux PLD projectDean Strik, Eindhoven University, The Netherlands