postconf(1)
Display or set configuration parameters for the Postfix mail server.
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
| Flag | What it does |
|---|---|
-c config_dir | Use alternate Postfix configuration directory instead of /etc/postfix |
-n | Show only parameters that have been explicitly set to non-default values |
-N | Show only built-in defaults (parameters not set in main.cf) |
-e param=value | Edit configuration parameter; updates main.cf directly |
-x | Expand $parameter and ${parameter} syntax in output values |
-i | Show expanded parameter values with variable substitution applied |
-l | Show long options from master.cf |
-P | Show Postfix parameter values in postfix -c config format |
-T seconds | Override configuration parameter time unit for testing |
Examples
Display all Postfix configuration parameters and their current values
postconfShow values of specific parameters only (myhostname, mydomain, inet_interfaces)
postconf myhostname mydomain inet_interfacesDisplay only parameters that differ from built-in defaults (non-default settings)
postconf -nSet 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_domainsQuery mydomain from alternate Postfix configuration directory
postconf -c /etc/postfix-backup mydomainShow first 20 built-in default parameters (not user-configured)
postconf -N | head -20