$linuxjunkies
>

postconf(1)

Display or set configuration parameters for the Postfix mail server.

UbuntuDebianFedoraArch

Synopsis

postconf [-c config_dir] [-n] [-N] [-x] [parameter ...]

Description

postconf is used to view and modify Postfix configuration parameters. It reads the main.cf and master.cf configuration files and displays parameter values, or allows you to query specific parameters without starting the Postfix daemon.

When run without arguments, postconf displays all parameters. You can specify individual parameters to view only those settings, or use -e to edit parameters directly. Changes take effect after a postfix reload.

Common options

FlagWhat it does
-c config_dirUse alternate Postfix configuration directory instead of /etc/postfix
-nShow only parameters that have been explicitly set to non-default values
-NShow only built-in defaults (parameters not set in main.cf)
-e param=valueEdit configuration parameter; updates main.cf directly
-xExpand $parameter and ${parameter} syntax in output values
-iShow expanded parameter values with variable substitution applied
-lShow long options from master.cf
-PShow Postfix parameter values in postfix -c config format
-T secondsOverride configuration parameter time unit for testing

Examples

Display all Postfix configuration parameters and their current values

postconf

Show values of specific parameters only (myhostname, mydomain, inet_interfaces)

postconf myhostname mydomain inet_interfaces

Display only parameters that differ from built-in defaults (non-default settings)

postconf -n

Set myhostname parameter and save to main.cf permanently

postconf -e 'myhostname=mail.example.com'

Set multiple parameters in one command

postconf -e 'smtpd_recipient_limit=5000' -e 'message_size_limit=50000000'

Show virtual_mailbox_domains parameter with variable expansion applied

postconf -x virtual_mailbox_domains

Query mydomain from alternate Postfix configuration directory

postconf -c /etc/postfix-backup mydomain

Show first 20 built-in default parameters (not user-configured)

postconf -N | head -20

Related commands