# Postfix Configuration Parameters

## Postfix main.cf file format

The Postfix main.cf configuration file specifies a very small subset of all the parameters that control the operation of the Postfix mail system. Parameters not explicitly specified are left at their default values.

The general format of the main.cf file is as follows:

- Each logical line is in the form "parameter = value". Whitespace around the "=" is ignored, as is whitespace at the end of a logical line.

- Empty lines and whitespace-only lines are ignored, as are lines whose first non-whitespace character is a `#'.

- A logical line starts with non-whitespace text. A line that starts with whitespace continues a logical line.

- A parameter value may refer to other parameters.

  - The expressions "$name" and "${name}" are recursively replaced with the value of the named parameter, except where noted. An undefined parameter value is replaced with the empty value.

  - The expressions "${name?value}" and "${name?{value}}" are replaced with "value" when "$name" is non-empty. These forms are supported with Postfix versions ≥ 2.2 and ≥ 3.0, respectively.

  - The expressions "${name:value}" and "${name?{value}}" are replaced with "value" when "$name" is empty. These forms are supported with Postfix versions ≥ 2.2 and ≥ 3.0, respectively.

  - The expression "${name?{value1}:{value2}}" is replaced with "value1" when "$name" is non-empty, and with "value2" when "$name" is empty. The "{}" is required for "value1", optional for "value2". This form is supported with Postfix versions ≥ 3.0.

  - The first item inside "${...}" may be a logical expression of the form: "{value3} == {value4}". Besides the "==" (equality) operator Postfix supports "!=" (inequality), "<", "≤", "≥", and ">". The comparison is numerical when both operands are all digits, otherwise the comparison is lexicographical. These forms are supported with Postfix versions ≥ 3.0.

  - Each "value" is subject to recursive named parameter and logical expression evaluation, except where noted.

  - Whitespace before or after each "{value}" is ignored.

  - Specify "$$" to produce a single "$" character.

  - The legacy form "$(...)" is equivalent to the preferred form "${...}".

- When the same parameter is defined multiple times, only the last instance is remembered.

- Otherwise, the order of main.cf parameter definitions does not matter.

The remainder of this document is a description of all Postfix configuration parameters. Default values are shown after the parameter name in parentheses, and can be looked up with the "postconf -d" command.

Note: this is not an invitation to make changes to Postfix configuration parameters. Unnecessary changes are likely to impair the operation of the mail system.