# postfix(1) - man - phpMan

[POSTFIX(1)](https://www.chedong.com/phpMan.php/man/POSTFIX/1/markdown)                             General Commands Manual                            [POSTFIX(1)](https://www.chedong.com/phpMan.php/man/POSTFIX/1/markdown)



## NAME
       postfix - Postfix control program

## SYNOPSIS
       **postfix** [**-Dv**] [**-c** _config_dir_] _command_

## DESCRIPTION
       This  command is reserved for the superuser. To submit mail, use the Postfix [**sendmail**(1)](https://www.chedong.com/phpMan.php/man/sendmail/1/markdown) com‐
       mand.

       The [**postfix**(1)](https://www.chedong.com/phpMan.php/man/postfix/1/markdown) command controls the operation of the Postfix mail system: start or  stop  the
       [**master**(8)](https://www.chedong.com/phpMan.php/man/master/8/markdown) daemon, do a health check, and other maintenance.

       By  default,  the  [**postfix**(1)](https://www.chedong.com/phpMan.php/man/postfix/1/markdown)  command  sets up a standardized environment and runs the **post**‐‐
       **fix-script** shell script to do the actual work.

       However, when support for multiple Postfix instances is configured, [**postfix**(1)](https://www.chedong.com/phpMan.php/man/postfix/1/markdown)  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:

       **check**  Warn about bad directory/file ownership or permissions, and  create  missing  directo‐
              ries.

       **start**  Start the Postfix mail system. This also runs the configuration check described above.

### start-fg
              Like  **start**,  but keep the [**master**(8)](https://www.chedong.com/phpMan.php/man/master/8/markdown) daemon running in the foreground, and enable **mas**‐‐
              [**ter**(8)](https://www.chedong.com/phpMan.php/man/ter/8/markdown) "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  con‐
              tainer  (example:  "docker  run  -v /dev/log:/dev/log ..."), and c) a distinct Postfix
              "syslog_name" prefix that identifies logging from the Postfix instance.

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

       **abort**  Stop the Postfix mail system abruptly. Running processes are signaled to stop  immedi‐
              ately.

       **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 perfor‐
              mance of all other mail.

       **reload** Re-read configuration files. Running processes  terminate  at  their  earliest  conve‐
              nience.

       **status** Indicate if the Postfix mail system is currently running.

       **set-permissions** [_name_=_value_ _..._]
              Set  the ownership and permissions of Postfix related files and directories, as speci‐
              fied 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-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.

              This feature is available in Postfix 3.4 and later.

       **tls** _subcommand_
              Enable opportunistic TLS in the Postfix SMTP client or server, and manage Postfix SMTP
              server TLS private keys and certificates.  See [postfix-tls(1)](https://www.chedong.com/phpMan.php/man/postfix-tls/1/markdown) for documentation.

              This feature is available in Postfix 3.1 and later.

       **upgrade-configuration** [_name_=_value_ _..._]
              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-install** **upgrade-configuration**".

       The following options are implemented:

### -c
              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)](https://www.chedong.com/phpMan.php/man/postfix/1/markdown) command to operate on
              the specified Postfix instance only.  This behavior is inherited  by  [postfix(1)](https://www.chedong.com/phpMan.php/man/postfix/1/markdown)  com‐
              mands that run as a descendant of the current process.

### -D
              Run each Postfix daemon under control of a debugger as specified via the **debugger**___**com**‐‐
              **mand** configuration parameter.

### -v -v
              increasingly verbose.

## ENVIRONMENT
       The [**postfix**(1)](https://www.chedong.com/phpMan.php/man/postfix/1/markdown) command exports the following environment variables before executing the **post**‐‐
       **fix-script** file:

       **MAIL**___**CONFIG**
              This is set when the -c command-line option is present.

              With Postfix 2.6 and later, this environment variable forces the [postfix(1)](https://www.chedong.com/phpMan.php/man/postfix/1/markdown) command to
              operate  on  the specified Postfix instance only.  This behavior is inherited by post‐
              [fix(1)](https://www.chedong.com/phpMan.php/man/fix/1/markdown) commands that run as a descendant of the current process.

       **MAIL**___**VERBOSE**
              This is set when the -v command-line option is present.

       **MAIL**___**DEBUG**
              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)](https://www.chedong.com/phpMan.php/man/postfix/1/markdown) 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 public postlog service endpoint.

       **POSTLOG**___**HOSTNAME**
              The hostname to prepend to internal logging.

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

       **config**___**directory** **(see** **'postconf** **-d'** **output)**
              The default location of the Postfix main.cf and master.cf configuration files.

       **command**___**directory** **(see** **'postconf** **-d'** **output)**
              The location of all postfix administrative commands.

       **daemon**___**directory** **(see** **'postconf** **-d'** **output)**
              The directory with Postfix support programs and daemon programs.

       **html**___**directory** **(see** **'postconf** **-d'** **output)**
              The  location of Postfix HTML files that describe how to build, configure or operate a
              specific Postfix subsystem or feature.

       **mail**___**owner** **(postfix)**
              The UNIX system account that owns the Postfix queue and most Postfix daemon processes.

       **mailq**___**path** **(see** **'postconf** **-d'** **output)**
              Sendmail compatibility feature that specifies where the Postfix  [**mailq**(1)](https://www.chedong.com/phpMan.php/man/mailq/1/markdown)  command  is
              installed.

       **manpage**___**directory** **(see** **'postconf** **-d'** **output)**
              Where the Postfix manual pages are installed.

       **newaliases**___**path** **(see** **'postconf** **-d'** **output)**
              Sendmail  compatibility  feature that specifies the location of the [**newaliases**(1)](https://www.chedong.com/phpMan.php/man/newaliases/1/markdown) com‐
              mand.

       **queue**___**directory** **(see** **'postconf** **-d'** **output)**
              The location of the Postfix top-level queue directory.

       **readme**___**directory** **(see** **'postconf** **-d'** **output)**
              The location of Postfix README files that describe how to build, configure or  operate
              a specific Postfix subsystem or feature.

       **sendmail**___**path** **(see** **'postconf** **-d'** **output)**
              A  Sendmail  compatibility  feature  that  specifies the location of the Postfix **send**‐‐
              [**mail**(1)](https://www.chedong.com/phpMan.php/man/mail/1/markdown) command.

       **setgid**___**group** **(postdrop)**
              The group ownership of set-gid Postfix commands and of group-writable Postfix directo‐
              ries.

       Available in Postfix version 2.5 and later:

       **data**___**directory** **(see** **'postconf** **-d'** **output)**
              The  directory  with  Postfix-writable  data files (for example: caches, pseudo-random
              numbers).

       Available in Postfix version 3.0 and later:

       **compatibility**___**level** **(0)**
              A safety net that causes Postfix to run with backwards-compatible default settings af‐
              ter an upgrade to a newer Postfix version.

       **meta**___**directory** **(see** **'postconf** **-d'** **output)**
              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.

       **shlib**___**directory** **(see** **'postconf** **-d'** **output)**
              The  location  of  Postfix dynamically-linked libraries (libpostfix-*.so), and the de‐
              fault location of Postfix database plugins (postfix-*.so) that have a  relative  path‐
              name in the dynamicmaps.cf file.

       Available in Postfix version 3.1 and later:

       **openssl**___**path** **(openssl)**
              The location of the OpenSSL command line program [**openssl**(1)](https://www.chedong.com/phpMan.php/man/openssl/1/markdown).

       Other configuration parameters:

       **import**___**environment** **(see** **'postconf** **-d'** **output)**
              The  list of environment parameters that a privileged Postfix process will import from
              a non-Postfix parent process, or name=value environment overrides.

       **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  exam‐
              ple, "smtpd" becomes "prefix/smtpd".

       Available in Postfix version 2.6 and later:

       **multi**___**instance**___**directories** **(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** **(empty)**
              The pathname of a multi-instance manager command that the [**postfix**(1)](https://www.chedong.com/phpMan.php/man/postfix/1/markdown)  command  invokes
              when the multi_instance_directories parameter value is non-empty.

       **multi**___**instance**___**group** **(empty)**
              The optional instance group name of this Postfix instance.

       **multi**___**instance**___**name** **(empty)**
              The optional instance name of this Postfix instance.

       **multi**___**instance**___**enable** **(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** **(empty)**
              The name of an optional logfile that is written by the Postfix [**postlogd**(8)](https://www.chedong.com/phpMan.php/man/postlogd/8/markdown) service.

       **maillog**___**file**___**compressor** **(gzip)**
              The program to run after rotating $maillog_file with "postfix logrotate".

       **maillog**___**file**___**prefixes** **(/var,** **/dev/stdout)**
              A list of allowed prefixes for a maillog_file value.

       **maillog**___**file**___**rotate**___**suffix** **(%Y%m%d-%H%M%S)**
              The  format  of  the  suffix  to  append to $maillog_file while rotating the file with
              "postfix logrotate".

       **postlog**___**service**___**name** **(postlog)**
              The name of the [**postlogd**(8)](https://www.chedong.com/phpMan.php/man/postlogd/8/markdown) service entry in master.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 multi‐
       ple 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
       Commands:
       [postalias(1)](https://www.chedong.com/phpMan.php/man/postalias/1/markdown), create/update/query alias database
       [postcat(1)](https://www.chedong.com/phpMan.php/man/postcat/1/markdown), examine Postfix queue file
       [postconf(1)](https://www.chedong.com/phpMan.php/man/postconf/1/markdown), Postfix configuration utility
       [postfix(1)](https://www.chedong.com/phpMan.php/man/postfix/1/markdown), Postfix control program
       [postfix-tls(1)](https://www.chedong.com/phpMan.php/man/postfix-tls/1/markdown), Postfix TLS management
       [postkick(1)](https://www.chedong.com/phpMan.php/man/postkick/1/markdown), trigger Postfix daemon
       [postlock(1)](https://www.chedong.com/phpMan.php/man/postlock/1/markdown), Postfix-compatible locking
       [postlog(1)](https://www.chedong.com/phpMan.php/man/postlog/1/markdown), Postfix-compatible logging
       [postmap(1)](https://www.chedong.com/phpMan.php/man/postmap/1/markdown), Postfix lookup table manager
       [postmulti(1)](https://www.chedong.com/phpMan.php/man/postmulti/1/markdown), Postfix multi-instance manager
       [postqueue(1)](https://www.chedong.com/phpMan.php/man/postqueue/1/markdown), Postfix mail queue control
       [postsuper(1)](https://www.chedong.com/phpMan.php/man/postsuper/1/markdown), Postfix housekeeping
       [mailq(1)](https://www.chedong.com/phpMan.php/man/mailq/1/markdown), Sendmail compatibility interface
       [newaliases(1)](https://www.chedong.com/phpMan.php/man/newaliases/1/markdown), Sendmail compatibility interface
       [sendmail(1)](https://www.chedong.com/phpMan.php/man/sendmail/1/markdown), Sendmail compatibility interface

       Postfix configuration:
       [bounce(5)](https://www.chedong.com/phpMan.php/man/bounce/5/markdown), Postfix bounce message templates
       [master(5)](https://www.chedong.com/phpMan.php/man/master/5/markdown), Postfix master.cf file syntax
       [postconf(5)](https://www.chedong.com/phpMan.php/man/postconf/5/markdown), Postfix main.cf file syntax
       [postfix-wrapper(5)](https://www.chedong.com/phpMan.php/man/postfix-wrapper/5/markdown), Postfix multi-instance API

       Table-driven mechanisms:
       [access(5)](https://www.chedong.com/phpMan.php/man/access/5/markdown), Postfix SMTP access control table
       [aliases(5)](https://www.chedong.com/phpMan.php/man/aliases/5/markdown), Postfix alias database
       [canonical(5)](https://www.chedong.com/phpMan.php/man/canonical/5/markdown), Postfix input address rewriting
       [generic(5)](https://www.chedong.com/phpMan.php/man/generic/5/markdown), Postfix output address rewriting
       [header_checks(5)](https://www.chedong.com/phpMan.php/man/headerchecks/5/markdown), [body_checks(5)](https://www.chedong.com/phpMan.php/man/bodychecks/5/markdown), Postfix content inspection
       [relocated(5)](https://www.chedong.com/phpMan.php/man/relocated/5/markdown), Users that have moved
       [transport(5)](https://www.chedong.com/phpMan.php/man/transport/5/markdown), Postfix routing table
       [virtual(5)](https://www.chedong.com/phpMan.php/man/virtual/5/markdown), Postfix virtual aliasing

       Table lookup mechanisms:
       [cidr_table(5)](https://www.chedong.com/phpMan.php/man/cidrtable/5/markdown), Associate CIDR pattern with value
       [ldap_table(5)](https://www.chedong.com/phpMan.php/man/ldaptable/5/markdown), Postfix LDAP client
       [lmdb_table(5)](https://www.chedong.com/phpMan.php/man/lmdbtable/5/markdown), Postfix LMDB database driver
       [memcache_table(5)](https://www.chedong.com/phpMan.php/man/memcachetable/5/markdown), Postfix memcache client
       [mysql_table(5)](https://www.chedong.com/phpMan.php/man/mysqltable/5/markdown), Postfix MYSQL client
       [nisplus_table(5)](https://www.chedong.com/phpMan.php/man/nisplustable/5/markdown), Postfix NIS+ client
       [pcre_table(5)](https://www.chedong.com/phpMan.php/man/pcretable/5/markdown), Associate PCRE pattern with value
       [pgsql_table(5)](https://www.chedong.com/phpMan.php/man/pgsqltable/5/markdown), Postfix PostgreSQL client
       [regexp_table(5)](https://www.chedong.com/phpMan.php/man/regexptable/5/markdown), Associate POSIX regexp pattern with value
       [socketmap_table(5)](https://www.chedong.com/phpMan.php/man/socketmaptable/5/markdown), Postfix socketmap client
       [sqlite_table(5)](https://www.chedong.com/phpMan.php/man/sqlitetable/5/markdown), Postfix SQLite database driver
       [tcp_table(5)](https://www.chedong.com/phpMan.php/man/tcptable/5/markdown), Postfix client-server table lookup

       Daemon processes:
       [anvil(8)](https://www.chedong.com/phpMan.php/man/anvil/8/markdown), Postfix connection/rate limiting
       [bounce(8)](https://www.chedong.com/phpMan.php/man/bounce/8/markdown), [defer(8)](https://www.chedong.com/phpMan.php/man/defer/8/markdown), [trace(8)](https://www.chedong.com/phpMan.php/man/trace/8/markdown), Delivery status reports
       [cleanup(8)](https://www.chedong.com/phpMan.php/man/cleanup/8/markdown), canonicalize and enqueue message
       [discard(8)](https://www.chedong.com/phpMan.php/man/discard/8/markdown), Postfix discard delivery agent
       [dnsblog(8)](https://www.chedong.com/phpMan.php/man/dnsblog/8/markdown), DNS allow/denylist logger
       [error(8)](https://www.chedong.com/phpMan.php/man/error/8/markdown), Postfix error delivery agent
       [flush(8)](https://www.chedong.com/phpMan.php/man/flush/8/markdown), Postfix fast ETRN service
       [local(8)](https://www.chedong.com/phpMan.php/man/local/8/markdown), Postfix local delivery agent
       [master(8)](https://www.chedong.com/phpMan.php/man/master/8/markdown), Postfix master daemon
       [oqmgr(8)](https://www.chedong.com/phpMan.php/man/oqmgr/8/markdown), old Postfix queue manager
       [pickup(8)](https://www.chedong.com/phpMan.php/man/pickup/8/markdown), Postfix local mail pickup
       [pipe(8)](https://www.chedong.com/phpMan.php/man/pipe/8/markdown), deliver mail to non-Postfix command
       [postlogd(8)](https://www.chedong.com/phpMan.php/man/postlogd/8/markdown), Postfix internal logging service
       [postscreen(8)](https://www.chedong.com/phpMan.php/man/postscreen/8/markdown), Postfix zombie blocker
       [proxymap(8)](https://www.chedong.com/phpMan.php/man/proxymap/8/markdown), Postfix lookup table proxy server
       [qmgr(8)](https://www.chedong.com/phpMan.php/man/qmgr/8/markdown), Postfix queue manager
       [qmqpd(8)](https://www.chedong.com/phpMan.php/man/qmqpd/8/markdown), Postfix QMQP server
       [scache(8)](https://www.chedong.com/phpMan.php/man/scache/8/markdown), Postfix connection cache manager
       [showq(8)](https://www.chedong.com/phpMan.php/man/showq/8/markdown), list Postfix mail queue
       [smtp(8)](https://www.chedong.com/phpMan.php/man/smtp/8/markdown), [lmtp(8)](https://www.chedong.com/phpMan.php/man/lmtp/8/markdown), Postfix SMTP+LMTP client
       [smtpd(8)](https://www.chedong.com/phpMan.php/man/smtpd/8/markdown), Postfix SMTP server
       [spawn(8)](https://www.chedong.com/phpMan.php/man/spawn/8/markdown), run non-Postfix server
       [tlsmgr(8)](https://www.chedong.com/phpMan.php/man/tlsmgr/8/markdown), Postfix TLS cache and randomness manager
       [tlsproxy(8)](https://www.chedong.com/phpMan.php/man/tlsproxy/8/markdown), Postfix TLS proxy server
       [trivial-rewrite(8)](https://www.chedong.com/phpMan.php/man/trivial-rewrite/8/markdown), Postfix address rewriting
       [verify(8)](https://www.chedong.com/phpMan.php/man/verify/8/markdown), Postfix address verification
       [virtual(8)](https://www.chedong.com/phpMan.php/man/virtual/8/markdown), Postfix virtual delivery agent

       Other:
       [syslogd(8)](https://www.chedong.com/phpMan.php/man/syslogd/8/markdown), system logging

## README FILES
       Use "**postconf** **readme**___**directory**" or "**postconf** **html**___**directory**" to locate this information.
       OVERVIEW, overview of Postfix commands and processes
       BASIC_CONFIGURATION_README, Postfix basic configuration
       ADDRESS_REWRITING_README, Postfix address rewriting
       SMTPD_ACCESS_README, SMTP relay/access control
       CONTENT_INSPECTION_README, Postfix content inspection
       QSHAPE_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



                                                                                          [POSTFIX(1)](https://www.chedong.com/phpMan.php/man/POSTFIX/1/markdown)
