Postfix Command Reference


postfix - Postfix Control Program.

Switch Description
check Warn about bad directory/file ownership or permissions, and create missing directories.
start Start the Postfix mail system. This also runs the configuration check described above.
stop Stop the Postfix mail system in an orderly fashion.
abort Stop the Postfix mail system abruptly, Running processes are stopped immediately.
flush Force delivery: attempt to deliver all deferred mail immediately.
reload Re-read configuration files. Running processes terminate at their earliest convince.
set-permissions [name=value ...] 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.
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.

​command options

Switch Description
-c config_dir Read the main.cf and master.cf configuration files in the named directory instead of the default configuration directory.
-D
(with postfix start only)
Run each Postfix daemon under control of a debugger as specified via the debugger_command configuration parameter.
-v Verbose.

postcat - View the contents of a message in the queue.

Switch Description
-o Print the que file offset of each record.
-q Search the Postfix queue for the named files.
-v Verbose.

postdrop - Drop a message into the queue, similar to "sendmail."

Switch Description
-r Use a Postfix-internal protocol for reading the message from standard input, and for reporting status information on standard output.
-v Verbose.

postqueue - Standard queue management.

Switch Description
-f Flush the queue: attempt to deliver all queued mail.
-p Produce traditional sendmail-style queue listing.ID, Size, Arrival time, Sender, Rcpt* Active queue, Hold queue
-s Schedule immediate delivery for all mail that is queued for the named site.
-v Verbose.

postsuper - In-depth queue management. (Super User)

Switch Description
-d Delete one message with the specified queue ID. (Specify ALL to remove all messages, must be caps)
-h Place specified message in the HOLD queue. (Specify ALL to place all messages on hold, must be caps)
-H Release specified message from the HOLD queue to deferred. (Specify ALL to release all messages on hold, must be caps)
-p Purge old temporary files left over after system or software crash.
-r Requeue a message with the specified ID. (Specify ALL to re-queue all messages, must be caps)
-s Structure check and repair, should be done before postfix startup.
- Renames files that have incorrect names
- Moves queue files to the right queues
-v Verbose.

postconf - Postfix Configuration Utility.

Switch Description
-a List available SASL plug-in types.
-A List available SASL client plug-in types.
-b Display the message text that appears at the beginning of a DSN.
-c Use a different config directory to read main.cf and master.cf.
-d Print default settings instead of configured settings.
-e Edit main.cf configuration file.
-h Show parameter values only not the name or label for the value.
-l List the names of supported mailbox locking methods.
-m List the supported lookup table types.
-n Print parameter settings that are not left at their built-in defaults.
-v Verbose.

postalias - Postfix alias database maintenance.

Switch Description
-c config_dir Read the main.cf configuration file in the named directory instead of the default configuration directory.
-d Search the specified maps for key and remove one entry per map. Exit 0 when data is found.
-f Do not fold the lookup key to lower case while creating or querying a table.
-i Incremental mode. Read entries from stdin and do not truncate an existing database.
-N Include the terminating null character that terminates lookup keys and values.
-n Do not include the terminating null character that terminates lookup keys and values.
-o Do not release root privileges when processing non-root input files.
-p Do not inherit the file access permissions from input file when creating new file, set to (0644).
-q Search the specified maps for key and write first value found to stdout. Exit status is 0 when data is found.
-r When updating a table do not complain about attempts to update existing entries, update them anyway.
-s Retrieve all database elements and write one line of key:value output for each element.
-v Verbose.
-w When updating a table do not complain about existing entries and ignore those attempts.

postmap - Postfix lookup table management.

Switch Description
-b Enable message body query mode. When reading lookup keys from standard input with "-q -", process the input as if it is an email message in RFC 2822 format. Each line of body content becomes one lookup key. By default, the -b option starts generating lookup keys at the first non-header line, and stops when the end of the message is reached. (See the man page for more)
-c config_dir Read the main.cf configuration file in the named directory instead of the default configuration directory.
-d Search the specified maps for key and remove one entry per map. Exit 0 when data is found.
-f Do not fold the lookup key to lower case while creating or querying a table.
-h Enable message header query mode. When reading lookup keys from standard input with "-q -", process the input as if it is an email message in RFC 2822 format. Each logical header line becomes one lookup key. A multi-line header becomes one lookup key with one or more embedded newline characters. By default, the -h option generates lookup keys until the first non-header line is reached. (See the man page for more)
-i Incremental mode. Read entries from stdin and do not truncate an existing database.
-m Include the terminating null character that terminates lookup keys and values.
-N Include the terminating null character that terminates lookup keys and values.
-n Do not include the terminating null character that terminates lookup keys and values.
-o Do not release root privileges when processing non-root input files.
-p Do not inherit the file access permissions from input file when creating new file, set to (0644).
-q Do not inherit the file access permissions from input file when creating new file, set to (0644).
-r When updating a table do not complain about attempts to update existing entries, update them anyway.
-s Retrieve all database elements and write one line of key:value output for each element.
-v Verbose.
-w When updating a table do not complain about existing entries and ignore those attempts.

qshape - Print Postfix queue by domain and age distribution

Switch Description
-s Display sender domain distribution instead of recipient distribution.
-p Generate aggregate statistics for parent domains. TLDs are not shown nor or domains with fewer than min_subdomains set with -m
-m When used with -p, sets minimum subdomain count needed to show separate line from parent. Default 5.
-b The age distribution is broken up into a sequence of increasing intervals. Sets the number of intervals or buckets.
-t The age distribution is broken up into a sequence of increasing intervals. Sets the number of intervals or buckets.
-l Instead of geometric age sequence use a linear age sequence or simple bucket times.
-w The output is right justified, with counts shown on the 80th column. This adjust the terminal width.