POSTCONF(5) | POSTCONF(5) |
postconf -e "parameter=value" ...
The general format of the main.cf file is as follows:
• | Each logical line has 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", "${name}" or "$(name)" are recursively replaced by the value of the named parameter. |
• | The expression "${name?value}" expands to "value" when "$name" is non-empty. This form is supported with Postfix version 2.2 and later. |
• | The expression "${name:value}" expands to "value" when "$name" is empty. This form is supported with Postfix version 2.2 and later. |
• | Specify "$$" to produce a single "$" character. |
• | 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 can impair the operation of the mail system.
Do not change this unless you have a complete understanding of RFC 2821.
This feature is available in Postfix 2.6 and later.
Do not change this unless you have a complete understanding of RFC 2821.
After each database cleanup run, the verify(8) daemon logs the number of entries that were retained and dropped. A cleanup run is logged as "partial" when the daemon terminates early after " postfix reload", "postfix stop", or no requests for $max_idle seconds.
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
This feature is available in Postfix 2.7.
This feature is available in Postfix 2.1 and later.
This feature is available in Postfix 2.1 and later.
The lookup table is persistent by default (Postfix 2.7 and later). Specify an empty table name to keep the information in volatile memory which is lost after " postfix reload" or "postfix stop". This is the default with Postfix version 2.6 and earlier.
Specify a location in a file system that will not fill up. If the database becomes corrupted, the world comes to an end. To recover delete (NOT: truncate) the file and do " postfix reload".
Postfix daemon processes do not use root privileges when opening this file (Postfix 2.5 and later). The file must therefore be stored under a Postfix-owned directory such as the data_directory. As a migration aid, an attempt to open the file under a non-Postfix directory is redirected to the Postfix-owned data_directory, and a warning is logged.
Examples:
address_verify_map = hash:/var/db/postfix/verify
address_verify_map = btree:/var/db/postfix/verify
This feature is available in Postfix 2.1 and later.
This feature is available in Postfix 2.1 and later.
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
This feature is available in Postfix 2.1 and later.
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
This feature is available in Postfix 2.1 and later.
By default, the Postfix SMTP server polls the verify(8) service up to three times under non-overload conditions, and only once when under overload. With Postfix version 2.5 and earlier, the SMTP server always polls the verify(8) service up to three times by default.
Specify 1 to implement a crude form of greylisting, that is, always defer the first delivery request for a new address.
Examples:
# Postfix <= 2.6 default
address_verify_poll_count = 3
# Poor man's greylisting
address_verify_poll_count = 1
This feature is available in Postfix 2.1 and later.
The default polling delay is 3 seconds.
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
This feature is available in Postfix 2.1 and later.
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
This feature is available in Postfix 2.1 and later.
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
This feature is available in Postfix 2.1 and later.
This feature is available in Postfix 2.1 and later.
This feature is available in Postfix 2.1 and later.
Specify an empty value (address_verify_sender =) or <> if you want to use the null sender address. Beware, some sites reject mail from <>, even though RFCs require that such addresses be accepted.
Examples:
address_verify_sender = <>
address_verify_sender = postmaster@my.domain
This feature is available in Postfix 2.1 and later.
This feature is available in Postfix 2.7 and later.
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.1 and later.
This feature is available in Postfix 2.1 and later.
This is a separate configuration parameter because not all the tables specified with $alias_maps have to be local files.
Examples:
alias_database = hash:/etc/aliases
alias_database = hash:/etc/mail/aliases
The default list is system dependent. On systems with NIS, the default is to search the local alias database, then the NIS alias database.
If you change the alias database, run "postalias /etc/aliases" (or wherever your system stores the mail alias file), or simply run " newaliases" to build the necessary DBM or DB file.
The local(8) delivery agent disallows regular expression substitution of $1 etc. in alias_maps, because that would open a security hole.
The local(8) delivery agent will silently ignore requests to use the proxymap(8) server within alias_maps. Instead it will open the table directly. Before Postfix version 2.2, the local(8) delivery agent will terminate with a fatal error.
Examples:
alias_maps = hash:/etc/aliases, nis:mail.aliases
alias_maps = hash:/etc/aliases
Specify zero or more of: alias, forward or include, in order to allow commands in aliases(5), .forward files or in :include: files, respectively.
Example:
allow_mail_to_commands = alias,forward,include
Specify zero or more of: alias, forward or include, in order to allow "/file/name" destinations in aliases(5), .forward files and in :include: files, respectively.
Example:
allow_mail_to_files = alias,forward,include
As of Postfix version 2.5, this feature is implemented by trivial-rewrite(8). With earlier versions this feature was implemented by qmgr(8) and was limited to recipient addresses only.
Note: with Postfix version 2.2, message header address rewriting happens only when one of the following conditions is true:
• | The message is received with the Postfix sendmail(1) command, |
• | The message is received from a network client that matches $local_header_rewrite_clients, |
• | The message is received from the network, and the remote_header_rewrite_domain parameter specifies a non-empty value. |
To get the behavior before Postfix version 2.2, specify "local_header_rewrite_clients = static:all".
Example:
allow_percent_hack = no
By default, this feature is turned off. This closes a nasty open relay loophole where a backup MX host can be tricked into forwarding junk mail to a primary MX host which then spams it out to the world.
This parameter also controls if non-local addresses with sender-specified routing can match Postfix access tables. By default, such addresses cannot match Postfix access tables, because the address is ambiguous.
This list must be specified in the default Postfix configuration directory, and is used by set-gid Postfix commands such as postqueue(1) and postdrop(1).
Note: if mail to the BCC address bounces it will be returned to the sender.
Note: automatic BCC recipients are produced only for new mail. To avoid mailer loops, automatic BCC recipients are not generated after Postfix forwards mail internally, or after Postfix generates mail itself.
This feature is implemented by the anvil(8) service which is available in Postfix version 2.2 and later.
The default interval is relatively short. Because of the high frequency of updates, the anvil(8) server uses volatile memory only. Thus, information is lost whenever the process terminates.
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is s (seconds).
This feature is available in Postfix 2.2 and later.
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is s (seconds).
Note 1: this feature is enabled by default and must not be turned off. Postfix does not support domain-less addresses.
Note 2: with Postfix version 2.2, message header address rewriting happens only when one of the following conditions is true:
• | The message is received with the Postfix sendmail(1) command, |
• | The message is received from a network client that matches $local_header_rewrite_clients, |
• | The message is received from the network, and the remote_header_rewrite_domain parameter specifies a non-empty value. |
To get the behavior before Postfix version 2.2, specify "local_header_rewrite_clients = static:all".
Note 1: this feature is enabled by default. If disabled, users will not be able to send mail to "user@partialdomainname" but will have to specify full domain names instead.
Note 2: with Postfix version 2.2, message header address rewriting happens only when one of the following conditions is true:
• | The message is received with the Postfix sendmail(1) command, |
• | The message is received from a network client that matches $local_header_rewrite_clients, |
• | The message is received from the network, and the remote_header_rewrite_domain parameter specifies a non-empty value. |
To get the behavior before Postfix version 2.2, specify "local_header_rewrite_clients = static:all".
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is s (seconds).
This feature is available in Postfix 2.1 and later.
By default, all users are allowed to flush the queue. Access is always granted if the invoking user is the super-user or the $mail_owner user. Otherwise, the real UID of the process is looked up in the system password file, and access is granted only if the corresponding login name is on the access list. The username "unknown" is used for processes whose real UID is not found in the password file.
Specify a list of user names, "/file/name" or "type:table" patterns, separated by commas and/or whitespace. The list is matched left to right, and the search stops on the first match. A "/file/name" pattern is replaced by its contents; a "type:table" lookup table is matched when a name matches a lookup key (the lookup result is ignored). Continue long lines by starting the next line with whitespace. Specify "!pattern" to exclude a name from the list. The form "!/file/name" is supported only in Postfix version 2.4 and later.
This feature is available in Postfix 2.2 and later.
By default, all users are allowed to view the queue. Access is always granted if the invoking user is the super-user or the $mail_owner user. Otherwise, the real UID of the process is looked up in the system password file, and access is granted only if the corresponding login name is on the access list. The username "unknown" is used for processes whose real UID is not found in the password file.
Specify a list of user names, "/file/name" or "type:table" patterns, separated by commas and/or whitespace. The list is matched left to right, and the search stops on the first match. A "/file/name" pattern is replaced by its contents; a "type:table" lookup table is matched when a name matches a lookup key (the lookup result is ignored). Continue long lines by starting the next line with whitespace. Specify "!pattern" to exclude a user name from the list. The form "!/file/name" is supported only in Postfix version 2.4 and later.
This feature is available in Postfix 2.2 and later.
By default, all users are allowed to submit mail. Otherwise, the real UID of the process is looked up in the system password file, and access is granted only if the corresponding login name is on the access list. The username "unknown" is used for processes whose real UID is not found in the password file. To deny mail submission access to all users specify an empty list.
Specify a list of user names, "/file/name" or "type:table" patterns, separated by commas and/or whitespace. The list is matched left to right, and the search stops on the first match. A "/file/name" pattern is replaced by its contents; a "type:table" lookup table is matched when a name matches a lookup key (the lookup result is ignored). Continue long lines by starting the next line with whitespace. Specify "!pattern" to exclude a user name from the list. The form "!/file/name" is supported only in Postfix version 2.4 and later.
Example:
authorized_submit_users = !www, static:all
This feature is available in Postfix 2.2 and later.
By default, only trusted clients are allowed to specify XVERP.
This parameter was introduced with Postfix version 1.1. Postfix version 2.1 renamed this parameter to smtpd_authorized_verp_clients and changed the default to none.
Specify a list of network/netmask patterns, separated by commas and/or whitespace. The mask specifies the number of bits in the network part of a host address. You can also specify hostnames or .domain names (the initial dot causes the domain to match any name below it), "/file/name" or "type:table" patterns. A "/file/name" pattern is replaced by its contents; a "type:table" lookup table is matched when a table entry matches a lookup string (the lookup result is ignored). Continue long lines by starting the next line with whitespace. Specify "!pattern" to exclude an address or network block from the list. The form "!/file/name" is supported only in Postfix version 2.4 and later.
Note: IP version 6 address information must be specified inside [] in the authorized_verp_clients value, and in files specified with "/file/name". IP version 6 addresses contain the ":" character, and would otherwise be confused with a "type:table" pattern.
This feature is available in Postfix 2.1 and later.
This feature is available in Postfix 2.0 and later.
This feature is available in Postfix 2.0 and later.
Specify, for example, "best_mx_transport = local" to pass the mail from the Postfix SMTP client to the local(8) delivery agent. You can specify any message delivery "transport" or "transport:nexthop" that is defined in the master.cf file. See the transport(5) manual page for the syntax and meaning of "transport" or "transport:nexthop".
However, this feature is expensive because it ties up a Postfix SMTP client process while the local(8) delivery agent is doing its work. It is more efficient (for Postfix) to list all hosted domains in a table or database.
For compatibility reasons this feature is on by default. On systems with lots of interactive users, the biff service can be a performance drain. Specify "biff = no" in main.cf to disable.
Note: with Postfix versions before 2.0, these rules inspect all content after the primary message headers.
This feature is available in Postfix 2.0 and later.
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is d (days).
Specify 0 when mail delivery should be tried only once.
This feature is available in Postfix 2.1 and later.
This feature is available in Postfix 2.0 and later.
Notes:
• | If you increase this limit, then you should increase the mime_nesting_limit value proportionally. |
• | Be careful when making changes. Excessively large values will result in the loss of non-delivery notifications, when a bounce message size exceeds a local or remote MTA's message size limit. |
Template message body text may contain $name references to Postfix configuration parameters. The result of $name expansion can be previewed with " postconf -b file_name" before the file is placed into the Postfix configuration directory.
This feature is available in Postfix 2.3 and later.
Specify "broken_sasl_auth_clients = yes" to have Postfix advertise AUTH support in a non-standard way.
Specify one or more of: envelope_sender, envelope_recipient, header_sender, header_recipient
This feature is available in Postfix 2.2 and later.
If you use this feature, run "postmap /etc/postfix/canonical" to build the necessary DBM or DB file after every change. The changes will become visible after a minute or so. Use " postfix reload" to eliminate the delay.
Note: with Postfix version 2.2, message header address mapping happens only when message header address rewriting is enabled:
• | The message is received with the Postfix sendmail(1) command, |
• | The message is received from a network client that matches $local_header_rewrite_clients, |
• | The message is received from the network, and the remote_header_rewrite_domain parameter specifies a non-empty value. |
To get the behavior before Postfix version 2.2, specify "local_header_rewrite_clients = static:all".
Examples:
canonical_maps = dbm:/etc/postfix/canonical
canonical_maps = hash:/etc/postfix/canonical
This feature is available in Postfix 2.0 and later.
The following $name expansions are done on command_execution_directory before the directory is changed. Expansion happens in the context of the delivery request. The result of $name expansion is filtered with the character set that is specified with the execution_directory_expansion_filter parameter.
$user | The recipient's username. |
$shell | The recipient's login shell pathname. |
$home | The recipient's home directory. |
$recipient | The full recipient address. |
$extension | The optional recipient address extension. |
$domain | The recipient domain. |
$local | The entire recipient localpart. |
$recipient_delimiter | The system-wide recipient address extension delimiter. |
${name?value} | Expands to value when $name is non-empty. |
${name:value} | Expands to value when $name is empty. |
Instead of $name you can also specify ${name} or $(name).
This feature is available in Postfix 2.2 and later.
Note: if you set this time limit to a large value you must update the global ipc_timeout parameter as well.
• | The MAIL_CONFIG environment variable (daemon processes and commands). |
• | The "-c" command-line option (commands only). |
With Postfix command that run with set-gid privileges, a config_directory override requires either root privileges, or it requires that the directory is listed with the alternate_config_directories parameter in the default main.cf file.
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.2 and later.
Notes:
• | This setting has lower precedence than a FILTER action that is specified in an access(5), header_checks(5) or body_checks(5) table. |
• | The meaning of an empty next-hop filter destination is version dependent. Postfix 2.7 and later will use the recipient domain; earlier versions will use $myhostname. Specify "default_filter_nexthop = $myhostname" for compatibility with Postfix 2.6 or earlier, or specify a content_filter value with an explicit next-hop destination. |
This feature is available in Postfix 2.5 and later when compiled with Cyrus SASL 2.1.22 or later.
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is s (seconds).
This feature is available in Postfix 2.5 and later.
Specify domain names, network/netmask patterns, "/file/name" patterns or "type:table" lookup tables. The right-hand side result from "type:table" lookups is ignored.
Pattern matching of domain names is controlled by the parent_domain_matches_subdomains parameter.
Examples:
debug_peer_list = 127.0.0.1
debug_peer_list = example.com
Use "command .. & sleep 5" so that the debugger can attach before the process marches on. If you use an X-based debugger, be sure to set up your XAUTHORITY environment variable before starting Postfix.
Example:
debugger_command =
PATH=/usr/bin:/usr/X11R6/bin
ddd $daemon_directory/$process_name $process_id & sleep 5
Examples:
default_database_type = hash
default_database_type = dbm
Each transport maintains a so-called "available delivery slot counter" for each message. One message can be preempted by another one when the other message can be delivered using no more delivery slots (i.e., invocations of delivery agents) than the current message counter has accumulated (or will eventually accumulate - see about slot loans below). This parameter controls how often is the counter incremented - it happens after each default_delivery_slot_cost recipients have been delivered.
The cost of 0 is used to disable the preempting scheduling completely. The minimum value the scheduling algorithm can use is 2 - use it if you want to maximize the message throughput rate. Although there is no maximum, it doesn't make much sense to use values above say 50.
The only reason why the value of 2 is not the default is the way this parameter affects the delivery of mailing-list mail. In the worst case, their delivery can take somewhere between (cost+1/cost) and (cost/cost-1) times more than if the preemptive scheduler was disabled. The default value of 5 turns out to provide reasonable message response times while making sure the mailing-list deliveries are not extended by more than 20-25 percent even in the worst case.
Use transport_delivery_slot_cost to specify a transport-specific override, where transport is the master.cf name of the message delivery transport.
Examples:
default_delivery_slot_cost = 0
default_delivery_slot_cost = 2
This parameter speeds up the moment when a message preemption can happen. Instead of waiting until the full amount of delivery slots required is available, the preemption can happen when transport_delivery_slot_discount percent of the required amount plus transport_delivery_slot_loan still remains to be accumulated. Note that the full amount will still have to be accumulated before another preemption can take place later.
Use transport_delivery_slot_discount to specify a transport-specific override, where transport is the master.cf name of the message delivery transport.
This parameter speeds up the moment when a message preemption can happen. Instead of waiting until the full amount of delivery slots required is available, the preemption can happen when transport_delivery_slot_discount percent of the required amount plus transport_delivery_slot_loan still remains to be accumulated. Note that the full amount will still have to be accumulated before another preemption can take place later.
Use transport_delivery_slot_loan to specify a transport-specific override, where transport is the master.cf name of the message delivery transport.
A pseudo-cohort is the number of deliveries equal to a destination's delivery concurrency.
Use transport_destination_concurrency_failed_cohort_limit to specify a transport-specific override, where transport is the master.cf name of the message delivery transport.
This feature is available in Postfix 2.5. The default setting is compatible with earlier Postfix versions.
Use transport_destination_concurrency_limit to specify a transport-specific override, where transport is the master.cf name of the message delivery transport.
As of Postfix version 2.5, negative feedback cannot reduce delivery concurrency to zero. Instead, a destination is marked dead (further delivery suspended) after the failed pseudo-cohort count reaches $default_destination_concurrency_failed_cohort_limit (or $ transport_destination_concurrency_failed_cohort_limit). To make the scheduler completely immune to connection or handshake failures, specify a zero feedback value and a zero failed pseudo-cohort limit.
Specify one of the following forms:
number |
number / number | Constant feedback. The value must be in the range 0..1 inclusive. The default setting of "1" is compatible with Postfix versions before 2.5, where a destination's delivery concurrency is throttled down to zero (and further delivery suspended) after a single failed pseudo-cohort. |
number / concurrency | Variable feedback of "number / (delivery concurrency)". The number must be in the range 0..1 inclusive. With number equal to "1", a destination's delivery concurrency is decremented by 1 after each failed pseudo-cohort. |
A pseudo-cohort is the number of deliveries equal to a destination's delivery concurrency.
Use transport_destination_concurrency_negative_feedback to specify a transport-specific override, where transport is the master.cf name of the message delivery transport.
This feature is available in Postfix 2.5. The default setting is compatible with earlier Postfix versions.
Specify one of the following forms:
number |
number / number | Constant feedback. The value must be in the range 0..1 inclusive. The default setting of "1" is compatible with Postfix versions before 2.5, where a destination's delivery concurrency doubles after each successful pseudo-cohort. |
number / concurrency | Variable feedback of "number / (delivery concurrency)". The number must be in the range 0..1 inclusive. With number equal to "1", a destination's delivery concurrency is incremented by 1 after each successful pseudo-cohort. |
A pseudo-cohort is the number of deliveries equal to a destination's delivery concurrency.
Use transport_destination_concurrency_positive_feedback to specify a transport-specific override, where transport is the master.cf name of the message delivery transport.
This feature is available in Postfix 2.5 and later.
To enable the delay, specify a non-zero time value (an integral value plus an optional one-letter suffix that specifies the time unit).
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is s (seconds).
NOTE: the delay is enforced by the queue manager. The delay timer state does not survive " postfix reload" or "postfix stop".
Use transport_destination_rate_delay to specify a transport-specific override, where transport is the master.cf name of the message delivery transport.
NOTE: with a non-zero _destination_rate_delay, specify a transport_destination_concurrency_failed_cohort_limit of 10 or more to prevent Postfix from deferring all mail for the same destination after only one connection or handshake error.
This feature is available in Postfix 2.5 and later.
Setting this parameter to a value of 1 changes the meaning of the corresponding per-destination concurrency limit from concurrency per domain into concurrency per recipient.
Use transport_destination_recipient_limit to specify a transport-specific override, where transport is the master.cf name of the message delivery transport.
Use transport_extra_recipient_limit to specify a transport-specific override, where transport is the master.cf name of the message delivery transport.
This feature is available in Postfix 2.7 and later.
Use transport_minimum_delivery_slots to specify a transport-specific override, where transport is the master.cf name of the message delivery transport.
This feature is available in Postfix 2.0 and later.
The template is subject to exactly one level of $name substitution:
$client | The client hostname and IP address, formatted as name[address]. |
$client_address | The client IP address. |
$client_name | The client hostname or "unknown". See reject_unknown_client_hostname for more details. |
$reverse_client_name | The client hostname from address->name lookup, or "unknown". See reject_unknown_reverse_client_hostname for more details. |
$helo_name | The hostname given in HELO or EHLO command or empty string. |
$rbl_class | The blacklisted entity type: Client host, Helo command, Sender address, or Recipient address. |
$rbl_code | The numerical SMTP response code, as specified with the maps_rbl_reject_code configuration parameter. Note: The numerical SMTP response code is required, and must appear at the start of the reply. With Postfix version 2.3 and later this information may be followed by an RFC 3463 enhanced status code. |
$rbl_domain | The RBL domain where $rbl_what is blacklisted. |
$rbl_reason | The reason why $rbl_what is blacklisted, or an empty string. |
$rbl_what | The entity that is blacklisted (an IP address, a hostname, a domain name, or an email address whose domain was blacklisted). |
$recipient | The recipient address or <> in case of the null address. |
$recipient_domain | The recipient domain or empty string. |
$recipient_name | The recipient address localpart or <> in case of null address. |
$sender | The sender address or <> in case of the null address. |
$sender_domain | The sender domain or empty string. |
$sender_name | The sender address localpart or <> in case of the null address. |
${name?text} | Expands to `text' if $name is not empty. |
${name:text} | Expands to `text' if $name is empty. |
Instead of $name you can also specify ${name} or $(name).
Note: when an enhanced status code is specified in an RBL reply template, it is subject to modification. The following transformations are needed when the same RBL reply template is used for client, helo, sender, or recipient access restrictions.
• | When rejecting a sender address, the Postfix SMTP server will transform a recipient DSN status (e.g., 4.1.1-4.1.6) into the corresponding sender DSN status, and vice versa. |
• | When rejecting non-address information (such as the HELO command argument or the client hostname/address), the Postfix SMTP server will transform a sender or recipient DSN status into a generic non-address DSN status (e.g., 4.0.0). |
Use transport_recipient_limit to specify a transport-specific override, where transport is the master.cf name of the message delivery transport.
Use transport_recipient_refill_delay to specify a transport-specific override, where transport is the master.cf name of the message delivery transport.
This feature is available in Postfix 2.4 and later.
Use transport_recipient_refill_limit to specify a transport-specific override, where transport is the master.cf name of the message delivery transport.
This feature is available in Postfix 2.4 and later.
In order of decreasing precedence, the nexthop destination is taken from $sender_dependent_default_transport_maps, $default_transport, $sender_dependent_relayhost_maps, $relayhost, or from the recipient domain.
Specify a string of the form transport:nexthop, where transport is the name of a mail delivery transport defined in master.cf. The :nexthop destination is optional; its syntax is documented in the manual page of the corresponding delivery agent.
Example:
default_transport = uucp:relayhostname
This feature is available in Postfix 1.1 and later.
Do not change this unless you have a complete understanding of RFC 2821.
This feature is available in Postfix 2.0 and later.
Example:
defer_transports = smtp
Large delay values are rounded off to an integral number seconds; delay values below the delay_logging_resolution_limit are logged as "0", and small delay values are logged with at most two-digit precision.
The format of the "delays=a/b/c/d" logging is as follows:
• | a = time from message arrival to last active queue entry |
• | b = time from last active queue entry to connection setup |
• | c = time in connection setup, including DNS, EHLO and STARTTLS |
• | d = time in message transmission |
This feature is available in Postfix 2.3 and later.
This feature is enabled with the delay_warning_time parameter.
To enable this feature, specify a non-zero time value (an integral value plus an optional one-letter suffix that specifies the time unit).
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is h (hours).
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is s (seconds).
This feature is available in Postfix 2.5 and later.
This feature is available in Postfix 2.5 and later.
DNS lookups are enabled by default.
This feature is available in Postfix 2.0 and later.
Mime input processing is enabled by default, and is needed in order to recognize MIME headers in message content.
This feature is available in Postfix 2.0 and later.
The default, one per recipient, is what ezmlm needs.
This feature is available in Postfix 1.1 and later.
Example:
disable_vrfy_command = no
This feature is available in Postfix 2.8.
This feature is available in Postfix 2.8 and later.
This feature is available in Postfix 2.7 and later.
This feature is available in Postfix 2.5 and later. With earlier versions, sender_dependent_relayhost_maps lookups were skipped for the null sender address.
When this parameter is set to yes, the cleanup(8) daemon performs duplicate elimination on distinct pairs of (original recipient, rewritten recipient), and generates non-empty original recipient queue file records.
When this parameter is set to no, the cleanup(8) daemon performs duplicate elimination on the rewritten recipient address only, and generates empty original recipient queue file records.
This feature is available in Postfix 2.1 and later. With Postfix version 2.0, support for the X-Original-To message header is always turned on. Postfix versions before 2.0 have no support for the X-Original-To message header.
This feature is available in Postfix 2.0 and later.
This feature is available in Postfix 2.2 and later.
Specify a list of names and/or name=value pairs, separated by whitespace or comma. The name=value form is supported with Postfix version 2.1 and later.
Example:
export_environment = TZ PATH=/bin:/usr/bin
This feature was removed in Postfix version 2.1.
By default, mail is returned to the sender when a destination is not found, and delivery is deferred when a destination is unreachable.
The fallback relays must be SMTP destinations. Specify a domain, host, host:port, [host]:port, [address] or [address]:port; the form [host] turns off MX lookups. If you specify multiple SMTP destinations, Postfix will try them in the specified order.
Note: before Postfix 2.2, do not use the fallback_relay feature when relaying mail for a backup or primary MX domain. Mail would loop between the Postfix MX host and the fallback_relay host when the final destination is unavailable.
• | In main.cf specify "relay_transport = relay", |
• | In master.cf specify "-o fallback_relay =" (i.e., empty) at the end of the relay entry. |
• | In transport maps, specify "relay:nexthop..." as the right-hand side for backup or primary MX domain entries. |
Postfix version 2.2 and later will not use the fallback_relay feature for destinations that it is MX host for.
The precedence of local(8) delivery features from high to low is: aliases, .forward files, mailbox_transport_maps, mailbox_transport, mailbox_command_maps, mailbox_command, home_mailbox, mail_spool_directory, fallback_transport_maps, fallback_transport and luser_relay.
The precedence of local(8) delivery features from high to low is: aliases, .forward files, mailbox_transport_maps, mailbox_transport, mailbox_command_maps, mailbox_command, home_mailbox, mail_spool_directory, fallback_transport_maps, fallback_transport and luser_relay.
For safety reasons, this feature does not allow $number substitutions in regular expression maps.
This feature is available in Postfix 2.3 and later.
By default, Postfix maintains "fast flush" logfiles only for destinations that the Postfix SMTP server is willing to relay to (i.e. the default is: "fast_flush_domains = $relay_domains"; see the relay_domains parameter in the postconf(5) manual).
Specify a list of hosts or domains, "/file/name" patterns or "type:table" lookup tables, separated by commas and/or whitespace. Continue long lines by starting the next line with whitespace. A "/file/name" pattern is replaced by its contents; a "type:table" lookup table is matched when the domain or its parent domain appears as lookup key.
Specify "fast_flush_domains =" (i.e., empty) to disable the feature altogether.
You can specify the time as a number, or as a number followed by a letter that indicates the time unit: s=seconds, m=minutes, h=hours, d=days, w=weeks. The default time unit is days.
You can specify the time as a number, or as a number followed by a letter that indicates the time unit: s=seconds, m=minutes, h=hours, d=days, w=weeks. The default time unit is hours.
This feature is available in Postfix 2.0 and later.
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is s (seconds).
The following $name expansions are done on forward_path before the search actually happens. The result of $name expansion is filtered with the character set that is specified with the forward_expansion_filter parameter.
$user | The recipient's username. |
$shell | The recipient's login shell pathname. |
$home | The recipient's home directory. |
$recipient | The full recipient address. |
$extension | The optional recipient address extension. |
$domain | The recipient domain. |
$local | The entire recipient localpart. |
$recipient_delimiter | The system-wide recipient address extension delimiter. |
${name?value} | Expands to value when $name is non-empty. |
${name:value} | Expands to value when $name is empty. |
Instead of $name you can also specify ${name} or $(name).
Examples:
forward_path = /var/forward/$user
forward_path =
/var/forward/$user/.forward$recipient_delimiter$extension,
/var/forward/$user/.forward
This feature is available in Postfix 2.3 and later. With older Postfix releases, the behavior is as if this parameter is set to "no". The old setting can be expensive with deeply nested aliases or .forward files. When an alias or .forward file changes the Delivered-To: address, it ties up one queue file and one cleanup process instance while mail is being forwarded.
After changing the hash_queue_names or hash_queue_depth parameter, execute the command " postfix reload".
Before Postfix version 2.2, the default list of hashed queues was significantly larger. Claims about improvements in file system technology suggest that hashing of the incoming and active queues is no longer needed. Fewer hashed directories speed up the time needed to restart Postfix.
After changing the hash_queue_names or hash_queue_depth parameter, execute the command " postfix reload".
This feature is available in Postfix 2.0 and later.
Specify a pathname ending in "/" for qmail-style delivery.
The precedence of local(8) delivery features from high to low is: aliases, .forward files, mailbox_transport_maps, mailbox_transport, mailbox_command_maps, mailbox_command, home_mailbox, mail_spool_directory, fallback_transport_maps, fallback_transport and luser_relay.
Examples:
home_mailbox = Mailbox
home_mailbox = Maildir/
Specify "ignore_mx_lookup_error = yes" to force a DNS A record lookup instead. This violates the SMTP standard and can result in mis-delivery of mail.
TZ | Needed for sane time keeping on most System-V-ish systems. |
DISPLAY | Needed for debugging Postfix daemons with an X-windows debugger. |
XAUTHORITY | Needed for debugging Postfix daemons with an X-windows debugger. |
MAIL_CONFIG | Needed to make "postfix -c" work. |
Specify a list of names and/or name=value pairs, separated by whitespace or comma. The name=value form is supported with Postfix version 2.1 and later.
With the default 100 SMTP server process limit, "in_flow_delay = 1s" limits the mail inflow to 100 messages per second above the number of messages delivered per second.
Specify 0 to disable the feature. Valid delays are 0..10.
Note 1: you need to stop and start Postfix when this parameter changes.
Note 2: address information may be enclosed inside [], but this form is not required here.
When inet_interfaces specifies just one IPv4 and/or IPv6 address that is not a loopback address, the Postfix SMTP client will use this address as the IP source address for outbound mail. Support for IPv6 is available in Postfix version 2.2 and later.
On a multi-homed firewall with separate Postfix instances listening on the "inside" and "outside" interfaces, this can prevent each instance from being able to reach servers on the "other side" of the firewall. Setting smtp_bind_address to 0.0.0.0 avoids the potential problem for IPv4, and setting smtp_bind_address6 to :: solves the problem for IPv6.
A better solution for multi-homed firewalls is to leave inet_interfaces at the default value and instead use explicit IP addresses in the master.cf SMTP server definitions. This preserves the Postfix SMTP client's loop detection, by ensuring that each side of the firewall knows that the other IP address is still the same host. Setting $inet_interfaces to a single IPv4 and/or IPV6 address is primarily useful with virtual hosting of domains on secondary IP addresses, when each IP address serves a different domain (and has a different $myhostname setting).
See also the proxy_interfaces parameter, for network addresses that are forwarded to Postfix by way of a proxy or address translator.
Examples:
inet_interfaces = all (DEFAULT)
inet_interfaces = loopback-only (Postfix version 2.2 and later)
inet_interfaces = 127.0.0.1
inet_interfaces = 127.0.0.1, [::1] (Postfix version 2.2 and later)
inet_interfaces = 192.168.1.2, 127.0.0.1
This feature is available in Postfix 2.2 and later.
Note: you MUST stop and start Postfix after changing this parameter.
On systems that pre-date IPV6_V6ONLY support (RFC 3493), an IPv6 server will also accept IPv4 connections, even when IPv4 is turned off with the inet_protocols parameter. On systems with IPV6_V6ONLY support, Postfix will use separate server sockets for IPv6 and IPv4, and each will accept only connections for the corresponding protocol.
When IPv4 support is enabled via the inet_protocols parameter, Postfix will to DNS type A record lookups, and will convert IPv4-in-IPv6 client IP addresses (::ffff:1.2.3.4) to their original IPv4 form (1.2.3.4). The latter is needed on hosts that pre-date IPV6_V6ONLY support (RFC 3493).
When IPv6 support is enabled via the inet_protocols parameter, Postfix will do DNS type AAAA record lookups.
When both IPv4 and IPv6 support are enabled, the Postfix SMTP client will attempt to connect via IPv6 before attempting to use IPv4.
Examples:
inet_protocols = ipv4 (DEFAULT)
inet_protocols = all
inet_protocols = ipv6
inet_protocols = ipv4, ipv6
Use transport_initial_destination_concurrency to specify a transport-specific override, where transport is the master.cf name of the message delivery transport (Postfix 2.5 and later).
Warning: with concurrency of 1, one bad message can be enough to block all mail to a site.
bounce | Inspect the content of delivery status notifications. |
notify | Inspect the content of postmaster notifications by the smtp(8) and smtpd(8) processes. |
NOTE: It's generally not safe to enable content inspection of Postfix-generated email messages. The user is warned.
This feature is available in Postfix 2.3 and later.
Do not change this unless you have a complete understanding of RFC 2821.
With Postfix 2.4 the default value was reduced from 100s to 5s.
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is s (seconds).
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is s (seconds).
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is s (seconds).
This feature is available in Postfix 2.1 and later.
This feature is available in Postfix 2.8 and later.
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.5 and later.
This parameter is available in Postfix version 2.2 and earlier. With Postfix version 2.3 and later, see lmtp_connection_cache_on_demand, lmtp_connection_cache_destinations, or lmtp_connection_reuse_time_limit.
The effectiveness of cached connections will be determined by the number of LMTP servers in use, and the concurrency limit specified for the LMTP client. Cached connections are closed under any of the following conditions:
• | The LMTP client idle time limit is reached. This limit is specified with the Postfix max_idle configuration parameter. |
• | A delivery request specifies a different destination than the one currently cached. |
• | The per-process limit on the number of delivery requests is reached. This limit is specified with the Postfix max_use configuration parameter. |
• | Upon the onset of another delivery request, the LMTP server associated with the current session does not respond to the RSET command. |
Most of these limitations will be removed after Postfix implements a connection cache that is shared among multiple LMTP client programs.
This feature is available in Postfix 2.3 and later.
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is s (seconds).
Example:
lmtp_connect_timeout = 30s
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.3 and later.
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is s (seconds).
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is s (seconds).
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is s (seconds).
This feature is available in Postfix 2.3 and later.
Setting this parameter to a value of 1 changes the meaning of lmtp_destination_concurrency_limit from concurrency per domain into concurrency per recipient.
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.3 and later.
Notes:
• | Specify the silent-discard pseudo keyword to prevent this action from being logged. |
• | Use the lmtp_discard_lhlo_keyword_address_maps feature to discard LHLO keywords selectively. |
This feature is available in Postfix 2.8 and later.
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.5 and later.
This feature is available in Postfix 2.3 and later.
The default value is the machine hostname. Specify a hostname or [ip.add.re.ss].
This information can be specified in the main.cf file for all LMTP clients, or it can be specified in the master.cf file for a specific client, for example:
This feature is available in Postfix 2.3 and later.
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is s (seconds).
This feature is available in Postfix 2.3 and later.
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is s (seconds).
This feature is available in Postfix 2.5 and later.
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.5 and later.
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.4 and later.
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.4 and later.
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is s (seconds).
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.3 and later.
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is s (seconds).
This feature is available in Postfix 2.7 and later.
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is s (seconds).
This feature is available in Postfix 2.5 and later.
This feature is available in Postfix 2.5 and later.
This feature is available in Postfix 2.5 and later.
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.3 and later.
The following security features are defined for the cyrus client SASL implementation:
noplaintext | Disallow authentication methods that use plaintext passwords. |
noactive | Disallow authentication methods that are vulnerable to non-dictionary active attacks. |
nodictionary | Disallow authentication methods that are vulnerable to passive dictionary attack. |
noanonymous | Disallow anonymous logins. |
Example:
lmtp_sasl_security_options = noplaintext
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.1 and later.
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.7 and later.
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.6 and later.
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.6 and later, when Postfix is compiled and linked with OpenSSL 1.0.0 or later.
This feature is available in Postfix 2.6 and later, when Postfix is compiled and linked with OpenSSL 1.0.0 or later.
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.5 and later.
This feature is available in Postfix 2.5 and later.
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.6 and later.
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.3 and later.
In case of problems the client does NOT try the next address on the mail exchanger list.
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is s (seconds).
This feature is available in Postfix 2.1 and later.
"sendmail's restricted shell" (smrsh) is what most people will use in order to restrict what programs can be run from e.g. .forward files (smrsh is part of the Sendmail distribution).
Note: when a shell program is specified, it is invoked even when the command contains no shell built-in commands or meta characters.
Example:
local_command_shell = /some/where/smrsh -c
local_command_shell = /bin/bash -c
A low limit of 2 is recommended, just in case someone has an expensive shell command in a .forward file or in an alias (e.g., a mailing list manager). You don't want to run lots of those at the same time.
Setting this parameter to a value > 1 changes the meaning of local_destination_concurrency_limit from concurrency per recipient into concurrency per domain.
See the append_at_myorigin and append_dot_mydomain parameters for details of how domain names are appended to incomplete addresses.
Specify a list of zero or more of the following:
permit_inet_interfaces | Append the domain name in $myorigin or $mydomain when the client IP address matches $inet_interfaces. This is enabled by default. |
permit_mynetworks | Append the domain name in $myorigin or $mydomain when the client IP address matches any network or network address listed in $mynetworks. This setting will not prevent remote mail header address rewriting when mail from a remote client is forwarded by a neighboring system. |
permit_sasl_authenticated | Append the domain name in $myorigin or $mydomain when the client is successfully authenticated via the RFC 4954 (AUTH) protocol. |
permit_tls_clientcerts | Append the domain name in $myorigin or $mydomain when the client TLS certificate fingerprint is listed in $relay_clientcerts. The fingerprint digest algorithm is configurable via the smtpd_tls_fingerprint_digest parameter (hard-coded as md5 prior to Postfix version 2.5). |
permit_tls_all_clientcerts | Append the domain name in $myorigin or $mydomain when the client TLS certificate is successfully verified, regardless of whether it is listed on the server, and regardless of the certifying authority. |
check_address_map type:table |
type:table | Append the domain name in $myorigin or $mydomain when the client IP address matches the specified lookup table. The lookup result is ignored, and no subnet lookup is done. This is suitable for, e.g., pop-before-smtp lookup tables. |
Examples:
The Postfix < 2.2 backwards compatible setting: always rewrite message headers, and always append my own domain to incomplete header addresses.
The purist (and default) setting: rewrite headers only in mail from Postfix sendmail and in SMTP mail from this machine.
The intermediate setting: rewrite header addresses and append $myorigin or $mydomain information only with mail from Postfix sendmail, from local clients, or from authorized SMTP clients.
Note: this setting will not prevent remote mail header address rewriting when mail from a remote client is forwarded by a neighboring system.
If this parameter is non-empty (the default), then the Postfix SMTP server will reject mail for unknown local users.
To turn off local recipient checking in the Postfix SMTP server, specify "local_recipient_maps =" (i.e. empty).
The default setting assumes that you use the default Postfix local delivery agent for local delivery. You need to update the local_recipient_maps setting if:
• | You redefine the local delivery agent in master.cf. |
• | You redefine the "local_transport" setting in main.cf. |
• | You use the "luser_relay", "mailbox_transport", or "fallback_transport" feature of the Postfix local(8) delivery agent. |
Details are described in the LOCAL_RECIPIENT_README file.
Beware: if the Postfix SMTP server runs chrooted, you need to access the passwd file via the proxymap(8) service, in order to overcome chroot access restrictions. The alternative, maintaining a copy of the system password file in the chroot jail is not practical.
Examples:
local_recipient_maps =
By default, local mail is delivered to the transport called "local", which is just the name of a service that is defined the master.cf file.
Specify a string of the form transport:nexthop, where transport is the name of a mail delivery transport defined in master.cf. The :nexthop destination is optional; its syntax is documented in the manual page of the corresponding delivery agent.
Beware: if you override the default local delivery agent then you need to review the LOCAL_RECIPIENT_README document, otherwise the SMTP server may reject mail for local recipients.
The following $name expansions are done on luser_relay:
$domain | The recipient domain. |
$extension | The recipient address extension. |
$home | The recipient's home directory. |
$local | The entire recipient address localpart. |
$recipient | The full recipient address. |
$recipient_delimiter | The system-wide recipient address extension delimiter. |
$shell | The recipient's login shell. |
$user | The recipient username. |
${name?value} | Expands to value when $name has a non-empty value. |
${name:value} | Expands to value when $name has an empty value. |
Instead of $name you can also specify ${name} or $(name).
Note: luser_relay works only for the Postfix local(8) delivery agent.
Note: if you use this feature for accounts not in the UNIX password file, then you must specify "local_recipient_maps =" (i.e. empty) in the main.cf file, otherwise the Postfix SMTP server will reject mail for non-UNIX accounts with "User unknown in local recipient table".
Examples:
luser_relay = $user@other.host
luser_relay = $local@other.host
luser_relay = admin+$local
When this parameter value is changed you need to re-run "postfix set-permissions" (with Postfix version 2.0 and earlier: " /etc/postfix/post-install set-permissions".
Note: maildir delivery is done with the privileges of the recipient. If you use the mail_spool_directory setting for maildir style delivery, then you must create the top-level maildir directory in advance. Postfix will not create it.
Examples:
mail_spool_directory = /var/mail
mail_spool_directory = /var/spool/mail
The following environment variables are exported to the command:
CLIENT_ADDRESS | Remote client network address. Available in Postfix version 2.2 and later. |
CLIENT_HELO | Remote client EHLO command parameter. Available in Postfix version 2.2 and later. |
CLIENT_HOSTNAME | Remote client hostname. Available in Postfix version 2.2 and later. |
CLIENT_PROTOCOL | Remote client protocol. Available in Postfix version 2.2 and later. |
DOMAIN | The domain part of the recipient address. |
EXTENSION | The optional address extension. |
HOME | The recipient home directory. |
LOCAL | The recipient address localpart. |
LOGNAME | The recipient's username. |
ORIGINAL_RECIPIENT | The entire recipient address, before any address rewriting or aliasing. |
RECIPIENT | The full recipient address. |
SASL_METHOD | SASL authentication method specified in the remote client AUTH command. Available in Postfix version 2.2 and later. |
SASL_SENDER | SASL sender address specified in the remote client MAIL FROM command. Available in Postfix version 2.2 and later. |
SASL_USER | SASL username specified in the remote client AUTH command. Available in Postfix version 2.2 and later. |
SENDER | The full sender address. |
SHELL | The recipient's login shell. |
USER | The recipient username. |
Unlike other Postfix configuration parameters, the mailbox_command parameter is not subjected to $name substitutions. This is to make it easier to specify shell syntax (see example below).
If you can, avoid shell meta characters because they will force Postfix to run an expensive shell process. If you're delivering via Procmail then running a shell won't make a noticeable difference in the total cost.
Note: if you use the mailbox_command feature to deliver mail system-wide, you must set up an alias that forwards mail for root to a real user.
The precedence of local(8) delivery features from high to low is: aliases, .forward files, mailbox_transport_maps, mailbox_transport, mailbox_command_maps, mailbox_command, home_mailbox, mail_spool_directory, fallback_transport_maps, fallback_transport and luser_relay.
Examples:
mailbox_command = /some/where/procmail
mailbox_command = /some/where/procmail -a "$EXTENSION"
mailbox_command = /some/where/maildrop -d "$USER"
-f "$SENDER" "$EXTENSION"
The precedence of local(8) delivery features from high to low is: aliases, .forward files, mailbox_transport_maps, mailbox_transport, mailbox_command_maps, mailbox_command, home_mailbox, mail_spool_directory, fallback_transport_maps, fallback_transport and luser_relay.
This setting is ignored with maildir style delivery, because such deliveries are safe without explicit locks.
Note: The dotlock method requires that the recipient UID or GID has write access to the parent directory of the mailbox file.
Note: the default setting of this parameter is system dependent.
This limit must not be smaller than the message size limit.
The precedence of local(8) delivery features from high to low is: aliases, .forward files, mailbox_transport_maps, mailbox_transport, mailbox_command_maps, mailbox_command, home_mailbox, mail_spool_directory, fallback_transport_maps, fallback_transport and luser_relay.
The precedence of local(8) delivery features from high to low is: aliases, .forward files, mailbox_transport_maps, mailbox_transport, mailbox_command_maps, mailbox_command, home_mailbox, mail_spool_directory, fallback_transport_maps, fallback_transport and luser_relay.
For safety reasons, this feature does not allow $number substitutions in regular expression maps.
This feature is available in Postfix 2.3 and later.
Do not change this unless you have a complete understanding of RFC 2821.
By default, address masquerading is limited to envelope sender addresses, and to header sender and header recipient addresses. This allows you to use address masquerading on a mail gateway while still being able to forward mail to users on individual machines.
Specify zero or more of: envelope_sender, envelope_recipient, header_sender, header_recipient
The list is processed left to right, and processing stops at the first match. Thus,
strips "user@any.thing.foo.example.com" to "user@foo.example.com", but strips "user@any.thing.else.example.com" to "user@example.com".
A domain name prefixed with ! means do not masquerade this domain or its subdomains. Thus,
does not change "user@any.thing.foo.example.com" or "user@foo.example.com", but strips "user@any.thing.else.example.com" to "user@example.com".
Note: with Postfix version 2.2, message header address masquerading happens only when message header address rewriting is enabled:
• | The message is received with the Postfix sendmail(1) command, |
• | The message is received from a network client that matches $local_header_rewrite_clients, |
• | The message is received from the network, and the remote_header_rewrite_domain parameter specifies a non-empty value. |
To get the behavior before Postfix version 2.2, specify "local_header_rewrite_clients = static:all".
Example:
masquerade_domains = $mydomain
By default, address masquerading makes no exceptions.
Specify a list of user names, "/file/name" or "type:table" patterns, separated by commas and/or whitespace. The list is matched left to right, and the search stops on the first match. A "/file/name" pattern is replaced by its contents; a "type:table" lookup table is matched when a name matches a lookup key (the lookup result is ignored). Continue long lines by starting the next line with whitespace. Specify "!pattern" to exclude a name from the list. The form "!/file/name" is supported only in Postfix version 2.4 and later.
Examples:
masquerade_exceptions = root, mailer-daemon
masquerade_exceptions = root
Note: this feature does not support "/file/name" or "type:table" patterns, nor does it support wildcards such as "*" or "all". This is intentional.
Examples:
# Turn on all master(8) listener ports (the default).
master_service_disable =
# Turn off only the main SMTP listener port.
master_service_disable = smtp.inet
# Turn off all TCP/IP listener ports.
master_service_disable = inet
# Turn off all TCP/IP listener ports except "foo".
master_service_disable = !foo.inet, inet
This feature is available in Postfix 2.6 and later.
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is s (seconds).
This parameter should be set to a value greater than or equal to $minimal_backoff_time. See also $queue_run_delay.
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is s (seconds).
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is d (days).
Specify 0 when mail delivery should be tried only once.
Example:
message_reject_characters = \0
This feature is available in Postfix 2.3 and later.
Note: be careful when making changes. Excessively small values will result in the loss of non-delivery notifications, when a bounce message size exceeds the local or remote MTA's message size limit.
Example:
message_strip_characters = \0
This feature is available in Postfix 2.3 and later.
Specify a non-zero time value (an integral value plus an optional one-letter suffix that specifies the time unit).
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is s (seconds).
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.3 and later.
Specify a non-zero time value (an integral value plus an optional one-letter suffix that specifies the time unit).
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is s (seconds).
This feature is available in Postfix 2.3 and later.
Specify a non-zero time value (an integral value plus an optional one-letter suffix that specifies the time unit).
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is s (seconds).
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.3 and later.
accept | Proceed as if the mail filter was not present. |
reject | Reject all further commands in this session with a permanent status code. |
tempfail | Reject all further commands in this session with a temporary status code. |
quarantine | Like "accept", but freeze the message in the "hold" queue. Available with Postfix 2.6 and later. |
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.5 and later.
The following example sends all mail that is marked as SPAM to a spam handling machine. Note that matches are case-insensitive by default.
/etc/postfix/main.cf:
milter_header_checks = pcre:/etc/postfix/milter_header_checks
/etc/postfix/milter_header_checks:
/^X-SPAM-FLAG:\s+YES/ FILTER mysmtp:sanitizer.example.com:25
The milter_header_checks mechanism could also be used for whitelisting. For example it could be used to skip heavy content inspection for DKIM-signed mail from known friendly domains.
This feature is available in Postfix 2.7, and as an optional patch for Postfix 2.6.
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.3 and later.
Protocol versions:
2 | Use Sendmail 8 mail filter protocol version 2 (default with Sendmail version 8.11 .. 8.13 and Postfix version 2.3 .. 2.5). |
3 | Use Sendmail 8 mail filter protocol version 3. |
4 | Use Sendmail 8 mail filter protocol version 4. |
6 | Use Sendmail 8 mail filter protocol version 6 (default with Sendmail version 8.14 and Postfix version 2.6). |
Protocol extensions:
no_header_reply | Specify this when the Milter application will not reply for each individual message header. |
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.0 and later.
This feature is available in Postfix 2.0 and later.
This feature is available in Postfix 2.0 and later.
This parameter also limits the time an unreachable destination is kept in the short-term, in-memory, destination status cache.
This parameter should be set greater than or equal to $queue_run_delay. See also $maximal_backoff_time.
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is s (seconds).
When $multi_instance_directories is empty, the postfix(1) command runs in single-instance mode and operates on a single Postfix instance only. Otherwise, the postfix(1) command runs in multi-instance mode and invokes the multi-instance manager specified with the multi_instance_wrapper parameter. The multi-instance manager in turn executes postfix(1) commands for the default instance and for all Postfix instances in $multi_instance_directories.
Currently, this parameter setting is ignored except for the default main.cf file.
This feature is available in Postfix 2.6 and later.
This feature is available in Postfix 2.6 and later.
This feature is available in Postfix 2.6 and later.
This feature is available in Postfix 2.6 and later.
The postfix(1) command invokes the manager command with the postfix(1) non-option command arguments on the manager command line, and with all installation configuration parameters exported into the manager command process environment. The manager command in turn invokes the postfix(1) command for individual Postfix instances as "postfix -c config_directory command".
This feature is available in Postfix 2.6 and later.
Do not change this unless you have a complete understanding of RFC 2821.
This feature is available in Postfix 2.1 and later.
The default mydestination value specifies names for the local machine only. On a mail domain gateway, you should also include $mydomain.
The $local_transport delivery method is also selected for mail addressed to user@[the.net.work.address] of the mail system (the IP addresses specified with the inet_interfaces and proxy_interfaces parameters).
Warnings:
• | Do not specify the names of virtual domains - those domains are specified elsewhere. See VIRTUAL_README for more information. |
• | Do not specify the names of domains that this machine is backup MX host for. See STANDARD_CONFIGURATION_README for how to set up backup MX hosts. |
• | By default, the Postfix SMTP server rejects mail for recipients not listed with the local_recipient_maps parameter. See the postconf(5) manual for a description of the local_recipient_maps and unknown_local_recipient_reject_code parameters. |
Specify a list of host or domain names, "/file/name" or "type:table" patterns, separated by commas and/or whitespace. A "/file/name" pattern is replaced by its contents; a "type:table" lookup table is matched when a name matches a lookup key (the lookup result is ignored). Continue long lines by starting the next line with whitespace.
Examples:
mydestination = $myhostname, localhost.$mydomain $mydomain
mydestination = $myhostname, localhost.$mydomain www.$mydomain, ftp.$mydomain
Example:
mydomain = domain.tld
Example:
myhostname = host.example.com
In particular, "trusted" SMTP clients are allowed to relay mail through Postfix. See the smtpd_recipient_restrictions parameter description in the postconf(5) manual.
You can specify the list of "trusted" network addresses by hand or you can let Postfix do it for you (which is the default). See the description of the mynetworks_style parameter for more information.
If you specify the mynetworks list by hand, Postfix ignores the mynetworks_style setting.
Specify a list of network addresses or network/netmask patterns, separated by commas and/or whitespace. Continue long lines by starting the next line with whitespace.
The netmask specifies the number of bits in the network part of a host address. You can also specify "/file/name" or "type:table" patterns. A "/file/name" pattern is replaced by its contents; a "type:table" lookup table is matched when a table entry matches a lookup string (the lookup result is ignored).
The list is matched left to right, and the search stops on the first match. Specify "!pattern" to exclude an address or network block from the list. The form "!/file/name" is supported only in Postfix version 2.4 and later.
Note: IP version 6 address information must be specified inside [] in the mynetworks value, and in files specified with "/file/name". IP version 6 addresses contain the ":" character, and would otherwise be confused with a "type:table" pattern.
Examples:
mynetworks = 127.0.0.0/8 168.100.189.0/28
mynetworks = !192.168.0.1, 192.168.0.0/28
mynetworks = 127.0.0.0/8 168.100.189.0/28 [::1]/128 [2001:240:587::]/64
mynetworks = $config_directory/mynetworks
mynetworks = hash:/etc/postfix/network_table
• | Specify "mynetworks_style = host" when Postfix should "trust" only the local machine. |
• | Specify "mynetworks_style = subnet" when Postfix should "trust" SMTP clients in the same IP subnetworks as the local machine. On Linux, this works correctly only with interfaces specified with the "ifconfig" command. |
• | Specify "mynetworks_style = class" when Postfix should "trust" SMTP clients in the same IP class A/B/C networks as the local machine. Don't do this with a dialup site - it would cause Postfix to "trust" your entire provider's network. Instead, specify an explicit mynetworks list by hand, as described with the mynetworks configuration parameter. |
Example:
myorigin = $mydomain
This feature is available in Postfix 2.0 and later.
This feature is available in Postfix 2.3 and later.
NOTE: postmaster notifications may contain confidential information such as SASL passwords or message content. It is the system administrator's responsibility to treat such information with care.
The error classes are:
bounce (also implies 2bounce) | Send the postmaster copies of the headers of bounced mail, and send transcripts of SMTP sessions when Postfix rejects mail. The notification is sent to the address specified with the bounce_notice_recipient configuration parameter (default: postmaster). |
2bounce | Send undeliverable bounced mail to the postmaster. The notification is sent to the address specified with the 2bounce_notice_recipient configuration parameter (default: postmaster). |
delay | Send the postmaster copies of the headers of delayed mail. The notification is sent to the address specified with the delay_notice_recipient configuration parameter (default: postmaster). |
policy | Send the postmaster a transcript of the SMTP session when a client request was rejected because of (UCE) policy. The notification is sent to the address specified with the error_notice_recipient configuration parameter (default: postmaster). |
protocol | Send the postmaster a transcript of the SMTP session in case of client or server protocol errors. The notification is sent to the address specified with the error_notice_recipient configuration parameter (default: postmaster). |
resource | Inform the postmaster of mail not delivered due to resource problems. The notification is sent to the address specified with the error_notice_recipient configuration parameter (default: postmaster). |
software | Inform the postmaster of mail not delivered due to software problems. The notification is sent to the address specified with the error_notice_recipient configuration parameter (default: postmaster). |
Examples:
notify_classes = bounce, delay, policy, protocol, resource, software
notify_classes = 2bounce, resource, software
This feature is available in Postfix 2.0 and later.
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.6 and later.
This feature is available in Postfix 2.6 and later.
This feature is available in Postfix 2.6 and later.
permit_mynetworks | Whitelist the client and terminate the search if the client IP address matches $mynetworks. Do not subject the client to any before/after 220 greeting tests. Pass the connection immediately to a Postfix SMTP server process. |
type:table |
Query the specified lookup table. Each table lookup result is an access list, except that access lists inside a table cannot specify type:table entries. |
permit | Whitelist the client and terminate the search. Do not subject the client to any before/after 220 greeting tests. Pass the connection immediately to a Postfix SMTP server process. |
reject | Blacklist the client and terminate the search. Subject the client to the action configured with the postscreen_blacklist_action configuration parameter. |
dunno |
All postscreen(8) access lists implicitly have this command at the end. |
Example:
/etc/postfix/main.cf:
postscreen_access_list = permit_mynetworks,
cidr:/etc/postfix/postscreen_access.cidr
/etc/postfix/postscreen_access.cidr:
# Rules are evaluated in the order as specified.
# Blacklist 192.168.* except 192.168.0.1.
192.168.0.1 dunno
192.168.0.0/16 reject
This feature is available in Postfix 2.8.
ignore | Ignore the failure of this test. Allow other tests to complete. Do not repeat this test before some the result from some other test expires. This option is useful for testing and collecting statistics without blocking mail permanently. |
enforce | Allow other tests to complete. Reject attempts to deliver mail with a 550 SMTP reply, and log the helo/sender/recipient information. Repeat this test the next time the client connects. |
drop | Drop the connection immediately with a 521 SMTP reply. Repeat this test the next time the client connects. |
This feature is available in Postfix 2.8.
This feature is available in Postfix 2.8.
Specify a non-zero time value (an integral value plus an optional one-letter suffix that specifies the time unit). Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
This feature is available in Postfix 2.8.
ignore (default) | Ignore this result. Allow other tests to complete. Repeat this test the next time the client connects. This option is useful for testing and collecting statistics without blocking mail. |
enforce | Allow other tests to complete. Reject attempts to deliver mail with a 550 SMTP reply, and log the helo/sender/recipient information. Repeat this test the next time the client connects. |
drop | Drop the connection immediately with a 521 SMTP reply. Repeat this test the next time the client connects. |
This feature is available in Postfix 2.8.
After each cache cleanup run, the postscreen(8) daemon logs the number of entries that were retained and dropped. A cleanup run is logged as "partial" when the daemon terminates early after " postfix reload", "postfix stop", or no requests for $max_idle seconds.
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
This feature is available in Postfix 2.8.
This feature is available in Postfix 2.8.
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
This feature is available in Postfix 2.8.
This feature is available in Postfix 2.8.
This feature is available in Postfix 2.8.
This feature is available in Postfix 2.8 and later.
This feature is available in Postfix 2.8.
This feature is available in Postfix 2.8.
This feature is available in Postfix 2.8 and later.
This feature is available in Postfix 2.8 and later.
ignore (default) | Ignore the failure of this test. Allow other tests to complete. Repeat this test the next time the client connects. This option is useful for testing and collecting statistics without blocking mail. |
enforce | Allow other tests to complete. Reject attempts to deliver mail with a 550 SMTP reply, and log the helo/sender/recipient information. Repeat this test the next time the client connects. |
drop | Drop the connection immediately with a 521 SMTP reply. Repeat this test the next time the client connects. |
This feature is available in Postfix 2.8.
For maximal stability it is best to use a file that is read into memory such as pcre:, regexp: or texthash: (texthash: is similar to hash:, except a) there is no need to run postmap(1) before the file can be used, and b) texthash: does not detect changes after the file is read).
Example:
/etc/postfix/main.cf:
postscreen_dnsbl_reply_map = texthash:/etc/postfix/dnsbl_reply
/etc/postfix/dnsbl_reply:
secret.zen.spamhaus.org zen.spamhaus.org
This feature is available in Postfix 2.8.
Caution: when postscreen rejects mail, it replies with the DNSBL domain name. Use the postscreen_dnsbl_reply_map feature to hide "password" information in DNSBL domain names.
When a client's score is equal to or greater than the threshold specified with postscreen_dnsbl_threshold, postscreen(8) can drop the connection with the SMTP client.
Specify a list of domain=filter*weight entries, separated by comma or whitespace.
• | When no "=filter" is specified, postscreen(8) will use any non-error DNSBL reply. Otherwise, postscreen(8) uses only DNSBL replies that match the filter. The filter has the form d.d.d.d, where each d is a number, or a pattern inside [] that contains one or more ";"-separated numbers or number..number ranges. |
• | When no "*weight" is specified, postscreen(8) increments the SMTP client's DNSBL score by 1. Otherwise, the weight must be an integral number, and postscreen(8) adds the specified weight to the SMTP client's DNSBL score. Specify a negative number for whitelisting. |
• | When one postscreen_dnsbl_sites entry produces multiple DNSBL responses, postscreen(8) applies the weight at most once. |
Examples:
To use example.com as a high-confidence blocklist, and to block mail with example.net and example.org only when both agree:
postscreen_dnsbl_threshold = 2
postscreen_dnsbl_sites = example.com*2, example.net, example.org
To filter only DNSBL replies containing 127.0.0.4:
postscreen_dnsbl_sites = example.com=127.0.0.4
This feature is available in Postfix 2.8.
This feature is available in Postfix 2.8.
Specify a non-zero time value (an integral value plus an optional one-letter suffix that specifies the time unit). Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
This feature is available in Postfix 2.8.
This feature is available in Postfix 2.8 and later. Preferably, use postscreen_tls_security_level instead.
This feature is available in Postfix 2.8 and later.
This feature is available in Postfix 2.8.
ignore (default) | Ignore the failure of this test. Allow other tests to complete. Repeat this test the next time the client connects. This option is useful for testing and collecting statistics without blocking mail. |
enforce | Allow other tests to complete. Reject attempts to deliver mail with a 550 SMTP reply, and log the helo/sender/recipient information. Repeat this test the next time the client connects. |
drop | Drop the connection immediately with a 521 SMTP reply. Repeat this test the next time the client connects. |
In either case, postscreen(8) will not whitelist the SMTP client IP address.
This feature is available in Postfix 2.8.
This feature is available in Postfix 2.8.
Specify a non-zero time value (an integral value plus an optional one-letter suffix that specifies the time unit). Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
This feature is available in Postfix 2.8.
Specify a non-zero time value (an integral value plus an optional one-letter suffix that specifies the time unit).
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
This feature is available in Postfix 2.8.
This feature is available in Postfix 2.8.
ignore | Ignore the failure of this test. Allow other tests to complete. Do not repeat this test before some the result from some other test expires. This option is useful for testing and collecting statistics without blocking mail permanently. |
enforce | Allow other tests to complete. Reject attempts to deliver mail with a 550 SMTP reply, and log the helo/sender/recipient information. Repeat this test the next time the client connects. |
drop | Drop the connection immediately with a 521 SMTP reply. Repeat this test the next time the client connects. This action is the same as with the Postfix SMTP server's smtpd_forbidden_commands feature. |
This feature is available in Postfix 2.8.
This feature is available in Postfix 2.8.
Specify a non-zero time value (an integral value plus an optional one-letter suffix that specifies the time unit). Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
This feature is available in Postfix 2.8.
ignore | Ignore the failure of this test. Allow other tests to complete. Do not repeat this test before some the result from some other test expires. This option is useful for testing and collecting statistics without blocking mail permanently. |
enforce | Allow other tests to complete. Reject attempts to deliver mail with a 550 SMTP reply, and log the helo/sender/recipient information. Repeat this test the next time the client connects. |
drop | Drop the connection immediately with a 521 SMTP reply. Repeat this test the next time the client connects. |
This feature is available in Postfix 2.8.
This feature is available in Postfix 2.8.
Specify a non-zero time value (an integral value plus an optional one-letter suffix that specifies the time unit). Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
This feature is available in Postfix 2.8.
This feature is available in Postfix 2.8.
This feature is available in Postfix 2.8.
This feature is available in Postfix 2.8 and later.
This feature is available in Postfix 2.8 and later.
This feature is available in Postfix 2.8 and later. Preferably, use postscreen_tls_security_level instead.
Specify a non-zero time value (an integral value plus an optional one-letter suffix that specifies the time unit). Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
This feature is available in Postfix 2.8.
By default, the Postfix local delivery agent prepends a Delivered-To: header when forwarding mail and when delivering to file (mailbox) and command. Turning off the Delivered-To: header when forwarding mail is not recommended.
Specify zero or more of forward, file, or command.
Example:
prepend_delivered_header = forward
For example, with a virtual(5) mapping of "joe@example.com => joe.user@example.net", the address "joe+foo@example.com" would rewrite to " joe.user+foo@example.net".
Specify zero or more of canonical, virtual, alias, forward, include or generic. These cause address extension propagation with canonical(5), virtual(5), and aliases(5) maps, with local(8) .forward and :include: file lookups, and with smtp(8) generic maps, respectively.
Note: enabling this feature for types other than canonical and virtual is likely to cause problems when mail is forwarded to other sites, especially with mail that is sent to a mailing list exploder address.
Examples:
propagate_unmatched_extensions = canonical, virtual, alias,
forward, include
propagate_unmatched_extensions = canonical, virtual
This feature is available in Postfix 2.0 and later.
You must specify your "outside" proxy/NAT addresses when your system is a backup MX host for other domains, otherwise mail delivery loops will happen when the primary MX host is down.
Example:
proxy_interfaces = 1.2.3.4
This feature is available in Postfix 2.0 and later.
This feature is available in Postfix 2.5 and later.
This feature is available in Postfix 2.6 and later.
This feature is available in Postfix 2.6 and later.
This feature is enabled with the helpful_warnings parameter.
This feature is available in Postfix 2.0 and later.
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is s (seconds).
This feature is available in Postfix 2.8 and later.
This feature exists only in the oqmgr(8) old queue manager. The current queue manager solves the problem in a better way.
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is s (seconds).
This feature is available in Postfix 2.8 and later.
By default, no client is allowed to use the service. This is because the QMQP server will relay mail to any destination.
Specify a list of client patterns. A list pattern specifies a host name, a domain name, an internet address, or a network/mask pattern, where the mask specifies the number of bits in the network part. When a pattern specifies a file name, its contents are substituted for the file name; when a pattern is a "type:table" table specification, table lookup is used instead.
Patterns are separated by whitespace and/or commas. In order to reverse the result, precede a pattern with an exclamation point (!). The form "!/file/name" is supported only in Postfix version 2.4 and later.
Example:
qmqpd_authorized_clients = !192.168.0.1, 192.168.0.0/24
This feature is available in Postfix 2.5 and later.
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is s (seconds).
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is s (seconds).
This feature is available in Postfix 2.0 and later.
By default, the Postfix SMTP server rejects MAIL FROM commands when the amount of free space is less than 1.5*$message_size_limit (Postfix version 2.1 and later). To specify a higher minimum free space limit, specify a queue_minfree value that is at least 1.5*$message_size_limit.
With Postfix versions 2.0 and earlier, a queue_minfree value of zero means there is no minimum required amount of free space.
This parameter should be set less than or equal to $minimal_backoff_time. See also $maximal_backoff_time.
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is s (seconds).
This feature is available in Postfix 2.0 and later.
This feature is available in Postfix 2.0 and later.
Specify zero or more of the following options. The options override main.cf settings and are either implemented by smtpd(8), qmqpd(8), or pickup(8) themselves, or they are forwarded to the cleanup server.
no_unknown_recipient_checks | Do not try to reject unknown recipients (SMTP server only). This is typically specified AFTER an external content filter. |
no_address_mappings | Disable canonical address mapping, virtual alias map expansion, address masquerading, and automatic BCC (blind carbon-copy) recipients. This is typically specified BEFORE an external content filter. |
no_header_body_checks | Disable header/body_checks. This is typically specified AFTER an external content filter. |
no_milters | Disable Milter (mail filter) applications. This is typically specified AFTER an external content filter. |
Note: when the "BEFORE content filter" receive_override_options setting is specified in the main.cf file, specify the "AFTER content filter" receive_override_options setting in master.cf (and vice versa).
Examples:
receive_override_options =
no_unknown_recipient_checks, no_header_body_checks
receive_override_options = no_address_mappings
This feature is available in Postfix 2.1 and later.
This feature is available in Postfix 2.1 and later.
The table search order is as follows:
• | Look up the "user+extension@domain.tld" address including the optional address extension. |
• | Look up the "user@domain.tld" address without the optional address extension. |
• | Look up the "user+extension" address local part when the recipient domain equals $myorigin, $mydestination, $inet_interfaces or $proxy_interfaces. |
• | Look up the "user" address local part when the recipient domain equals $myorigin, $mydestination, $inet_interfaces or $proxy_interfaces. |
• | Look up the "@domain.tld" part. |
Specify the types and names of databases to use. After change, run " postmap /etc/postfix/recipient_bcc".
Note: if mail to the BCC address bounces it will be returned to the sender.
Note: automatic BCC recipients are produced only for new mail. To avoid mailer loops, automatic BCC recipients are not generated after Postfix forwards mail internally, or after Postfix generates mail itself.
Example:
recipient_bcc_maps = hash:/etc/postfix/recipient_bcc
Specify one or more of: envelope_recipient, header_recipient
This feature is available in Postfix 2.2 and later.
Note: $recipient_canonical_maps is processed before $canonical_maps.
Example:
recipient_canonical_maps = hash:/etc/postfix/recipient_canonical
Example:
recipient_delimiter = +
Do not change this unless you have a complete understanding of RFC 2821.
For finer control, see: unverified_recipient_tempfail_action, unverified_sender_tempfail_action, unknown_address_tempfail_action, and unknown_helo_hostname_tempfail_action.
This feature is available in Postfix 2.6 and later.
Postfix lookup tables are in the form of (key, value) pairs. Since we only need the key, the value can be chosen freely, e.g. the name of the user or host: D7:04:2F:A7:0B:8C:A5:21:FA:31:77:E1:41:8A:EE:80 lutzpc.at.home
Example:
relay_clientcerts = hash:/etc/postfix/relay_clientcerts
For more fine-grained control, use check_ccert_access to select an appropriate access(5) policy for each client. See RESTRICTION_CLASS_README.
This feature is available with Postfix version 2.2.
This feature is available in Postfix 2.0 and later.
Setting this parameter to a value of 1 changes the meaning of relay_destination_concurrency_limit from concurrency per domain into concurrency per recipient.
This feature is available in Postfix 2.0 and later.
Domains that match $relay_domains are delivered with the $relay_transport mail delivery transport. The SMTP server validates recipient addresses with $relay_recipient_maps and rejects non-existent recipients. See also the relay domains address class in the ADDRESS_CLASS_README file.
Note: Postfix will not automatically forward mail for domains that list this system as their primary or backup MX host. See the permit_mx_backup restriction in the postconf(5) manual page.
Specify a list of host or domain names, "/file/name" patterns or "type:table" lookup tables, separated by commas and/or whitespace. Continue long lines by starting the next line with whitespace. A "/file/name" pattern is replaced by its contents; a "type:table" lookup table is matched when a (parent) domain appears as lookup key. Specify "!pattern" to exclude a domain from the list. The form "!/file/name" is supported only in Postfix version 2.4 and later.
Do not change this unless you have a complete understanding of RFC 2821.
If this parameter is non-empty, then the Postfix SMTP server will reject mail to unknown relay users. This feature is off by default.
See also the relay domains address class in the ADDRESS_CLASS_README file.
Example:
relay_recipient_maps = hash:/etc/postfix/relay_recipients
This feature is available in Postfix 2.0 and later.
Specify a string of the form transport:nexthop, where transport is the name of a mail delivery transport defined in master.cf. The :nexthop destination is optional; its syntax is documented in the manual page of the corresponding delivery agent.
See also the relay domains address class in the ADDRESS_CLASS_README file.
This feature is available in Postfix 2.0 and later.
On an intranet, specify the organizational domain name. If your internal DNS uses no MX records, specify the name of the intranet gateway host instead.
In the case of SMTP, specify a domain name, hostname, hostname:port, [hostname]:port, [hostaddress] or [hostaddress]:port. The form [hostname] turns off MX lookups.
If you're connected via UUCP, see the UUCP_README file for useful information.
Examples:
relayhost = $mydomain
relayhost = [gateway.example.com]
relayhost = uucphost
relayhost = [an.ip.add.ress]
If you use this feature, run "postmap /etc/postfix/relocated" to build the necessary DBM or DB file after change, then " postfix reload" to make the changes visible.
Examples:
relocated_maps = dbm:/etc/postfix/relocated
relocated_maps = hash:/etc/postfix/relocated
Examples:
The safe setting: append "domain.invalid" to incomplete header addresses from remote SMTP clients, so that those addresses cannot be confused with local addresses.
The default, purist, setting: don't rewrite headers from remote clients at all.
This feature is available in Postfix 2.8 and later. With older Postfix releases, the behavior is as if this parameter is set to "yes".
As documented in aliases(5), when an alias name has a companion alias named owner- name, delivery errors will be reported to the owner alias instead of the sender. This configuration is recommended for mailing lists.
A less known property of the owner alias is that it also forces the local(8) delivery agent to write local and remote addresses from alias expansion to a new queue file, instead of attempting to deliver mail to local addresses as soon as they come out of alias expansion.
Writing local addresses from alias expansion to a new queue file allows for robust handling of temporary delivery errors: errors with one local member have no effect on deliveries to other members of the list. On the other hand, delivery to local addresses as soon as they come out of alias expansion is fragile: a temporary error with one local address from alias expansion will cause the entire alias to be expanded repeatedly until the error goes away, or until the message expires in the queue. In that case, a problem with one list member results in multiple message deliveries to other list members.
The default behavior of Postfix 2.8 and later is to keep the owner-alias attribute of the parent alias, when delivering mail to a child alias that does not have its own owner alias. Then, local addresses from that child alias will be written to a new queue file, and a temporary error with one local address will not affect delivery to other mailing list members.
Unfortunately, older Postfix releases reset the owner-alias attribute when delivering mail to a child alias that does not have its own owner alias. The local(8) delivery agent then attempts to deliver local addresses as soon as they come out of child alias expansion. If delivery to any address from child alias expansion fails with a temporary error condition, the entire mailing list may be expanded repeatedly until the mail expires in the queue, resulting in multiple deliveries of the same message to mailing list members.
By default, the Postfix address resolver does not quote the address localpart as per RFC 822, so that additional @ or % or ! operators remain visible. This behavior is safe but it is also technically incorrect.
If you specify "resolve_dequoted_address = no", then the Postfix resolver will not know about additional @ etc. operators in the address localpart. This opens opportunities for obscure mail relay attacks with user@domain@domain addresses when Postfix provides backup MX service for Sendmail systems.
This feature is available in Postfix 2.1 and later. Earlier versions always resolve the null domain as the local hostname.
The Postfix SMTP server uses this feature to reject mail from or to addresses that end in the "@" null domain, and from addresses that rewrite into a form that ends in the "@" null domain.
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.0 and later.
The non-default setting "yes" enables the behavior of older Postfix versions. These always send a SASL authzid that is equal to the SASL authcid, but this causes inter-operability problems with some SMTP servers.
This feature is available in Postfix 2.4.4 and later.
This feature is available in Postfix 2.1 and later.
The table search order is as follows:
• | Look up the "user+extension@domain.tld" address including the optional address extension. |
• | Look up the "user@domain.tld" address without the optional address extension. |
• | Look up the "user+extension" address local part when the sender domain equals $myorigin, $mydestination, $inet_interfaces or $proxy_interfaces. |
• | Look up the "user" address local part when the sender domain equals $myorigin, $mydestination, $inet_interfaces or $proxy_interfaces. |
• | Look up the "@domain.tld" part. |
Specify the types and names of databases to use. After change, run " postmap /etc/postfix/sender_bcc".
Note: if mail to the BCC address bounces it will be returned to the sender.
Note: automatic BCC recipients are produced only for new mail. To avoid mailer loops, automatic BCC recipients are not generated after Postfix forwards mail internally, or after Postfix generates mail itself.
Example:
sender_bcc_maps = hash:/etc/postfix/sender_bcc
Specify one or more of: envelope_sender, header_sender
This feature is available in Postfix 2.2 and later.
Example: you want to rewrite the SENDER address "user@ugly.domain" to "user@pretty.domain", while still being able to send mail to the RECIPIENT address "user@ugly.domain".
Note: $sender_canonical_maps is processed before $canonical_maps.
Example:
sender_canonical_maps = hash:/etc/postfix/sender_canonical
Note: this overrides default_transport, not transport_maps, and therefore the expected syntax is that of default_transport, not the syntax of transport_maps. Specifically, this does not support the transport_maps syntax for null transport, null nexthop, or null email addresses.
For safety reasons, this feature does not allow $number substitutions in regular expression maps.
This feature is available in Postfix 2.7 and later.
For safety reasons, this feature does not allow $number substitutions in regular expression maps.
This feature is available in Postfix 2.3 and later.
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is s (seconds).
This feature is available in Postfix 2.0 and later.
This feature is available in Postfix 2.0 and later.
This feature is available in Postfix 2.8 and later.
With "smtp_always_send_ehlo = no", Postfix sends EHLO only when the word "ESMTP" appears in the server greeting banner (example: 220 spike.porcupine.org ESMTP Postfix).
This can be specified in the main.cf file for all SMTP clients, or it can be specified in the master.cf file for a specific client, for example:
Note 1: when inet_interfaces specifies no more than one IPv4 address, and that address is a non-loopback address, it is automatically used as the smtp_bind_address. This supports virtual IP hosting, but can be a problem on multi-homed firewalls. See the inet_interfaces documentation for more detail.
Note 2: address information may be enclosed inside [], but this form is not required here.
This feature is available in Postfix 2.2 and later.
This can be specified in the main.cf file for all SMTP clients, or it can be specified in the master.cf file for a specific client, for example:
Note 1: when inet_interfaces specifies no more than one IPv6 address, and that address is a non-loopback address, it is automatically used as the smtp_bind_address6. This supports virtual IP hosting, but can be a problem on multi-homed firewalls. See the inet_interfaces documentation for more detail.
Note 2: address information may be enclosed inside [], but this form is not recommended here.
This feature is available in Postfix 2.5 and later.
This feature is available in Postfix 2.2.9 and later.
When no connection can be made within the deadline, the Postfix SMTP client tries the next address on the mail exchanger list. Specify 0 to disable the time limit (i.e. use whatever timeout is implemented by the operating system).
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is s (seconds).
Specify a comma or white space separated list of destinations or pseudo-destinations:
• | if mail is sent without a relay host: a domain name (the right-hand side of an email address, without the [] around a numeric IP address), |
• | if mail is sent via a relay host: a relay host name (without [] or non-default TCP port), as specified in main.cf or in the transport map, |
• | if mail is sent via a UNIX-domain socket: a pathname (without the unix: prefix), |
• | a /file/name with domain names and/or relay host names as defined above, |
• | a "type:table" with domain names and/or relay host names on the left-hand side. The right-hand side result from "type:table" lookups is ignored. |
This feature is available in Postfix 2.2 and later.
This feature is available in Postfix 2.2 and later.
This feature is available in Postfix 2.2. In Postfix 2.3 it is replaced by $smtp_connection_reuse_time_limit.
This feature is available in Postfix 2.2 and later.
This feature addresses a performance stability problem with remote SMTP servers. This problem is not specific to Postfix: it can happen when any MTA sends large amounts of SMTP email to a site that has multiple MX hosts.
The problem starts when one of a set of MX hosts becomes slower than the rest. Even though SMTP clients connect to fast and slow MX hosts with equal probability, the slow MX host ends up with more simultaneous inbound connections than the faster MX hosts, because the slow MX host needs more time to serve each client request.
The slow MX host becomes a connection attractor. If one MX host becomes N times slower than the rest, it dominates mail delivery latency unless there are more than N fast MX hosts to counter the effect. And if the number of MX hosts is smaller than N, the mail delivery latency becomes effectively that of the slowest MX host divided by the total number of MX hosts.
The solution uses connection caching in a way that differs from Postfix version 2.2. By limiting the amount of time during which a connection can be used repeatedly (instead of limiting the number of deliveries over that connection), Postfix not only restores fairness in the distribution of simultaneous connections across a set of MX hosts, it also favors deliveries over connections that perform well, which is exactly what we want.
The default reuse time limit, 300s, is comparable to the various smtp transaction timeouts which are fair estimates of maximum excess latency for a slow delivery. Note that hosts may accept thousands of messages over a single connection within the default connection reuse time limit. This number is much larger than the default Postfix version 2.2 limit of 10 messages per cached connection. It may prove necessary to lower the limit to avoid interoperability issues with MTAs that exhibit bugs when many messages are delivered via a single connection. A lower reuse time limit risks losing the benefit of connection reuse when the average connection and mail delivery latency exceeds the reuse time limit.
This feature is available in Postfix 2.3 and later.
When no response is received within the deadline, a warning is logged that the mail may be delivered multiple times.
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is s (seconds).
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is s (seconds).
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is s (seconds).
The default (no) is to return the mail as undeliverable. With older Postfix versions the default was to keep trying to deliver the mail until someone fixed the MX record or until the mail was too old.
Note: Postfix always ignores MX records with equal or worse preference than the local MTA itself.
This feature is available in Postfix 2.1 and later.
Setting this parameter to a value of 1 changes the meaning of smtp_destination_concurrency_limit from concurrency per domain into concurrency per recipient.
This feature is available in Postfix 2.2 and later.
This feature is available in Postfix 2.2 and later.
Notes:
• | Specify the silent-discard pseudo keyword to prevent this action from being logged. |
• | Use the smtp_discard_ehlo_keyword_address_maps feature to discard EHLO keywords selectively. |
res_defnames | Append the current domain name to single-component names (those that do not contain a "." character). This can produce incorrect results, and is the hard-coded behavior prior to Postfix 2.8. |
res_dnsrch | Search for host names in the current domain and in parent domains. This can produce incorrect results and is therefore not recommended. |
This feature is available in Postfix 2.8 and later.
The server hostname is matched against all names provided as dNSNames in the SubjectAlternativeName. If no dNSNames are specified, the CommonName is checked. The behavior may be changed with the smtp_tls_enforce_peername option.
This option is useful only if you are definitely sure that you will only connect to servers that support RFC 2487 _and_ that provide valid server certificates. Typical use is for clients that send all their email to a dedicated mailhub.
This feature is available in Postfix 2.2 and later. With Postfix 2.3 and later use smtp_tls_security_level instead.
By default, mail is returned to the sender when a destination is not found, and delivery is deferred when a destination is unreachable.
The fallback relays must be SMTP destinations. Specify a domain, host, host:port, [host]:port, [address] or [address]:port; the form [host] turns off MX lookups. If you specify multiple SMTP destinations, Postfix will try them in the specified order.
To prevent mailer loops between MX hosts and fall-back hosts, Postfix version 2.2 and later will not use the fallback relays for destinations that it is MX host for (assuming DNS lookup is turned on).
The table format and lookups are documented in generic(5); examples are shown in the ADDRESS_REWRITING_README and STANDARD_CONFIGURATION_README documents.
This feature is available in Postfix 2.2 and later.
This feature is available in Postfix 2.5 and later.
The default value is the machine hostname. Specify a hostname or [ip.add.re.ss].
This information can be specified in the main.cf file for all SMTP clients, or it can be specified in the master.cf file for a specific client, for example:
This feature is available in Postfix 2.0 and later.
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is s (seconds).
Specify one of the following:
dns | Hosts can be found in the DNS (preferred). |
native | Use the native naming service only (nsswitch.conf, or equivalent mechanism). |
dns, native | Use the native service for hosts not found in the DNS. |
This feature is available in Postfix 2.1 and later.
By default, the line length is limited to 990 characters, because some server implementations cannot receive mail with long lines.
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is s (seconds).
This feature is available in Postfix 2.5 and later.
This feature is available in Postfix 2.1 and later.
This feature is available in Postfix 2.1 and later.
This feature is available in Postfix 2.5 and later.
Choosing a too short time makes this workaround ineffective when sending large messages over slow network connections.
This feature is available in Postfix 2.4 and later.
By default, the workaround is turned off for mail that is queued for less than 500 seconds. In other words, the workaround is normally turned off for the first delivery attempt.
Specify 0 to enable the PIX firewall "<CR><LF>.<CR><LF>" bug workaround upon the first delivery attempt.
delay_dotcrlf | Insert a delay before sending ".<CR><LF>" after the end of the message content. The delay is subject to the smtp_pix_workaround_delay_time and smtp_pix_workaround_threshold_time parameter settings. |
disable_esmtp | Disable all extended SMTP commands: send HELO instead of EHLO. |
This feature is available in Postfix 2.4 and later. The default settings are backwards compatible with earlier Postfix versions.
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is s (seconds).
The default is to comply with RFC 2821. If you have to send mail to a broken SMTP server, configure a special SMTP client in master.cf:
and route mail for the destination in question to the "broken-smtp" message delivery with a transport(5) table.
This feature is available in Postfix 2.1 and later.
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is s (seconds).
Notes:
• | In the case of a multi-line reply, the Postfix SMTP client uses the final reply line's numerical SMTP reply code and enhanced status code. |
• | The numerical SMTP reply code (XYZ) takes precedence over the enhanced status code (X.Y.Z). When the enhanced status code initial digit differs from the SMTP reply code initial digit, or when no enhanced status code is present, the Postfix SMTP client uses a generic enhanced status code (X.0.0) instead. |
Specify the name of a "type:table" lookup table. The search string is a single SMTP reply line as received from the remote SMTP server, except that the trailing <CR><LF> are removed.
Examples:
/etc/postfix/main.cf:
smtp_reply_filter = pcre:/etc/postfix/reply_filter
/etc/postfix/reply_filter:
# Transform garbage into "250-filler..." so that it looks like
# one line from a multi-line reply. It does not matter what we
# substitute here as long it has the right syntax. The Postfix
# SMTP client will use the final line's numerical SMTP reply
# code and enhanced status code.
!/^([2-5][0-9][0-9]($|[- ]))/ 250-filler for garbage
This feature is available in Postfix 2.7.
This feature is available in Postfix 2.1 and later.
Use a per-destination delivery concurrency of 1 (for example, "smtp_destination_concurrency_limit = 1", "relay_destination_concurrency_limit = 1", etc.), otherwise multiple delivery agents may experience a login failure at the same time.
The table must be accessed via the proxywrite service, i.e. the map name must start with "proxy:". The table should be stored under the directory specified with the data_directory parameter.
This feature uses cryptographic hashing to protect plain-text passwords, and requires that Postfix is compiled with TLS support.
Example:
smtp_sasl_auth_cache_name = proxy:btree:/var/db/postfix/sasl_auth_cache
This feature is available in Postfix 2.5 and later.
This feature is available in Postfix 2.5 and later.
Example:
smtp_sasl_auth_enable = yes
Note: the setting "yes" overrides the global soft_bounce parameter, but the setting "no" does not.
Example:
# Default as of Postfix 2.5
smtp_sasl_auth_soft_bounce = yes
# The old hard-coded default
smtp_sasl_auth_soft_bounce = no
This feature is available in Postfix 2.5 and later.
Specify mechanism names, "/file/name" patterns or "type:table" lookup tables. The right-hand side result from "type:table" lookups is ignored. Specify "!pattern" to exclude a mechanism name from the list. The form "!/file/name" is supported only in Postfix version 2.4 and later.
This feature is available in Postfix 2.2 and later.
Examples:
smtp_sasl_mechanism_filter = plain, login
smtp_sasl_mechanism_filter = /etc/postfix/smtp_mechs
smtp_sasl_mechanism_filter = !gssapi, !login, static:rest
The Postfix SMTP client opens the lookup table before going to chroot jail, so you can leave the password file in /etc/postfix.
This feature is available in Postfix 2.3 and later.
The following security features are defined for the cyrus client SASL implementation:
Specify zero or more of the following:
noplaintext | Disallow methods that use plaintext passwords. |
noactive | Disallow methods subject to active (non-dictionary) attack. |
nodictionary | Disallow methods subject to passive (dictionary) attack. |
noanonymous | Disallow methods that allow anonymous authentication. |
mutual_auth | Only allow methods that provide mutual authentication (not available with SASL version 1). |
Example:
smtp_sasl_security_options = noplaintext
This feature is available in Postfix 2.2 and later.
When mail is sent to the public MX host for the recipient's domain, server certificates are by default optional, and delivery proceeds even if certificate verification fails. For delivery via a submission service that requires SASL authentication, it may be appropriate to send plaintext passwords only when the connection to the server is strongly encrypted and the server identity is verified.
The smtp_sasl_tls_verified_security_options parameter makes it possible to only enable plaintext mechanisms when a secure connection to the server is available. Submission servers subject to this policy must either have verifiable certificates or offer suitable non-plaintext SASL mechanisms.
This feature is available in Postfix 2.6 and later.
This feature is available in Postfix 2.3 and later.
This allows an "smtp" delivery agent, used for injecting mail into a content filter, to forward the name, address, protocol and HELO name of the original client to the content filter and downstream queuing SMTP server. This can produce more useful logging than localhost[127.0.0.1] etc.
This feature is available in Postfix 2.1 and later.
This feature is available in Postfix 2.3 and later.
By default, Postfix moves on the next mail exchanger. Specify "smtp_skip_4xx_greeting = no" if Postfix should defer delivery immediately.
This feature is available in Postfix 2.0 and earlier. Later Postfix versions always skip SMTP servers that greet with a 4XX status code.
By default, the Postfix SMTP client moves on the next mail exchanger. Specify "smtp_skip_5xx_greeting = no" if Postfix should bounce the mail immediately. The default setting is incorrect, but it is what a lot of people expect to happen.
This feature is available in Postfix 2.2 and later.
Specify "tls_append_default_CA = no" to prevent Postfix from appending the system-supplied default CAs and trusting third-party certificates.
Example:
smtp_tls_CAfile = /etc/postfix/CAcert.pem
This feature is available in Postfix 2.2 and later.
To use this option in chroot mode, this directory (or a copy) must be inside the chroot jail.
Specify "tls_append_default_CA = no" to prevent Postfix from appending the system-supplied default CAs and trusting third-party certificates.
Example:
smtp_tls_CApath = /etc/postfix/certs
This feature is available in Postfix 2.2 and later.
This feature is available in Postfix 2.7.
Do not configure client certificates unless you must present client TLS certificates to one or more servers. Client certificates are not usually needed, and can cause problems in configurations that work well without them. The recommended setting is to let the defaults stand:
The best way to use the default settings is to comment out the above parameters in main.cf if present.
To enable remote SMTP servers to verify the Postfix SMTP client certificate, the issuing CA certificates must be made available to the server. You should include the required certificates in the client certificate file, the client certificate first, then the issuing CA(s) (bottom-up order).
Example: the certificate for "client.example.com" was issued by "intermediate CA" which itself has a certificate issued by "root CA". Create the client.pem file with "cat client_cert.pem intermediate_CA.pem root_CA.pem > client.pem".
If you also want to verify remote SMTP server certificates issued by these CAs, you can add the CA certificates to the smtp_tls_CAfile, in which case it is not necessary to have them in the smtp_tls_cert_file, smtp_tls_dcert_file or smtp_tls_eccert_file.
A certificate supplied here must be usable as an SSL client certificate and hence pass the "openssl verify -purpose sslclient ..." test.
Example:
smtp_tls_cert_file = /etc/postfix/client.pem
This feature is available in Postfix 2.2 and later.
Note: do not use "" quotes around the parameter value.
This feature is available in Postfix version 2.2. It is not used with Postfix 2.3 and later; use smtp_tls_mandatory_ciphers instead.
When TLS is mandatory the cipher grade is chosen via the smtp_tls_mandatory_ciphers configuration parameter, see there for syntax details. See smtp_tls_policy_maps for information on how to configure ciphers on a per-destination basis.
Example:
smtp_tls_ciphers = export
This feature is available in Postfix 2.6 and later. With earlier Postfix releases only the smtp_tls_mandatory_ciphers parameter is implemented, and opportunistic TLS always uses "export" or better (i.e. all) ciphers.
See the discussion under smtp_tls_cert_file for more details.
Example:
smtp_tls_dcert_file = /etc/postfix/client-dsa.pem
This feature is available in Postfix 2.2 and later.
The private key must be accessible without a pass-phrase, i.e. it must not be encrypted. File permissions should grant read-only access to the system superuser account ("root"), and no access to anyone else.
This feature is available in Postfix 2.2 and later.
See the discussion under smtp_tls_cert_file for more details.
Example:
smtp_tls_eccert_file = /etc/postfix/ecdsa-ccert.pem
This feature is available in Postfix 2.6 and later, when Postfix is compiled and linked with OpenSSL 1.0.0 or later.
The private key must be accessible without a pass-phrase, i.e. it must not be encrypted. File permissions should grant read-only access to the system superuser account ("root"), and no access to anyone else.
This feature is available in Postfix 2.6 and later, when Postfix is compiled and linked with OpenSSL 1.0.0 or later.
This option can be set to "no" to disable strict peer name checking. This setting has no effect on sessions that are controlled via the smtp_tls_per_site table.
Disabling the hostname verification can make sense in closed environment where special CAs are created. If not used carefully, this option opens the danger of a "man-in-the-middle" attack (the CommonName of this attacker will be logged).
This feature is available in Postfix 2.2 and later. With Postfix 2.3 and later use smtp_tls_security_level instead.
Examples (some of these will cause problems):
The first setting, disables anonymous ciphers. The next setting disables ciphers that use the MD5 digest algorithm or the (single) DES encryption algorithm. The next setting disables ciphers that use MD5 and DES together. The next setting disables the two ciphers "AES256-SHA" and "DES-CBC3-MD5". The last setting disables ciphers that use "EDH" key exchange with RSA authentication.
This feature is available in Postfix 2.3 and later.
When an smtp_tls_policy_maps table entry specifies the "fingerprint" security level, any "match" attributes in that entry specify the list of valid fingerprints for the corresponding destination. Multiple fingerprints can be combined with a "|" delimiter in a single match attribute, or multiple match attributes can be employed.
Example: Certificate fingerprint verification with internal mailhub. Two matching fingerprints are listed. The relayhost may be multiple physical hosts behind a load-balancer, each with its own private/public key and self-signed certificate. Alternatively, a single relayhost may be in the process of switching from one set of private/public keys to another, and both keys are trusted just prior to the transition.
Example: Certificate fingerprint verification with selected destinations. As in the example above, we show two matching fingerprints:
This feature is available in Postfix 2.5 and later.
The default algorithm is md5; this is consistent with the backwards compatible setting of the digest used to verify client certificates in the SMTP server.
The best practice algorithm is now sha1. Recent advances in hash function cryptanalysis have led to md5 being deprecated in favor of sha1. However, as long as there are no known "second pre-image" attacks against md5, its use in this context can still be considered safe.
While additional digest algorithms are often available with OpenSSL's libcrypto, only those used by libssl in SSL cipher suites are available to Postfix. For now this means just md5 or sha1.
To find the fingerprint of a specific certificate file, with a specific digest algorithm, run:
The text to the right of "=" sign is the desired fingerprint. For example:
This feature is available in Postfix 2.5 and later.
The private key must be accessible without a pass-phrase, i.e. it must not be encrypted. File permissions should grant read-only access to the system superuser account ("root"), and no access to anyone else.
Example:
smtp_tls_key_file = $smtp_tls_cert_file
This feature is available in Postfix 2.2 and later.
|
0 Disable logging of TLS activity. |
|
1 Log TLS handshake and certificate information. |
|
2 Log levels during TLS negotiation. |
|
3 Log hexadecimal and ASCII dump of TLS negotiation process. |
|
4 Log hexadecimal and ASCII dump of complete transmission after STARTTLS. |
Use "smtp_tls_loglevel = 3" only in case of problems. Use of loglevel 4 is strongly discouraged.
This feature is available in Postfix 2.2 and later.
The following cipher grades are supported:
export | Enable "EXPORT" grade or better OpenSSL ciphers. This is the default for opportunistic encryption. It is not recommended for mandatory encryption unless you must enforce TLS with "crippled" peers. The underlying cipherlist is specified via the tls_export_cipherlist configuration parameter, which you are strongly encouraged to not change. |
low | Enable "LOW" grade or better OpenSSL ciphers. This setting is only appropriate for internal mail servers. The underlying cipherlist is specified via the tls_low_cipherlist configuration parameter, which you are strongly encouraged to not change. |
medium | Enable "MEDIUM" grade or better OpenSSL ciphers. The underlying cipherlist is specified via the tls_medium_cipherlist configuration parameter, which you are strongly encouraged to not change. |
high | Enable only "HIGH" grade OpenSSL ciphers. This setting may be appropriate when all mandatory TLS destinations (e.g. when all mail is routed to a suitably capable relayhost) support at least one "HIGH" grade cipher. The underlying cipherlist is specified via the tls_high_cipherlist configuration parameter, which you are strongly encouraged to not change. |
null | Enable only the "NULL" OpenSSL ciphers, these provide authentication without encryption. This setting is only appropriate in the rare case that all servers are prepared to use NULL ciphers (not normally enabled in TLS servers). A plausible use-case is an LMTP server listening on a UNIX-domain socket that is configured to support "NULL" ciphers. The underlying cipherlist is specified via the tls_null_cipherlist configuration parameter, which you are strongly encouraged to not change. |
The underlying cipherlists for grades other than "null" include anonymous ciphers, but these are automatically filtered out if the Postfix SMTP client is configured to verify server certificates. You are very unlikely to need to take any steps to exclude anonymous ciphers, they are excluded automatically as necessary. If you must exclude anonymous ciphers at the "may" or "encrypt" security levels, when the Postfix SMTP client does not need or use peer certificates, set "smtp_tls_exclude_ciphers = aNULL". To exclude anonymous ciphers only when TLS is enforced, set "smtp_tls_mandatory_exclude_ciphers = aNULL".
This feature is available in Postfix 2.3 and later.
Starting with Postfix 2.6, the mandatory cipher exclusions can be specified on a per-destination basis via the TLS policy "exclude" attribute. See smtp_tls_policy_maps for notes and examples.
This feature is available in Postfix 2.3 and later.
With Postfix >= 2.5 the parameter syntax is expanded to support protocol exclusions. One can now explicitly exclude SSLv2 by setting "smtp_tls_mandatory_protocols = !SSLv2". To exclude both SSLv2 and SSLv3 set "smtp_tls_mandatory_protocols = !SSLv2, !SSLv3". Listing the protocols to include, rather than protocols to exclude, is still supported; use the form you find more intuitive.
Since SSL version 2 has known protocol weaknesses and is now deprecated, the default setting excludes "SSLv2". This means that by default, SSL version 2 will not be used at the "encrypt" security level and higher.
See the documentation of the smtp_tls_policy_maps parameter and TLS_README for more information about security levels.
Example:
smtp_tls_mandatory_protocols = TLSv1
# Alternative form with Postfix >= 2.5:
smtp_tls_mandatory_protocols = !SSLv2, !SSLv3
This feature is available in Postfix 2.3 and later.
The logfile record looks like:
postfix/smtp[pid]: Host offered STARTTLS: [name.of.host]
This feature is available in Postfix 2.2 and later.
Use of the bare hostname as the per-site table lookup key is discouraged. Always use the full destination nexthop (enclosed in [] with a possible ":port" suffix). A recipient domain or MX-enabled transport next-hop with no port suffix may look like a bare hostname, but is still a suitable destination.
Specify a next-hop destination or server hostname on the left-hand side; no wildcards are allowed. The next-hop destination is either the recipient domain, or the destination specified with a transport(5) table, the relayhost parameter, or the relay_transport parameter. On the right hand side specify one of the following keywords:
NONE | Don't use TLS at all. This overrides a less specific MAY lookup result from the alternate host or next-hop lookup key, and overrides the global smtp_use_tls, smtp_enforce_tls, and smtp_tls_enforce_peername settings. |
MAY | Try to use TLS if the server announces support, otherwise use the unencrypted connection. This has less precedence than a more specific result (including NONE) from the alternate host or next-hop lookup key, and has less precedence than the more specific global "smtp_enforce_tls = yes" or "smtp_tls_enforce_peername = yes". |
MUST_NOPEERMATCH | Require TLS encryption, but do not require that the remote SMTP server hostname matches the information in the remote SMTP server certificate, or that the server certificate was issued by a trusted CA. This overrides a less secure NONE or a less specific MAY lookup result from the alternate host or next-hop lookup key, and overrides the global smtp_use_tls, smtp_enforce_tls and smtp_tls_enforce_peername settings. |
MUST | Require TLS encryption, require that the remote SMTP server hostname matches the information in the remote SMTP server certificate, and require that the remote SMTP server certificate was issued by a trusted CA. This overrides a less secure NONE and MUST_NOPEERMATCH or a less specific MAY lookup result from the alternate host or next-hop lookup key, and overrides the global smtp_use_tls, smtp_enforce_tls and smtp_tls_enforce_peername settings. |
The above keywords correspond to the "none", "may", "encrypt" and "verify" security levels for the new smtp_tls_security_level parameter introduced in Postfix 2.3. Starting with Postfix 2.3, and independently of how the policy is specified, the smtp_tls_mandatory_ciphers and smtp_tls_mandatory_protocols parameters apply when TLS encryption is mandatory. Connections for which encryption is optional typically enable all "export" grade and better ciphers (see smtp_tls_ciphers and smtp_tls_protocols).
As long as no secure DNS lookup mechanism is available, false hostnames in MX or CNAME responses can change the server hostname that Postfix uses for TLS policy lookup and server certificate verification. Even with a perfect match between the server hostname and the server certificate, there is no guarantee that Postfix is connected to the right server. See TLS_README (Closing a DNS loophole with obsolete per-site TLS policies) for a possible work-around.
This feature is available in Postfix 2.2 and later. With Postfix 2.3 and later use smtp_tls_policy_maps instead.
The TLS policy table is indexed by the full next-hop destination, which is either the recipient domain, or the verbatim next-hop specified in the transport table, $local_transport, $virtual_transport, $relay_transport or $default_transport. This includes any enclosing square brackets and any non-default destination server port suffix. The LMTP socket type prefix (inet: or unix:) is not included in the lookup key.
Only the next-hop domain, or $myhostname with LMTP over UNIX-domain sockets, is used as the nexthop name for certificate verification. The port and any enclosing square brackets are used in the table lookup key, but are not used for server name verification.
When the lookup key is a domain name without enclosing square brackets or any :port suffix (typically the recipient domain), and the full domain is not found in the table, just as with the transport(5) table, the parent domain starting with a leading "." is matched recursively. This allows one to specify a security policy for a recipient domain and all its sub-domains.
The lookup result is a security level, followed by an optional list of whitespace and/or comma separated name=value attributes that override related main.cf settings. The TLS security levels in order of increasing security are:
none | No TLS. No additional attributes are supported at this level. |
may | Opportunistic TLS. Since sending in the clear is acceptable, demanding stronger than default TLS security merely reduces inter-operability. The optional "ciphers", "exclude" and "protocols" attributes (available for opportunistic TLS with Postfix >= 2.6) override the "smtp_tls_ciphers", "smtp_tls_exclude_ciphers" and "smtp_tls_protocols" configuration parameters. When opportunistic TLS handshakes fail, Postfix retries the connection with TLS disabled. This allows mail delivery to sites with non-interoperable TLS implementations. |
encrypt | Mandatory TLS encryption. At this level and higher, the optional "protocols" attribute overrides the main.cf smtp_tls_mandatory_protocols parameter, the optional "ciphers" attribute overrides the main.cf smtp_tls_mandatory_ciphers parameter, and the optional "exclude" attribute (Postfix >= 2.6) overrides the main.cf smtp_tls_mandatory_exclude_ciphers parameter. In the policy table, multiple protocols or excluded ciphers must be separated by colons, as attribute values may not contain whitespace or commas. |
fingerprint | Certificate fingerprint verification. Available with Postfix 2.5 and later. At this security level, there are no trusted certificate authorities. The certificate trust chain, expiration date, ... are not checked. Instead, the optional match attribute, or else the main.cf smtp_tls_fingerprint_cert_match parameter, lists the valid "fingerprints" of the server certificate. The digest algorithm used to calculate the fingerprint is selected by the smtp_tls_fingerprint_digest parameter. Multiple fingerprints can be combined with a "|" delimiter in a single match attribute, or multiple match attributes can be employed. The ":" character is not used as a delimiter as it occurs between each pair of fingerprint (hexadecimal) digits. |
verify | Mandatory TLS verification. At this security level, DNS MX lookups are trusted to be secure enough, and the name verified in the server certificate is usually obtained indirectly via unauthenticated DNS MX lookups. The optional "match" attribute overrides the main.cf smtp_tls_verify_cert_match parameter. In the policy table, multiple match patterns and strategies must be separated by colons. In practice explicit control over matching is more common with the "secure" policy, described below. |
secure | Secure-channel TLS. At this security level, DNS MX lookups, though potentially used to determine the candidate next-hop gateway IP addresses, are not trusted to be secure enough for TLS peername verification. Instead, the default name verified in the server certificate is obtained directly from the next-hop, or is explicitly specified via the optional match attribute which overrides the main.cf smtp_tls_secure_cert_match parameter. In the policy table, multiple match patterns and strategies must be separated by colons. The match attribute is most useful when multiple domains are supported by common server, the policy entries for additional domains specify matching rules for the primary domain certificate. While transport table overrides routing the secondary domains to the primary nexthop also allow secure verification, they risk delivery to the wrong destination when domains change hands or are re-assigned to new gateways. With the "match" attribute approach, routing is not perturbed, and mail is deferred if verification of a new MX host fails. |
Example:
/etc/postfix/main.cf:
smtp_tls_policy_maps = hash:/etc/postfix/tls_policy
# Postfix 2.5 and later
smtp_tls_fingerprint_digest = md5
/etc/postfix/tls_policy:
example.edu none
example.mil may
example.gov encrypt protocols=TLSv1
example.com verify ciphers=high
example.net secure
.example.net secure match=.example.net:example.net
[mail.example.org]:587 secure match=nexthop
# Postfix 2.5 and later
[thumb.example.org] fingerprint
match=EC:3B:2D:B0:5B:B1:FB:6D:20:A3:9D:72:F6:8D:12:35
match=3D:95:34:51:24:66:33:B9:D2:40:99:C0:C1:17:0B:D1
Note: The hostname strategy if listed in a non-default setting of smtp_tls_secure_cert_match or in the match attribute in the policy table can render the secure level vulnerable to DNS forgery. Do not use the hostname strategy for secure-channel configurations in environments where DNS security is not assured.
This feature is available in Postfix 2.3 and later.
In main.cf the values are separated by whitespace, commas or colons. In the policy table (see smtp_tls_policy_maps) the only valid separator is colon. An empty value means allow all protocols. The valid protocol names, (see \fBfBSSL_get_version(3)), are "SSLv2", "SSLv3" and "TLSv1".
To include a protocol list its name, to exclude it, prefix the name with a "!" character. To exclude SSLv2 even for opportunistic TLS set "smtp_tls_protocols = !SSLv2". To exclude both "SSLv2" and "SSLv3" set "smtp_tls_protocols = !SSLv2, !SSLv3". Explicitly listing the protocols to include, is supported, but not recommended. OpenSSL provides no mechanisms for excluding protocols not known at compile-time. If Postfix is linked against an OpenSSL library that supports additional protocol versions, they cannot be excluded using either syntax.
Example:
# TLSv1 only!
smtp_tls_protocols = !SSLv2, !SSLv3
This feature is available in Postfix 2.6 and later.
The default verification depth is 9 (the OpenSSL default) for compatibility with earlier Postfix behavior. Prior to Postfix 2.5, the default value was 5, but the limit was not actually enforced. If you have set this to a lower non-default value, certificates with longer trust chains may now fail to verify. Certificate chains with 1 or 2 CAs are common, deeper chains are more rare and any number between 5 and 9 should suffice in practice. You can choose a lower number if, for example, you trust certificates directly signed by an issuing CA but not any CAs it delegates to.
This feature is available in Postfix 2.2 and later.
This parameter specifies one or more patterns or strategies separated by commas, whitespace or colons. In the policy table the only valid separator is the colon character.
For a description of the pattern and strategy syntax see the smtp_tls_verify_cert_match parameter. The "hostname" strategy should be avoided in this context, as in the absence of a secure global DNS, using the results of MX lookups in certificate verification is not immune to active (man-in-the-middle) attacks on DNS.
Sample main.cf setting:
Sample policy table override:
This feature is available in Postfix 2.3 and later.
Specify one of the following security levels:
none | TLS will not be used unless enabled for specific destinations via smtp_tls_policy_maps. |
may | Opportunistic TLS. Use TLS if this is supported by the remote SMTP server, otherwise use plaintext. Since sending in the clear is acceptable, demanding stronger than default TLS security merely reduces inter-operability. The "smtp_tls_ciphers" and "smtp_tls_protocols" (Postfix >= 2.6) configuration parameters provide control over the protocols and cipher grade used with opportunistic TLS. With earlier releases the opportunistic TLS cipher grade is always "export" and no protocols are disabled. When TLS handshakes fail, the connection is retried with TLS disabled. This allows mail delivery to sites with non-interoperable TLS implementations. |
encrypt | Mandatory TLS encryption. Since a minimum level of security is intended, it is reasonable to be specific about sufficiently secure protocol versions and ciphers. At this security level and higher, the main.cf parameters smtp_tls_mandatory_protocols and smtp_tls_mandatory_ciphers specify the TLS protocols and minimum cipher grade which the administrator considers secure enough for mandatory encrypted sessions. This security level is not an appropriate default for systems delivering mail to the Internet. |
fingerprint | Certificate fingerprint verification. Available with Postfix 2.5 and later. At this security level, there are no trusted certificate authorities. The certificate trust chain, expiration date, ... are not checked. Instead, the smtp_tls_fingerprint_cert_match parameter lists the valid "fingerprints" of the server certificate. The digest algorithm used to calculate the fingerprint is selected by the smtp_tls_fingerprint_digest parameter. |
verify | Mandatory TLS verification. At this security level, DNS MX lookups are trusted to be secure enough, and the name verified in the server certificate is usually obtained indirectly via unauthenticated DNS MX lookups. The smtp_tls_verify_cert_match parameter controls how the server name is verified. In practice explicit control over matching is more common at the "secure" level, described below. This security level is not an appropriate default for systems delivering mail to the Internet. |
secure | Secure-channel TLS. At this security level, DNS MX lookups, though potentially used to determine the candidate next-hop gateway IP addresses, are not trusted to be secure enough for TLS peername verification. Instead, the default name verified in the server certificate is obtained from the next-hop domain as specified in the smtp_tls_secure_cert_match configuration parameter. The default matching rule is that a server certificate matches when its name is equal to or is a sub-domain of the nexthop domain. This security level is not an appropriate default for systems delivering mail to the Internet. |
Examples:
# No TLS. Formerly: smtp_use_tls=no and smtp_enforce_tls=no.
smtp_tls_security_level = none
# Opportunistic TLS.
smtp_tls_security_level = may
# Postfix >= 2.6:
# Do not tweak opportunistic ciphers or protocol unless it is essential
# to do so (if a security vulnerability is found in the SSL library that
# can be mitigated by disabling a particular protocol or raising the
# cipher grade from "export" to "low" or "medium").
smtp_tls_ciphers = export
smtp_tls_protocols = !SSLv2
# Mandatory (high-grade) TLS encryption.
smtp_tls_security_level = encrypt
smtp_tls_mandatory_ciphers = high
# Mandatory TLS verification of hostname or nexthop domain.
smtp_tls_security_level = verify
smtp_tls_mandatory_ciphers = high
smtp_tls_verify_cert_match = hostname, nexthop, dot-nexthop
# Secure channel TLS with exact nexthop name match.
smtp_tls_security_level = secure
smtp_tls_mandatory_protocols = TLSv1
smtp_tls_mandatory_ciphers = high
smtp_tls_secure_cert_match = nexthop
# Certificate fingerprint verification (Postfix >= 2.5).
# The CA-less "fingerprint" security level only scales to a limited
# number of destinations. As a global default rather than a per-site
# setting, this is practical when mail for all recipients is sent
# to a central mail hub.
relayhost = [mailhub.example.com]
smtp_tls_security_level = fingerprint
smtp_tls_mandatory_protocols = !SSLv2, !SSLv3
smtp_tls_mandatory_ciphers = high
smtp_tls_fingerprint_cert_match =
3D:95:34:51:24:66:33:B9:D2:40:99:C0:C1:17:0B:D1
EC:3B:2D:B0:5B:B1:FB:6D:20:A3:9D:72:F6:8D:12:35
This feature is available in Postfix 2.3 and later.
Note: dbm databases are not suitable. TLS session objects are too large.
As of version 2.5, Postfix no longer uses root privileges when opening this file. The file should now be stored under the Postfix-owned data_directory. As a migration aid, an attempt to open the file under a non-Postfix directory is redirected to the Postfix-owned data_directory, and a warning is logged.
Example:
smtp_tls_session_cache_database = btree:/var/db/postfix/smtp_scache
This feature is available in Postfix 2.2 and later.
This feature is available in Postfix 2.2 and later.
This parameter specifies one or more patterns or strategies separated by commas, whitespace or colons. In the policy table the only valid separator is the colon character.
Patterns specify domain names, or domain name suffixes:
example.com | Match the example.com domain, i.e. one of the names the server certificate must be example.com, upper and lower case distinctions are ignored. |
.example.com | Match subdomains of the example.com domain, i.e. match a name in the server certificate that consists of a non-zero number of labels followed by a .example.com suffix. Case distinctions are ignored. |
Strategies specify a transformation from the next-hop domain to the expected name in the server certificate:
nexthop | Match against the next-hop domain, which is either the recipient domain, or the transport next-hop configured for the domain stripped of any optional socket type prefix, enclosing square brackets and trailing port. When MX lookups are not suppressed, this is the original nexthop domain prior to the MX lookup, not the result of the MX lookup. For LMTP delivery via UNIX-domain sockets, the verified next-hop name is $myhostname. This strategy is suitable for use with the "secure" policy. Case is ignored. |
dot-nexthop | As above, but match server certificate names that are subdomains of the next-hop domain. Case is ignored. |
hostname | Match against the hostname of the server, often obtained via an unauthenticated DNS MX lookup. For LMTP delivery via UNIX-domain sockets, the verified name is $myhostname. This matches the verification strategy of the "MUST" keyword in the obsolete smtp_tls_per_site table, and is suitable for use with the "verify" security level. When the next-hop name is enclosed in square brackets to suppress MX lookups, the "hostname" strategy is the same as the "nexthop" strategy. Case is ignored. |
Sample main.cf setting:
smtp_tls_verify_cert_match = hostname, nexthop, dot-nexthop
Sample policy table override:
example.com verify match=hostname:nexthop
.example.com verify match=example.com:.example.com:hostname
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.2 and later. With Postfix 2.3 and later use smtp_tls_security_level instead.
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is s (seconds).
This feature is available in Postfix 2.1 and later.
By default, no clients are allowed to specify XVERP.
This parameter was renamed with Postfix version 2.1. The default value is backwards compatible with Postfix version 2.0.
Specify a list of network/netmask patterns, separated by commas and/or whitespace. The mask specifies the number of bits in the network part of a host address. You can also specify hostnames or .domain names (the initial dot causes the domain to match any name below it), "/file/name" or "type:table" patterns. A "/file/name" pattern is replaced by its contents; a "type:table" lookup table is matched when a table entry matches a lookup string (the lookup result is ignored). Continue long lines by starting the next line with whitespace. Specify "!pattern" to exclude an address or network block from the list. The form "!/file/name" is supported only in Postfix version 2.4 and later.
Note: IP version 6 address information must be specified inside [] in the smtpd_authorized_verp_clients value, and in files specified with "/file/name". IP version 6 addresses contain the ":" character, and would otherwise be confused with a "type:table" pattern.
This feature is available in Postfix 2.1 and later.
By default, no clients are allowed to specify XCLIENT.
Specify a list of network/netmask patterns, separated by commas and/or whitespace. The mask specifies the number of bits in the network part of a host address. You can also specify hostnames or .domain names (the initial dot causes the domain to match any name below it), "/file/name" or "type:table" patterns. A "/file/name" pattern is replaced by its contents; a "type:table" lookup table is matched when a table entry matches a lookup string (the lookup result is ignored). Continue long lines by starting the next line with whitespace. Specify "!pattern" to exclude an address or network block from the list. The form "!/file/name" is supported only in Postfix version 2.4 and later.
Note: IP version 6 address information must be specified inside [] in the smtpd_authorized_xclient_hosts value, and in files specified with "/file/name". IP version 6 addresses contain the ":" character, and would otherwise be confused with a "type:table" pattern.
This feature is available in Postfix 2.1 and later.
By default, no clients are allowed to specify XFORWARD.
Specify a list of network/netmask patterns, separated by commas and/or whitespace. The mask specifies the number of bits in the network part of a host address. You can also specify hostnames or .domain names (the initial dot causes the domain to match any name below it), "/file/name" or "type:table" patterns. A "/file/name" pattern is replaced by its contents; a "type:table" lookup table is matched when a table entry matches a lookup string (the lookup result is ignored). Continue long lines by starting the next line with whitespace. Specify "!pattern" to exclude an address or network block from the list. The form "!/file/name" is supported only in Postfix version 2.4 and later.
Note: IP version 6 address information must be specified inside [] in the smtpd_authorized_xforward_hosts value, and in files specified with "/file/name". IP version 6 addresses contain the ":" character, and would otherwise be confused with a "type:table" pattern.
You MUST specify $myhostname at the start of the text. This is required by the SMTP protocol.
Example:
smtpd_banner = $myhostname ESMTP $mail_name ($mail_version)
To disable this feature, specify a limit of 0.
WARNING: The purpose of this feature is to limit abuse. It must not be used to regulate legitimate mail traffic.
This feature is available in Postfix 2.2 and later.
By default, a client can make as many connections per time unit as Postfix can accept.
To disable this feature, specify a limit of 0.
WARNING: The purpose of this feature is to limit abuse. It must not be used to regulate legitimate mail traffic.
This feature is available in Postfix 2.2 and later.
Example:
smtpd_client_connection_rate_limit = 1000
By default, clients in trusted networks are excluded. Specify a list of network blocks, hostnames or .domain names (the initial dot causes the domain to match any name below it).
Note: IP version 6 address information must be specified inside [] in the smtpd_client_event_limit_exceptions value, and in files specified with "/file/name". IP version 6 addresses contain the ":" character, and would otherwise be confused with a "type:table" pattern.
This feature is available in Postfix 2.2 and later.
By default, a client can send as many message delivery requests per time unit as Postfix can accept.
To disable this feature, specify a limit of 0.
WARNING: The purpose of this feature is to limit abuse. It must not be used to regulate legitimate mail traffic.
This feature is available in Postfix 2.2 and later.
Example:
smtpd_client_message_rate_limit = 1000
By default, a remote SMTP client can negotiate as many new TLS sessions per time unit as Postfix can accept.
To disable this feature, specify a limit of 0. Otherwise, specify a limit that is at least the per-client concurrent session limit, or else legitimate client sessions may be rejected.
WARNING: The purpose of this feature is to limit abuse. It must not be used to regulate legitimate mail traffic.
This feature is available in Postfix 2.3 and later.
Example:
smtpd_client_new_tls_session_rate_limit = 100
This feature is available in Postfix 2.5 and later.
By default, a client can send as many recipient addresses per time unit as Postfix can accept.
To disable this feature, specify a limit of 0.
WARNING: The purpose of this feature is to limit abuse. It must not be used to regulate legitimate mail traffic.
This feature is available in Postfix 2.2 and later.
Example:
smtpd_client_recipient_rate_limit = 1000
The default is to allow all connection requests.
Specify a list of restrictions, separated by commas and/or whitespace. Continue long lines by starting the next line with whitespace. Restrictions are applied in the order as specified; the first restriction that matches wins.
The following restrictions are specific to client hostname or client network address information.
check_ccert_access type:table | Use the client certificate fingerprint as lookup key for the specified access(5) database; with Postfix version 2.2, also require that the SMTP client certificate is verified successfully. The fingerprint digest algorithm is configurable via the smtpd_tls_fingerprint_digest parameter (hard-coded as md5 prior to Postfix version 2.5). This feature is available with Postfix version 2.2 and later. |
check_client_access type:table | Search the specified access database for the client hostname, parent domains, client IP address, or networks obtained by stripping least significant octets. See the access(5) manual page for details. |
check_client_mx_access type:table | Search the specified access(5) database for the MX hosts for the client hostname, and execute the corresponding action. Note: a result of "OK" is not allowed for safety reasons. Instead, use DUNNO in order to exclude specific hosts from blacklists. This feature is available in Postfix 2.7 and later. |
check_client_ns_access type:table | Search the specified access(5) database for the DNS servers for the client hostname, and execute the corresponding action. Note: a result of "OK" is not allowed for safety reasons. Instead, use DUNNO in order to exclude specific hosts from blacklists. This feature is available in Postfix 2.7 and later. |
check_reverse_client_hostname_access type:table | Search the specified access database for the unverified reverse client hostname, parent domains, client IP address, or networks obtained by stripping least significant octets. See the access(5) manual page for details. Note: a result of "OK" is not allowed for safety reasons. Instead, use DUNNO in order to exclude specific hosts from blacklists. This feature is available in Postfix 2.6 and later. |
check_reverse_client_hostname_mx_access type:table | Search the specified access(5) database for the MX hosts for the unverified reverse client hostname, and execute the corresponding action. Note: a result of "OK" is not allowed for safety reasons. Instead, use DUNNO in order to exclude specific hosts from blacklists. This feature is available in Postfix 2.7 and later. |
check_reverse_client_hostname_ns_access type:table | Search the specified access(5) database for the DNS servers for the unverified reverse client hostname, and execute the corresponding action. Note: a result of "OK" is not allowed for safety reasons. Instead, use DUNNO in order to exclude specific hosts from blacklists. This feature is available in Postfix 2.7 and later. |
permit_inet_interfaces | Permit the request when the client IP address matches $inet_interfaces. |
permit_mynetworks | Permit the request when the client IP address matches any network or network address listed in $mynetworks. |
permit_sasl_authenticated | Permit the request when the client is successfully authenticated via the RFC 4954 (AUTH) protocol. |
permit_tls_all_clientcerts | Permit the request when the remote SMTP client certificate is verified successfully. This option must be used only if a special CA issues the certificates and only this CA is listed as trusted CA. Otherwise, clients with a third-party certificate would also be allowed to relay. Specify "tls_append_default_CA = no" when the trusted CA is specified with smtpd_tls_CAfile or smtpd_tls_CApath, to prevent Postfix from appending the system-supplied default CAs. This feature is available with Postfix version 2.2. |
permit_tls_clientcerts | Permit the request when the remote SMTP client certificate fingerprint is listed in $relay_clientcerts. The fingerprint digest algorithm is configurable via the smtpd_tls_fingerprint_digest parameter (hard-coded as md5 prior to Postfix version 2.5). This feature is available with Postfix version 2.2. |
reject_rbl_client rbl_domain=d.d.d.d |
Reject the request when the reversed client network address is listed with the A record " d.d.d.d" under rbl_domain (Postfix version 2.1 and later only). Each " d" is a number, or a pattern inside "[]" that contains one or more ";"-separated numbers or number..number ranges (Postfix version 2.8 and later). If no " =d.d.d.d" is specified, reject the request when the reversed client network address is listed with any A record under rbl_domain. |
permit_dnswl_client dnswl_domain=d.d.d.d |
Accept the request when the reversed client network address is listed with the A record " d.d.d.d" under dnswl_domain. Each " d" is a number, or a pattern inside "[]" that contains one or more ";"-separated numbers or number..number ranges. If no " =d.d.d.d" is specified, accept the request when the reversed client network address is listed with any A record under dnswl_domain. |
reject_rhsbl_client rbl_domain=d.d.d.d | Reject the request when the client hostname is listed with the A record " d.d.d.d" under rbl_domain (Postfix version 2.1 and later only). Each " d" is a number, or a pattern inside "[]" that contains one or more ";"-separated numbers or number..number ranges (Postfix version 2.8 and later). If no " =d.d.d.d" is specified, reject the request when the client hostname is listed with any A record under rbl_domain. See the reject_rbl_client description above for additional RBL related configuration parameters. This feature is available in Postfix 2.0 and later; with Postfix version 2.8 and later, reject_rhsbl_reverse_client will usually produce better results. |
permit_rhswl_client rhswl_domain=d.d.d.d |
Accept the request when the client hostname is listed with the A record " d.d.d.d" under rhswl_domain. Each "d" is a number, or a pattern inside "[]" that contains one or more ";"-separated numbers or number..number ranges. If no " =d.d.d.d" is specified, accept the request when the client hostname is listed with any A record under rhswl_domain. |
reject_rhsbl_reverse_client rbl_domain=d.d.d.d | Reject the request when the unverified reverse client hostname is listed with the A record " d.d.d.d" under rbl_domain. Each " d" is a number, or a pattern inside "[]" that contains one or more ";"-separated numbers or number..number ranges. If no " =d.d.d.d" is specified, reject the request when the unverified reverse client hostname is listed with any A record under rbl_domain. See the reject_rbl_client description above for additional RBL related configuration parameters. This feature is available in Postfix 2.8 and later. |
reject_unknown_client_hostname (with Postfix < 2.3: reject_unknown_client) |
Reject the request when 1) the client IP address->name mapping fails, 2) the name->address mapping fails, or 3) the name->address mapping does not match the client IP address. |
reject_unknown_reverse_client_hostname |
Reject the request when the client IP address has no address->name mapping. |
In addition, you can use any of the following generic restrictions. These restrictions are applicable in any SMTP command context.
check_policy_service servername | Query the specified policy server. See the SMTPD_POLICY_README document for details. This feature is available in Postfix 2.1 and later. |
defer |
Defer the request. The client is told to try again later. This restriction is useful at the end of a restriction list, to make the default policy explicit. |
defer_if_permit | Defer the request if some later restriction would result in an explicit or implicit PERMIT action. This is useful when a blacklisting feature fails due to a temporary problem. This feature is available in Postfix version 2.1 and later. |
defer_if_reject | Defer the request if some later restriction would result in a REJECT action. This is useful when a whitelisting feature fails due to a temporary problem. This feature is available in Postfix version 2.1 and later. |
permit | Permit the request. This restriction is useful at the end of a restriction list, to make the default policy explicit. |
reject_multi_recipient_bounce |
Reject the request when the envelope sender is the null address, and the message has multiple envelope recipients. This usage has rare but legitimate applications: under certain conditions, multi-recipient mail that was posted with the DSN option NOTIFY=NEVER may be forwarded with the null sender address. |
reject_plaintext_session |
Reject the request when the connection is not encrypted. This restriction should not be used before the client has had a chance to negotiate encryption with the AUTH or STARTTLS commands. |
reject_unauth_pipelining |
Reject the request when the client sends SMTP commands ahead of time where it is not allowed, or when the client sends SMTP commands ahead of time without knowing that Postfix actually supports ESMTP command pipelining. This stops mail from bulk mail software that improperly uses ESMTP command pipelining in order to speed up deliveries. |
reject | Reject the request. This restriction is useful at the end of a restriction list, to make the default policy explicit. The reject_code configuration parameter specifies the response code for rejected requests (default: 554). |
sleep seconds |
Pause for the specified number of seconds and proceed with the next restriction in the list, if any. This may stop zombie mail when used as: /etc/postfix/main.cf: smtpd_client_restrictions = sleep 1, reject_unauth_pipelining smtpd_delay_reject = no This feature is available in Postfix 2.3. |
warn_if_reject | Change the meaning of the next restriction, so that it logs a warning instead of rejecting a request (look for logfile records that contain "reject_warning"). This is useful for testing new restrictions in a "live" environment without risking unnecessary loss of mail. |
Other restrictions that are valid in this context:
• | SMTP command specific restrictions that are described under the smtpd_helo_restrictions, smtpd_sender_restrictions or smtpd_recipient_restrictions parameters. When helo, sender or recipient restrictions are listed under smtpd_client_restrictions, they have effect only with "smtpd_delay_reject = yes", so that $smtpd_client_restrictions is evaluated at the time of the RCPT TO command. |
Example:
smtpd_client_restrictions = permit_mynetworks, reject_unknown_client_hostname
Specify the name of a "type:table" lookup table. The search string is the SMTP command as received from the remote SMTP client, except that initial whitespace and the trailing <CR><LF> are removed. The result value is executed by the Postfix SMTP server.
There is no need to use smtpd_command_filter for the following cases:
• | Use "resolve_numeric_domain = yes" to accept " user@ipaddress". |
• | Postfix already accepts the correct form " user@[ipaddress]". Use virtual_alias_maps or canonical_maps to translate these into domain names if necessary. |
• | Use "strict_rfc821_envelopes = no" to accept "RCPT TO:<User Name <user@example.com>>". Postfix will ignore the "User Name" part and deliver to the <user@example.com> address. |
Examples of problems that can be solved with the smtpd_command_filter feature:
/etc/postfix/main.cf:
smtpd_command_filter = pcre:/etc/postfix/command_filter
/etc/postfix/command_filter:
# Work around clients that send malformed HELO commands.
/^HELO\s*$/ HELO domain.invalid
# Work around clients that send empty lines.
/^\s*$/ NOOP
# Work around clients that send RCPT TO:<'user@domain'>.
# WARNING: do not lose the parameters that follow the address.
/^RCPT\s+TO:\s*<'([^[:space:]]+)'>(.*)/ RCPT TO:<$1>$2
# Bounce-never mail sink. Use notify_classes=bounce,resource,software
# to send bounced mail to the postmaster (with message body removed).
/^(RCPT\s+TO:.*?)\bNOTIFY=\S+\b(.*)/ $1 NOTIFY=NEVER $2
/^(RCPT\s+TO:.*)/ $1 NOTIFY=NEVER
This feature is available in Postfix 2.7.
This feature is available in Postfix 2.0 and later.
Specify a list of restrictions, separated by commas and/or whitespace. Continue long lines by starting the next line with whitespace. Restrictions are applied in the order as specified; the first restriction that matches wins.
The following restrictions are valid in this context:
• | Generic restrictions that can be used in any SMTP command context, described under smtpd_client_restrictions. |
• | SMTP command specific restrictions described under smtpd_client_restrictions, smtpd_helo_restrictions, smtpd_sender_restrictions or smtpd_recipient_restrictions. |
• | However, no recipient information is available in the case of multi-recipient mail. Acting on only one recipient would be misleading, because any decision will affect all recipients equally. Acting on all recipients would require a possibly very large amount of memory, and would also be misleading for the reasons mentioned before. |
Examples:
smtpd_data_restrictions = reject_unauth_pipelining
smtpd_data_restrictions = reject_multi_recipient_bounce
With sites that reject lots of mail, the default setting reduces the use of disk, CPU and memory resources. The downside is that rejected recipients are logged with NOQUEUE instead of a mail transaction ID. This complicates the logfile analysis of multi-recipient mail.
This feature is available in Postfix 2.3 and later.
This feature is turned on by default because some clients apparently mis-behave when the Postfix SMTP server rejects commands before RCPT TO.
The default setting has one major benefit: it allows Postfix to log recipient address information when rejecting a client name/address or sender address, so that it is possible to find out whose mail is being rejected.
This feature is available in Postfix 2.2 and later.
This feature is available in Postfix 2.2 and later.
Notes:
• | Specify the silent-discard pseudo keyword to prevent this action from being logged. |
• | Use the smtpd_discard_ehlo_keyword_address_maps feature to discard EHLO keywords selectively. |
This feature is available in Postfix 2.2 and later.
See smtpd_data_restrictions for details and limitations.
Note 1: "smtpd_enforce_tls = yes" implies "smtpd_tls_auth_only = yes".
Note 2: when invoked via "sendmail -bs", Postfix will never offer STARTTLS due to insufficient privileges to access the server private key. This is intended behavior.
This feature is available in Postfix 2.2 and later. With Postfix 2.3 and later use smtpd_tls_security_level instead.
With Postfix version 2.0 and earlier: the SMTP server delay before sending a reject (4xx or 5xx) response, when the client has made fewer than $smtpd_soft_error_limit errors without delivering mail.
The Postfix ETRN implementation accepts only destinations that are eligible for the Postfix "fast flush" service. See the ETRN_README file for details.
Specify a list of restrictions, separated by commas and/or whitespace. Continue long lines by starting the next line with whitespace. Restrictions are applied in the order as specified; the first restriction that matches wins.
The following restrictions are specific to the domain name information received with the ETRN command.
check_etrn_access type:table | Search the specified access database for the ETRN domain name or its parent domains. See the access(5) manual page for details. |
Other restrictions that are valid in this context:
• | Generic restrictions that can be used in any SMTP command context, described under smtpd_client_restrictions. |
• | SMTP command specific restrictions described under smtpd_client_restrictions and smtpd_helo_restrictions. |
Example:
smtpd_etrn_restrictions = permit_mynetworks, reject
This parameter is not subjected to $parameter expansion.
This feature is available in Postfix 2.0 and later.
This feature is available in Postfix 2.2 and later.
Example:
smtpd_helo_required = yes
The default is to permit everything.
Note: specify "smtpd_helo_required = yes" to fully enforce this restriction (without "smtpd_helo_required = yes", a client can simply skip smtpd_helo_restrictions by not sending HELO or EHLO).
Specify a list of restrictions, separated by commas and/or whitespace. Continue long lines by starting the next line with whitespace. Restrictions are applied in the order as specified; the first restriction that matches wins.
The following restrictions are specific to the hostname information received with the HELO or EHLO command.
check_helo_access type:table | Search the specified access(5) database for the HELO or EHLO hostname or parent domains, and execute the corresponding action. Note: specify "smtpd_helo_required = yes" to fully enforce this restriction (without "smtpd_helo_required = yes", a client can simply skip check_helo_access by not sending HELO or EHLO). |
check_helo_mx_access type:table | Search the specified access(5) database for the MX hosts for the HELO or EHLO hostname, and execute the corresponding action. Note 1: a result of "OK" is not allowed for safety reasons. Instead, use DUNNO in order to exclude specific hosts from blacklists. Note 2: specify "smtpd_helo_required = yes" to fully enforce this restriction (without "smtpd_helo_required = yes", a client can simply skip check_helo_mx_access by not sending HELO or EHLO). This feature is available in Postfix 2.1 and later. |
check_helo_ns_access type:table | Search the specified access(5) database for the DNS servers for the HELO or EHLO hostname, and execute the corresponding action. Note 1: a result of "OK" is not allowed for safety reasons. Instead, use DUNNO in order to exclude specific hosts from blacklists. Note 2: specify "smtpd_helo_required = yes" to fully enforce this restriction (without "smtpd_helo_required = yes", a client can simply skip check_helo_ns_access by not sending HELO or EHLO). This feature is available in Postfix 2.1 and later. |
reject_invalid_helo_hostname (with Postfix < 2.3: reject_invalid_hostname) |
Reject the request when the HELO or EHLO hostname syntax is invalid. Note: specify "smtpd_helo_required = yes" to fully enforce this restriction (without "smtpd_helo_required = yes", a client can simply skip reject_invalid_helo_hostname by not sending HELO or EHLO). |
reject_non_fqdn_helo_hostname (with Postfix < 2.3: reject_non_fqdn_hostname) |
Reject the request when the HELO or EHLO hostname is not in fully-qualified domain form, as required by the RFC. Note: specify "smtpd_helo_required = yes" to fully enforce this restriction (without "smtpd_helo_required = yes", a client can simply skip reject_non_fqdn_helo_hostname by not sending HELO or EHLO). |
reject_rhsbl_helo rbl_domain=d.d.d.d | Reject the request when the HELO or EHLO hostname hostname is listed with the A record " d.d.d.d" under rbl_domain (Postfix version 2.1 and later only). Each " d" is a number, or a pattern inside "[]" that contains one or more ";"-separated numbers or number..number ranges (Postfix version 2.8 and later). If no " =d.d.d.d" is specified, reject the request when the HELO or EHLO hostname is listed with any A record under rbl_domain. See the reject_rbl_client description for additional RBL related configuration parameters. Note: specify "smtpd_helo_required = yes" to fully enforce this restriction (without "smtpd_helo_required = yes", a client can simply skip reject_rhsbl_helo by not sending HELO or EHLO). This feature is available in Postfix 2.0 and later. |
reject_unknown_helo_hostname (with Postfix < 2.3: reject_unknown_hostname) |
Reject the request when the HELO or EHLO hostname has no DNS A or MX record. |
Other restrictions that are valid in this context:
• | Generic restrictions that can be used in any SMTP command context, described under smtpd_client_restrictions. |
• | Client hostname or network address specific restrictions described under smtpd_client_restrictions. |
• | SMTP command specific restrictions described under smtpd_sender_restrictions or smtpd_recipient_restrictions. When sender or recipient restrictions are listed under smtpd_helo_restrictions, they have effect only with "smtpd_delay_reject = yes", so that $smtpd_helo_restrictions is evaluated at the time of the RCPT TO command. |
Examples:
smtpd_helo_restrictions = permit_mynetworks, reject_invalid_helo_hostname
smtpd_helo_restrictions = permit_mynetworks, reject_unknown_helo_hostname
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.1 and later.
This feature is available in Postfix 2.1 and later.
This feature is available in Postfix 2.1 and later.
This feature is available in Postfix 2.1 and later.
Specify "host:port" or "inet:host:port" for a TCP endpoint, or "unix:pathname" for a UNIX-domain endpoint. The host can be specified as an IP address or as a symbolic name; no MX lookups are done. When no "host" or "host:" are specified, the local machine is assumed. Pathname interpretation is relative to the Postfix queue directory.
This feature is available in Postfix 2.1 and later.
The "inet:" and "unix:" prefixes are available in Postfix 2.3 and later.
speed_adjust | Do not connect to a before-queue content filter until an entire message has been received. This reduces the number of simultaneous before-queue content filter processes. |
NOTE 1: A filter must not selectively reject recipients of a multi-recipient message. Rejecting all recipients is OK, as is accepting all recipients.
NOTE 2: This feature increases the minimum amount of free queue space by $message_size_limit. The extra space is needed to save the message to a temporary file.
This feature is available in Postfix 2.7 and later.
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is s (seconds).
This feature is available in Postfix 2.1 and later.
By default, the Postfix SMTP server accepts:
• | Mail from clients whose IP address matches $mynetworks, or: |
• | Mail to remote destinations that match $relay_domains, except for addresses that contain sender-specified routing (user@elsewhere@domain), or: |
• | Mail to local destinations that match $inet_interfaces or $proxy_interfaces, $mydestination, $virtual_alias_domains, or $virtual_mailbox_domains. |
IMPORTANT: If you change this parameter setting, you must specify at least one of the following restrictions. Otherwise Postfix will refuse to receive mail:
Specify a list of restrictions, separated by commas and/or whitespace. Continue long lines by starting the next line with whitespace. Restrictions are applied in the order as specified; the first restriction that matches wins.
The following restrictions are specific to the recipient address that is received with the RCPT TO command.
check_recipient_access type:table | Search the specified access(5) database for the resolved RCPT TO address, domain, parent domains, or localpart@, and execute the corresponding action. |
check_recipient_mx_access type:table | Search the specified access(5) database for the MX hosts for the RCPT TO domain, and execute the corresponding action. Note: a result of "OK" is not allowed for safety reasons. Instead, use DUNNO in order to exclude specific hosts from blacklists. This feature is available in Postfix 2.1 and later. |
check_recipient_ns_access type:table | Search the specified access(5) database for the DNS servers for the RCPT TO domain, and execute the corresponding action. Note: a result of "OK" is not allowed for safety reasons. Instead, use DUNNO in order to exclude specific hosts from blacklists. This feature is available in Postfix 2.1 and later. |
permit_auth_destination | Permit the request when one of the following is true: |
• | Postfix is mail forwarder: the resolved RCPT TO domain matches $relay_domains or a subdomain thereof, and the address contains no sender-specified routing (user@elsewhere@domain), |
• | Postfix is the final destination: the resolved RCPT TO domain matches $mydestination, $inet_interfaces, $proxy_interfaces, $virtual_alias_domains, or $virtual_mailbox_domains, and the address contains no sender-specified routing (user@elsewhere@domain). |
permit_mx_backup | Permit the request when the local mail system is backup MX for the RCPT TO domain, or when the domain is an authorized destination (see permit_auth_destination for definition). |
• | Safety: permit_mx_backup does not accept addresses that have sender-specified routing information (example: user@elsewhere@domain). |
• | Safety: permit_mx_backup can be vulnerable to mis-use when access is not restricted with permit_mx_backup_networks. |
• | Safety: as of Postfix version 2.3, permit_mx_backup no longer accepts the address when the local mail system is primary MX for the recipient domain. Exception: permit_mx_backup accepts the address when it specifies an authorized destination (see permit_auth_destination for definition). |
• | Limitation: mail may be rejected in case of a temporary DNS lookup problem with Postfix prior to version 2.0. |
reject_non_fqdn_recipient |
Reject the request when the RCPT TO address is not in fully-qualified domain form, as required by the RFC. |
reject_rhsbl_recipient rbl_domain=d.d.d.d |
Reject the request when the RCPT TO domain is listed with the A record " d.d.d.d" under rbl_domain (Postfix version 2.1 and later only). Each " d" is a number, or a pattern inside "[]" that contains one or more ";"-separated numbers or number..number ranges (Postfix version 2.8 and later). If no " =d.d.d.d" is specified, reject the request when the RCPT TO domain is listed with any A record under rbl_domain. |
reject_unauth_destination | Reject the request unless one of the following is true: |
• | Postfix is mail forwarder: the resolved RCPT TO domain matches $relay_domains or a subdomain thereof, and contains no sender-specified routing (user@elsewhere@domain), |
• |
Postfix is the final destination: the resolved RCPT TO domain matches $mydestination, $inet_interfaces, $proxy_interfaces, $virtual_alias_domains, or $virtual_mailbox_domains, and contains no sender-specified routing (user@elsewhere@domain). The relay_domains_reject_code parameter specifies the response code for rejected requests (default: 554). |
reject_unknown_recipient_domain |
Reject the request when Postfix is not final destination for the recipient domain, and the RCPT TO domain has no DNS A or MX record, or when it has a malformed MX record such as a record with a zero-length MX hostname (Postfix version 2.3 and later). |
reject_unlisted_recipient (with Postfix version 2.0: check_recipient_maps) | Reject the request when the RCPT TO address is not listed in the list of valid recipients for its domain class. See the smtpd_reject_unlisted_recipient parameter description for details. This feature is available in Postfix 2.1 and later. |
reject_unverified_recipient |
Reject the request when mail to the RCPT TO address is known to bounce, or when the recipient address destination is not reachable. Address verification information is managed by the verify(8) server; see the ADDRESS_VERIFICATION_README file for details. |
Other restrictions that are valid in this context:
• | Generic restrictions that can be used in any SMTP command context, described under smtpd_client_restrictions. |
• | SMTP command specific restrictions described under smtpd_client_restrictions, smtpd_helo_restrictions and smtpd_sender_restrictions. |
Example:
smtpd_recipient_restrictions = permit_mynetworks, reject_unauth_destination
Example:
/etc/postfix/main.cf:
smtpd_reject_footer = For assistance, call 800-555-0101.
Please provide the following information in your problem report:
time ($localtime), client ($client_address) and server
($server_name).
Server response:
550-5.5.1 <user@example> Recipient address rejected: User unknown
550 5.5.1 For assistance, call 800-555-0101. Please provide the
following information in your problem report: time (Jan 4 15:42:00),
client (192.168.1.248) and server (mail1.example.com).
Note: the above text is meant to make it easier to find the Postfix logfile records for a failed SMTP session. The text itself is not logged to the Postfix SMTP server's maillog file.
Be sure to keep the text as short as possible. Long text may be truncated before it is logged to the remote SMTP client's maillog file, or before it is returned to the sender in a delivery status notification.
This feature supports a limited number of $name attributes in the footer text. These are replaced by their current value for the SMTP session:
client_address | The Client IP address that is logged in the maillog file. |
client_port | The client TCP port that is logged in the maillog file. |
localtime | The server local time (Mmm dd hh:mm:ss) that is logged in the maillog file. |
server_name | The server's myhostname value. This attribute is made available for sites with multiple MTAs (perhaps behind a load-balancer), where the server name can help the server support team to quickly find the right log files. |
Notes:
• | NOT SUPPORTED are other attributes such as sender, recipient, or main.cf parameters. |
• | For safety reasons, text that does not match $smtpd_expansion_filter is censored. |
This feature supports the two-character sequence \n as a request for a line break in the footer text. Postfix automatically inserts after each line break the three-digit SMTP reply code (and optional enhanced status code) from the original Postfix reject message.
This feature is available in Postfix 2.8 and later.
An address is always considered "known" when it matches a virtual(5) alias or a canonical(5) mapping.
• | The recipient domain matches $mydestination, $inet_interfaces or $proxy_interfaces, but the recipient is not listed in $local_recipient_maps, and $local_recipient_maps is not null. |
• | The recipient domain matches $virtual_alias_domains but the recipient is not listed in $virtual_alias_maps. |
• | The recipient domain matches $virtual_mailbox_domains but the recipient is not listed in $virtual_mailbox_maps, and $virtual_mailbox_maps is not null. |
• | The recipient domain matches $relay_domains but the recipient is not listed in $relay_recipient_maps, and $relay_recipient_maps is not null. |
This feature is available in Postfix 2.1 and later.
An address is always considered "known" when it matches a virtual(5) alias or a canonical(5) mapping.
• | The sender domain matches $mydestination, $inet_interfaces or $proxy_interfaces, but the sender is not listed in $local_recipient_maps, and $local_recipient_maps is not null. |
• | The sender domain matches $virtual_alias_domains but the sender is not listed in $virtual_alias_maps. |
• | The sender domain matches $virtual_mailbox_domains but the sender is not listed in $virtual_mailbox_maps, and $virtual_mailbox_maps is not null. |
• | The sender domain matches $relay_domains but the sender is not listed in $relay_recipient_maps, and $relay_recipient_maps is not null. |
This feature is available in Postfix 2.1 and later.
One major application is for implementing per-recipient UCE control. See the RESTRICTION_CLASS_README document for other examples.
This feature is available in Postfix 2.1 and 2.2. With Postfix 2.3 it was renamed to smtpd_sasl_path.
If a remote SMTP client is authenticated, the permit_sasl_authenticated access restriction can be used to permit relay access, like this:
To reject all SMTP connections from unauthenticated clients, specify "smtpd_delay_reject = yes" (which is the default) and use:
See the SASL_README file for SASL configuration and operation details.
This feature is available in Postfix 2.3 and later.
Some clients (Netscape 4 at least) have a bug that causes them to require a login and password whenever AUTH is offered, whether it's necessary or not. To work around this, specify, for example, $mynetworks to prevent Postfix from offering AUTH to local clients.
Specify a list of network/netmask patterns, separated by commas and/or whitespace. The mask specifies the number of bits in the network part of a host address. You can also "/file/name" or "type:table" patterns. A "/file/name" pattern is replaced by its contents; a "type:table" lookup table is matched when a table entry matches a lookup string (the lookup result is ignored). Continue long lines by starting the next line with whitespace. Specify "!pattern" to exclude an address or network block from the list. The form "!/file/name" is supported only in Postfix version 2.4 and later.
Note: IP version 6 address information must be specified inside [] in the smtpd_sasl_exceptions_networks value, and in files specified with "/file/name". IP version 6 addresses contain the ":" character, and would otherwise be confused with a "type:table" pattern.
Example:
smtpd_sasl_exceptions_networks = $mynetworks
This feature is available in Postfix 2.1 and later.
By default, the local authentication realm name is the null string.
Examples:
smtpd_sasl_local_domain = $mydomain
smtpd_sasl_local_domain = $myhostname
This feature is available in Postfix 2.3 and later. In earlier releases it was called smtpd_sasl_application_name.
The following security features are defined for the cyrus server SASL implementation:
Restrict what authentication mechanisms the Postfix SMTP server will offer to the client. The list of available authentication mechanisms is system dependent.
Specify zero or more of the following:
noplaintext | Disallow methods that use plaintext passwords. |
noactive | Disallow methods subject to active (non-dictionary) attack. |
nodictionary | Disallow methods subject to passive (dictionary) attack. |
noanonymous | Disallow methods that allow anonymous authentication. |
forward_secrecy | Only allow methods that support forward secrecy (Dovecot only). |
mutual_auth | Only allow methods that provide mutual authentication (not available with Cyrus SASL version 1). |
By default, the Postfix SMTP server accepts plaintext passwords but not anonymous logins.
Warning: it appears that clients try authentication methods in the order as advertised by the server (e.g., PLAIN ANONYMOUS CRAM-MD5) which means that if you disable plaintext passwords, clients will log in anonymously, even when they should be able to use CRAM-MD5. So, if you disable plaintext logins, disable anonymous logins too. Postfix treats anonymous login as no authentication.
Example:
smtpd_sasl_security_options = noanonymous, noplaintext
This feature is available in Postfix 2.2 and later.
This feature is available in Postfix 2.3 and later.
Specify zero or more "type:table" lookup tables. With lookups from indexed files such as DB or DBM, or from networked tables such as NIS, LDAP or SQL, the following search operations are done with a sender address of user@domain:
1) user@domain | This table lookup is always done and has the highest precedence. |
2) user | This table lookup is done only when the domain part of the sender address matches $myorigin, $mydestination, $inet_interfaces or $proxy_interfaces. |
3) @domain | This table lookup is done last and has the lowest precedence. |
In all cases the result of table lookup must be either "not found" or a list of SASL login names separated by comma and/or whitespace.
The default is to permit everything.
Specify a list of restrictions, separated by commas and/or whitespace. Continue long lines by starting the next line with whitespace. Restrictions are applied in the order as specified; the first restriction that matches wins.
The following restrictions are specific to the sender address received with the MAIL FROM command.
check_sender_access type:table | Search the specified access(5) database for the MAIL FROM address, domain, parent domains, or localpart@, and execute the corresponding action. |
check_sender_mx_access type:table | Search the specified access(5) database for the MX hosts for the MAIL FROM address, and execute the corresponding action. Note: a result of "OK" is not allowed for safety reasons. Instead, use DUNNO in order to exclude specific hosts from blacklists. This feature is available in Postfix 2.1 and later. |
check_sender_ns_access type:table | Search the specified access(5) database for the DNS servers for the MAIL FROM address, and execute the corresponding action. Note: a result of "OK" is not allowed for safety reasons. Instead, use DUNNO in order to exclude specific hosts from blacklists. This feature is available in Postfix 2.1 and later. |
reject_authenticated_sender_login_mismatch | Enforces the reject_sender_login_mismatch restriction for authenticated clients only. This feature is available in Postfix version 2.1 and later. |
reject_non_fqdn_sender |
Reject the request when the MAIL FROM address is not in fully-qualified domain form, as required by the RFC. |
reject_rhsbl_sender rbl_domain=d.d.d.d |
Reject the request when the MAIL FROM domain is listed with the A record " d.d.d.d" under rbl_domain (Postfix version 2.1 and later only). Each " d" is a number, or a pattern inside "[]" that contains one or more ";"-separated numbers or number..number ranges (Postfix version 2.8 and later). If no " =d.d.d.d" is specified, reject the request when the MAIL FROM domain is listed with any A record under rbl_domain. |
reject_sender_login_mismatch | Reject the request when $smtpd_sender_login_maps specifies an owner for the MAIL FROM address, but the client is not (SASL) logged in as that MAIL FROM address owner; or when the client is (SASL) logged in, but the client login name doesn't own the MAIL FROM address according to $smtpd_sender_login_maps. |
reject_unauthenticated_sender_login_mismatch | Enforces the reject_sender_login_mismatch restriction for unauthenticated clients only. This feature is available in Postfix version 2.1 and later. |
reject_unknown_sender_domain |
Reject the request when Postfix is not final destination for the sender address, and the MAIL FROM address has no DNS A or MX record, or when it has a malformed MX record such as a record with a zero-length MX hostname (Postfix version 2.3 and later). |
reject_unlisted_sender | Reject the request when the MAIL FROM address is not listed in the list of valid recipients for its domain class. See the smtpd_reject_unlisted_sender parameter description for details. This feature is available in Postfix 2.1 and later. |
reject_unverified_sender |
Reject the request when mail to the MAIL FROM address is known to bounce, or when the sender address destination is not reachable. Address verification information is managed by the verify(8) server; see the ADDRESS_VERIFICATION_README file for details. |
Other restrictions that are valid in this context:
• | Generic restrictions that can be used in any SMTP command context, described under smtpd_client_restrictions. |
• | SMTP command specific restrictions described under smtpd_client_restrictions and smtpd_helo_restrictions. |
• | SMTP command specific restrictions described under smtpd_recipient_restrictions. When recipient restrictions are listed under smtpd_sender_restrictions, they have effect only with "smtpd_delay_reject = yes", so that $smtpd_sender_restrictions is evaluated at the time of the RCPT TO command. |
Examples:
smtpd_sender_restrictions = reject_unknown_sender_domain
smtpd_sender_restrictions = reject_unknown_sender_domain,
check_sender_access hash:/etc/postfix/access
This feature is available in Postfix 2.8.
• | With Postfix version 2.1 and later, the Postfix SMTP server delays all responses by $smtpd_error_sleep_time seconds. |
• | With Postfix versions 2.0 and earlier, the Postfix SMTP server delays all responses by (number of errors) seconds. |
This feature is available in Postfix 2.2 and later.
Note: if you set SMTP time limits to very large values you may have to update the global ipc_timeout parameter.
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is s (seconds).
Specify "tls_append_default_CA = no" to prevent Postfix from appending the system-supplied default CAs and trusting third-party certificates.
By default (see smtpd_tls_ask_ccert), client certificates are not requested, and smtpd_tls_CAfile should remain empty. If you do make use of client certificates, the distinguished names (DNs) of the certificate authorities listed in smtpd_tls_CAfile are sent to the remote SMTP client in the client certificate request message. MUAs with multiple client certificates may use the list of preferred certificate authorities to select the correct client certificate. You may want to put your "preferred" CA or CAs in this file, and install other trusted CAs in $smtpd_tls_CApath.
Example:
smtpd_tls_CAfile = /etc/postfix/CAcert.pem
This feature is available in Postfix 2.2 and later.
Specify "tls_append_default_CA = no" to prevent Postfix from appending the system-supplied default CAs and trusting third-party certificates.
By default (see smtpd_tls_ask_ccert), client certificates are not requested, and smtpd_tls_CApath should remain empty. In contrast to smtpd_tls_CAfile, DNs of certificate authorities installed in $smtpd_tls_CApath are not included in the client certificate request message. MUAs with multiple client certificates may use the list of preferred certificate authorities to select the correct client certificate. You may want to put your "preferred" CA or CAs in $smtpd_tls_CAfile, and install the remaining trusted CAs in $smtpd_tls_CApath.
Example:
smtpd_tls_CApath = /etc/postfix/certs
This feature is available in Postfix 2.2 and later.
With Postfix 2.3 and later the Postfix SMTP server can disable session id generation when TLS session caching is turned off. This keeps clients from caching sessions that almost certainly cannot be re-used.
By default, the Postfix SMTP server always generates TLS session ids. This works around a known defect in mail client applications such as MS Outlook, and may also prevent interoperability issues with other MTAs.
Example:
smtpd_tls_always_issue_session_ids = no
This feature is available in Postfix 2.3 and later.
Some clients such as Netscape will either complain if no certificate is available (for the list of CAs in $smtpd_tls_CAfile) or will offer multiple client certificates to choose from. This may be annoying, so this option is "off" by default.
This feature is available in Postfix 2.2 and later.
This feature is available in Postfix 2.2 and later.
The default verification depth is 9 (the OpenSSL default) for compatibility with earlier Postfix behavior. Prior to Postfix 2.5, the default value was 5, but the limit was not actually enforced. If you have set this to a lower non-default value, certificates with longer trust chains may now fail to verify. Certificate chains with 1 or 2 CAs are common, deeper chains are more rare and any number between 5 and 9 should suffice in practice. You can choose a lower number if, for example, you trust certificates directly signed by an issuing CA but not any CAs it delegates to.
This feature is available in Postfix 2.2 and later.
Public Internet MX hosts without certificates signed by a "reputable" CA must generate, and be prepared to present to most clients, a self-signed or private-CA signed certificate. The client will not be able to authenticate the server, but unless it is running Postfix 2.3 or similar software, it will still insist on a server certificate.
For servers that are not public Internet MX hosts, Postfix 2.3 supports configurations with no certificates. This entails the use of just the anonymous TLS ciphers, which are not supported by typical SMTP clients. Since such clients will not, as a rule, fall back to plain text after a TLS handshake failure, the server will be unable to receive email from TLS enabled clients. To avoid accidental configurations with no certificates, Postfix 2.3 enables certificate-less operation only when the administrator explicitly sets "smtpd_tls_cert_file = none". This ensures that new Postfix configurations will not accidentally run with no certificates.
Both RSA and DSA certificates are supported. When both types are present, the cipher used determines which certificate will be presented to the client. For Netscape and OpenSSL clients without special cipher choices the RSA certificate is preferred.
To enable a remote SMTP client to verify the Postfix SMTP server certificate, the issuing CA certificates must be made available to the client. You should include the required certificates in the server certificate file, the server certificate first, then the issuing CA(s) (bottom-up order).
Example: the certificate for "server.example.com" was issued by "intermediate CA" which itself has a certificate of "root CA". Create the server.pem file with "cat server_cert.pem intermediate_CA.pem root_CA.pem > server.pem".
If you also want to verify client certificates issued by these CAs, you can add the CA certificates to the smtpd_tls_CAfile, in which case it is not necessary to have them in the smtpd_tls_cert_file or smtpd_tls_dcert_file.
A certificate supplied here must be usable as an SSL server certificate and hence pass the "openssl verify -purpose sslserver ..." test.
Example:
smtpd_tls_cert_file = /etc/postfix/server.pem
This feature is available in Postfix 2.2 and later.
Note: do not use "" quotes around the parameter value.
This feature is available with Postfix version 2.2. It is not used with Postfix 2.3 and later; use smtpd_tls_mandatory_ciphers instead.
When TLS is mandatory the cipher grade is chosen via the smtpd_tls_mandatory_ciphers configuration parameter, see there for syntax details.
Example:
smtpd_tls_ciphers = export
This feature is available in Postfix 2.6 and later. With earlier Postfix releases only the smtpd_tls_mandatory_ciphers parameter is implemented, and opportunistic TLS always uses "export" or better (i.e. all) ciphers.
See the discussion under smtpd_tls_cert_file for more details.
Example:
smtpd_tls_dcert_file = /etc/postfix/server-dsa.pem
This feature is available in Postfix 2.2 and later.
Instead of using the exact same parameter sets as distributed with other TLS packages, it is more secure to generate your own set of parameters with something like the following command:
Your actual source for entropy may differ. Some systems have /dev/random; on other system you may consider using the "Entropy Gathering Daemon EGD", available at http://egd.sourceforge.net/
Example:
smtpd_tls_dh1024_param_file = /etc/postfix/dh_1024.pem
This feature is available with Postfix version 2.2.
See also the discussion under the smtpd_tls_dh1024_param_file configuration parameter.
Example:
smtpd_tls_dh512_param_file = /etc/postfix/dh_512.pem
This feature is available with Postfix version 2.2.
The private key must be accessible without a pass-phrase, i.e. it must not be encrypted. File permissions should grant read-only access to the system superuser account ("root"), and no access to anyone else.
This feature is available in Postfix 2.2 and later.
See the discussion under smtpd_tls_cert_file for more details.
Example:
smtpd_tls_eccert_file = /etc/postfix/ecdsa-scert.pem
This feature is available in Postfix 2.6 and later, when Postfix is compiled and linked with OpenSSL 1.0.0 or later.
The private key must be accessible without a pass-phrase, i.e. it must not be encrypted. File permissions should grant read-only access to the system superuser account ("root"), and no access to anyone else.
This feature is available in Postfix 2.6 and later, when Postfix is compiled and linked with OpenSSL 1.0.0 or later.
The available choices are:
none | Don't use EECDH. Ciphers based on EECDH key exchange will be disabled. This is the default in Postfix versions 2.6 and 2.7. |
strong | Use EECDH with approximately 128 bits of security at a reasonable computational cost. This is the current best-practice trade-off between security and computational efficiency. This is the default in Postfix version 2.8 and later. |
ultra | Use EECDH with approximately 192 bits of security at computational cost that is approximately twice as high as 128 bit strength ECC. Barring significant progress in attacks on elliptic curve crypto-systems, the "strong" curve is sufficient for most users. |
This feature is available in Postfix 2.6 and later, when it is compiled and linked with OpenSSL 1.0.0 or later.
Examples (some of these will cause problems):
The first setting disables anonymous ciphers. The next setting disables ciphers that use the MD5 digest algorithm or the (single) DES encryption algorithm. The next setting disables ciphers that use MD5 and DES together. The next setting disables the two ciphers "AES256-SHA" and "DES-CBC3-MD5". The last setting disables ciphers that use "EDH" key exchange with RSA authentication.
This feature is available in Postfix 2.3 and later.
The best practice algorithm is now sha1. Recent advances in hash function cryptanalysis have led to md5 being deprecated in favor of sha1. However, as long as there are no known "second pre-image" attacks against md5, its use in this context can still be considered safe.
While additional digest algorithms are often available with OpenSSL's libcrypto, only those used by libssl in SSL cipher suites are available to Postfix. For now this means just md5 or sha1.
To find the fingerprint of a specific certificate file, with a specific digest algorithm, run:
The text to the right of "=" sign is the desired fingerprint. For example:
Example: client-certificate access table, with sha1 fingerprints:
This feature is available in Postfix 2.5 and later.
The private key must be accessible without a pass-phrase, i.e. it must not be encrypted. File permissions should grant read-only access to the system superuser account ("root"), and no access to anyone else.
|
0 Disable logging of TLS activity. |
|
1 Log TLS handshake and certificate information. |
|
2 Log levels during TLS negotiation. |
|
3 Log hexadecimal and ASCII dump of TLS negotiation process. |
|
4 Also log hexadecimal and ASCII dump of complete transmission after STARTTLS. |
Use "smtpd_tls_loglevel = 3" only in case of problems. Use of loglevel 4 is strongly discouraged.
This feature is available in Postfix 2.2 and later.
The following cipher grades are supported:
export | Enable "EXPORT" grade or stronger OpenSSL ciphers. This is the most appropriate setting for public MX hosts, and is always used with opportunistic TLS encryption. The underlying cipherlist is specified via the tls_export_cipherlist configuration parameter, which you are strongly encouraged to not change. |
low | Enable "LOW" grade or stronger OpenSSL ciphers. The underlying cipherlist is specified via the tls_low_cipherlist configuration parameter, which you are strongly encouraged to not change. |
medium | Enable "MEDIUM" grade or stronger OpenSSL ciphers. These use 128-bit or longer symmetric bulk-encryption keys. This is the default minimum strength for mandatory TLS encryption. The underlying cipherlist is specified via the tls_medium_cipherlist configuration parameter, which you are strongly encouraged to not change. |
high | Enable only "HIGH" grade OpenSSL ciphers. The underlying cipherlist is specified via the tls_high_cipherlist configuration parameter, which you are strongly encouraged to not change. |
null | Enable only the "NULL" OpenSSL ciphers, these provide authentication without encryption. This setting is only appropriate in the rare case that all clients are prepared to use NULL ciphers (not normally enabled in TLS clients). The underlying cipherlist is specified via the tls_null_cipherlist configuration parameter, which you are strongly encouraged to not change. |
Cipher types listed in smtpd_tls_mandatory_exclude_ciphers or smtpd_tls_exclude_ciphers are excluded from the base definition of the selected cipher grade. See smtpd_tls_ciphers for cipher controls that apply to opportunistic TLS.
The underlying cipherlists for grades other than "null" include anonymous ciphers, but these are automatically filtered out if the server is configured to ask for client certificates. You are very unlikely to need to take any steps to exclude anonymous ciphers, they are excluded automatically as required. If you must exclude anonymous ciphers even when Postfix does not need or use peer certificates, set "smtpd_tls_exclude_ciphers = aNULL". To exclude anonymous ciphers only when TLS is enforced, set "smtpd_tls_mandatory_exclude_ciphers = aNULL".
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.3 and later.
With Postfix >= 2.5 the parameter syntax is expanded to support protocol exclusions. One can now explicitly exclude SSLv2 by setting "smtpd_tls_mandatory_protocols = !SSLv2". To exclude both SSLv2 and SSLv3 set "smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3". Listing the protocols to include, rather than protocols to exclude, is still supported, use the form you find more intuitive.
Since SSL version 2 has known protocol weaknesses and is now deprecated, the default setting excludes "SSLv2". This means that by default, SSL version 2 will not be used at the "encrypt" security level.
Example:
smtpd_tls_mandatory_protocols = TLSv1
# Alternative form with Postfix >= 2.5:
smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3
This feature is available in Postfix 2.3 and later.
In main.cf the values are separated by whitespace, commas or colons. An empty value means allow all protocols. The valid protocol names, (see \fBfBSSL_get_version(3)), are "SSLv2", "SSLv3" and "TLSv1". In smtp_tls_policy_maps table entries, "protocols" attribute values are separated by a colon.
To include a protocol list its name, to exclude it, prefix the name with a "!" character. To exclude SSLv2 even for opportunistic TLS set "smtpd_tls_protocols = !SSLv2". To exclude both "SSLv2" and "SSLv3" set "smtpd_tls_protocols = !SSLv2, !SSLv3". Explicitly listing the protocols to include, is supported, but not recommended. OpenSSL provides no mechanisms for excluding protocols not known at compile-time. If Postfix is linked against an OpenSSL library that supports additional protocol versions, they cannot be excluded using either syntax.
Example:
smtpd_tls_protocols = !SSLv2
This feature is available in Postfix 2.6 and later.
This feature is available in Postfix 2.2 and later.
When TLS encryption is optional, this setting is ignored with a warning written to the mail log.
This feature is available in Postfix 2.2 and later.
Specify one of the following security levels:
none | TLS will not be used. |
may | Opportunistic TLS: announce STARTTLS support to SMTP clients, but do not require that clients use TLS encryption. |
encrypt | Mandatory TLS encryption: announce STARTTLS support to SMTP clients, and require that clients use TLS encryption. According to RFC 2487 this MUST NOT be applied in case of a publicly-referenced SMTP server. Instead, this option should be used only on dedicated servers. |
Note 1: the "fingerprint", "verify" and "secure" levels are not supported here. The Postfix SMTP server logs a warning and uses "encrypt" instead. To verify SMTP client certificates, see TLS_README for a discussion of the smtpd_tls_ask_ccert, smtpd_tls_req_ccert, and permit_tls_clientcerts features.
Note 2: The parameter setting "smtpd_tls_security_level = encrypt" implies "smtpd_tls_auth_only = yes".
Note 3: when invoked via "sendmail -bs", Postfix will never offer STARTTLS due to insufficient privileges to access the server private key. This is intended behavior.
This feature is available in Postfix 2.3 and later.
Note: dbm databases are not suitable. TLS session objects are too large.
As of version 2.5, Postfix no longer uses root privileges when opening this file. The file should now be stored under the Postfix-owned data_directory. As a migration aid, an attempt to open the file under a non-Postfix directory is redirected to the Postfix-owned data_directory, and a warning is logged.
Example:
smtpd_tls_session_cache_database = btree:/var/db/postfix/smtpd_scache
This feature is available in Postfix 2.2 and later.
This feature is available in Postfix 2.2 and later.
If you want to support this service, enable a special port in master.cf, and specify "-o smtpd_tls_wrappermode=yes" on the SMTP server's command line. Port 465 (smtps) was once chosen for this purpose.
This feature is available in Postfix 2.2 and later.
Note: when invoked via "sendmail -bs", Postfix will never offer STARTTLS due to insufficient privileges to access the server private key. This is intended behavior.
This feature is available in Postfix 2.2 and later. With Postfix 2.3 and later use smtpd_tls_security_level instead.
Example:
soft_bounce = yes
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is s (seconds).
This feature is available in Postfix 2.5 and later.
This feature should not be enabled on a general purpose mail server, because it is likely to reject legitimate email.
This feature is available in Postfix 2.0 and later.
This feature should not be enabled on a general purpose mail server, because it is likely to reject legitimate email.
This feature is available in Postfix 2.0 and later.
Unfortunately, this also rejects majordomo approval requests when the included request contains valid 8-bit MIME mail, and it rejects bounces from mailers that do not MIME encapsulate 8-bit content (for example, bounces from qmail or from old versions of Postfix).
This feature should not be enabled on a general purpose mail server, because it is likely to reject legitimate email.
This feature is available in Postfix 2.0 and later.
This feature is available in Postfix 2.5.3 and later.
This feature should not be enabled on a general purpose mail server, because it will reject mail after a single violation.
This feature is available in Postfix 2.0 and later.
By default, the Postfix SMTP server accepts RFC 822 syntax in MAIL FROM and RCPT TO addresses.
Note: with Postfix version 2.2, message header address rewriting happens only when one of the following conditions is true:
• | The message is received with the Postfix sendmail(1) command, |
• | The message is received from a network client that matches $local_header_rewrite_clients, |
• | The message is received from the network, and the remote_header_rewrite_domain parameter specifies a non-empty value. |
To get the behavior before Postfix version 2.2, specify "local_header_rewrite_clients = static:all".
Example:
swap_bangpath = no
Warning: a non-default syslog_facility setting takes effect only after a Postfix process has completed initialization. Errors during process initialization will be logged with the default facility. Examples are errors while parsing the command line arguments, and errors while accessing the Postfix main.cf configuration file.
Warning: a non-default syslog_name setting takes effect only after a Postfix process has completed initialization. Errors during process initialization will be logged with the default name. Examples are errors while parsing the command line arguments, and errors while accessing the Postfix main.cf configuration file.
To change this parameter without stopping Postfix, you need to first terminate all Postfix TCP servers:
This immediately terminates all processes that accept network connections. Next, you enable Postfix TCP servers with the updated tcp_windowsize setting:
If you skip these steps with a running Postfix system, then the tcp_windowsize change will work only for Postfix TCP clients ( smtp(8), lmtp(8)).
This feature is available in Postfix 2.6 and later.
This feature is available in Postfix 2.4.15, 2.5.11, 2.6.8, 2.7.2 and later versions. Specify "tls_append_default_CA = yes" for backwards compatibility, to avoid breaking certificate verification with sites that don't use permit_tls_all_clientcerts.
This feature is available in Postfix 2.2 and later.
The OpenSSL toolkit includes a set of work-arounds for buggy SSL/TLS implementations. Applications, such as Postfix, that want to maximize interoperability ask the OpenSSL library to enable the full set of recommended work-arounds.
From time to time, it is discovered that a work-around creates a security issue, and should no longer be used. If upgrading OpenSSL to a fixed version is not an option or an upgrade is not available in a timely manner, or in closed environments where no buggy clients or servers exist, it may be appropriate to disable some or all of the OpenSSL interoperability work-arounds. This parameter specifies which bug work-arounds to disable.
If the value of the parameter is a hexadecimal long integer starting with "0x", the bug work-arounds corresponding to the bits specified in its value are removed from the SSL_OP_ALL work-around bit-mask (see openssl/ssl.h and SSL_CTX_ set_options(3)). You can specify more bits than are present in SSL_OP_ALL, excess bits are ignored. Specifying 0xFFFFFFFF disables all bug-workarounds on a 32-bit system. This should also be sufficient on 64-bit systems, until OpenSSL abandons support for 32-bit systems and starts using the high 32 bits of a 64-bit bug-workaround mask.
Otherwise, the parameter is a white-space or comma separated list of specific named bug work-arounds chosen from the list below. It is possible that your OpenSSL version includes new bug work-arounds added after your Postfix source code was last updated, in that case you can only disable one of these via the hexadecimal syntax above.
MICROSOFT_SESS_ID_BUG | See SSL_CTX_set_options(3) |
NETSCAPE_CHALLENGE_BUG | See SSL_CTX_set_options(3) |
LEGACY_SERVER_CONNECT | See SSL_CTX_set_options(3) |
NETSCAPE_REUSE_CIPHER_CHANGE_BUG | also aliased as CVE-2010-4180. Postfix 2.8 disables this work-around by default with OpenSSL versions that may predate the fix. Fixed in OpenSSL 0.9.8q and OpenSSL 1.0.0c. |
SSLREF2_REUSE_CERT_TYPE_BUG | See SSL_CTX_ set_options(3) |
MICROSOFT_BIG_SSLV3_BUFFER | See SSL_CTX_ set_options(3) |
MSIE_SSLV2_RSA_PADDING | also aliased as CVE-2005-2969. Postfix 2.8 disables this work-around by default with OpenSSL versions that may predate the fix. Fixed in OpenSSL 0.9.7h and OpenSSL 0.9.8a. |
SSLEAY_080_CLIENT_DH_BUG | See SSL_CTX_ set_options(3) |
TLS_D5_BUG | See SSL_CTX_set_options(3) |
TLS_BLOCK_PADDING_BUG | See SSL_CTX_set_options(3) |
TLS_ROLLBACK_BUG | See SSL_CTX_set_options(3). This is disabled in OpenSSL 0.9.7 and later. Nobody should still be using 0.9.6! |
DONT_INSERT_EMPTY_FRAGMENTS | See SSL_CTX_ set_options(3) |
CRYPTOPRO_TLSEXT_BUG | New with GOST support in OpenSSL 1.0.0. |
This feature is available in Postfix 2.8 and later.
This default curve is specified in NSA "Suite B" Cryptography (see http://www.nsa.gov/ia/industry/crypto_suite_b.cfm) for information classified as SECRET.
Note: elliptic curve names are poorly standardized; different standards groups are assigning different names to the same underlying curves. The curve with the X9.62 name "prime256v1" is also known under the SECG name "secp256r1", but OpenSSL does not recognize the latter name.
This feature is available in Postfix 2.6 and later, when it is compiled and linked with OpenSSL 1.0.0 or later.
This default "ultra" curve is specified in NSA "Suite B" Cryptography (see http://www.nsa.gov/ia/industry/crypto_suite_b.cfm) for information classified as TOP SECRET.
This feature is available in Postfix 2.6 and later, when it is compiled and linked with OpenSSL 1.0.0 or later.
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.3 and later.
This feature is available in Postfix 2.3 and later.
By default, the OpenSSL server selects the client's most preferred cipher that the server supports. With SSLv3 and later, the server may choose its own most preferred cipher that is supported (offered) by the client. Setting "tls_preempt_cipherlist = yes" enables server cipher preferences.
While server cipher selection may in some cases lead to a more secure or performant cipher choice, there is some risk of interoperability issues. In the past, some SSL clients have listed lower priority ciphers that they did not implement correctly. If the server chooses a cipher that the client prefers less, it may select a cipher whose client implementation is flawed.
This feature is available in Postfix 2.8 and later, in combination with OpenSSL 0.9.7 and later.
This feature is available in Postfix 2.2 and later.
As of version 2.5, Postfix no longer uses root privileges when opening this file, and the default file location was changed from ${config_directory}/prng_exch to ${data_directory}/prng_exch. As a migration aid, an attempt to open the file under a non-Postfix directory is redirected to the Postfix-owned data_directory, and a warning is logged.
This feature is available in Postfix 2.2 and later.
This feature is available in Postfix 2.2 and later.
This feature is available in Postfix 2.2 and later.
Note: on OpenBSD systems specify /dev/arandom when /dev/urandom gives timeout errors.
This feature is available in Postfix 2.2 and later.
This feature is available in Postfix 2.8 and later.
This feature is available in Postfix 2.8 and later.
This feature is available in Postfix 2.8 and later.
This feature is available in Postfix 2.8 and later.
This feature is available in Postfix 2.8 and later.
This feature is available in Postfix 2.8 and later.
This feature is available in Postfix 2.8 and later.
This feature is available in Postfix 2.8 and later.
This feature is available in Postfix 2.8 and later.
This feature is available in Postfix 2.8 and later.
This feature is available in Postfix 2.8 and later.
This feature is available in Postfix 2.8 and later.
This feature is available in Postfix 2.8 and later.
This feature is available in Postfix 2.8 and later.
This feature is available in Postfix 2.8 and later.
This feature is available in Postfix 2.8 and later.
This feature is available in Postfix 2.8 and later.
This feature is available in Postfix 2.8 and later.
This feature is available in Postfix 2.8 and later.
This feature is available in Postfix 2.8 and later.
This feature is available in Postfix 2.8 and later.
This feature is available in Postfix 2.8 and later.
This feature is available in Postfix 2.8 and later.
This feature is available in Postfix 2.8 and later.
This feature is available in Postfix 2.8 and later.
This feature is available in Postfix 2.8 and later.
This feature is available in Postfix 2.8 and later.
This feature is available in Postfix 2.8 and later.
Specify a non-zero time value (an integral value plus an optional one-letter suffix that specifies the time unit). Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
This feature is available in Postfix 2.8.
This feature is available in Postfix 2.1 and later.
This feature is available in Postfix 2.5 and later.
This feature is available in Postfix 2.5 and later.
This feature is available in Postfix 2.5 and later.
This feature is available in Postfix 2.5 and later.
This feature is available in Postfix 2.5 and later.
Specify zero or more "type:table" lookup tables. If you use this feature with local files, run " postmap /etc/postfix/transport" after making a change.
For safety reasons, as of Postfix 2.3 this feature does not allow $number substitutions in regular expression maps.
Examples:
transport_maps = dbm:/etc/postfix/transport
transport_maps = hash:/etc/postfix/transport
This feature is available in Postfix 2.4 and later.
This feature is available in Postfix 2.4 and later.
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is s (seconds).
Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is s (seconds).
Example:
# Default value before Postfix 2.8.
# Note: the ":" and ";" are both required.
undisclosed_recipients_header = To: undisclosed-recipients:;
Do not change this unless you have a complete understanding of RFC 2821.
This feature is available in Postfix 2.6 and later.
Do not change this unless you have a complete understanding of RFC 2821.
This feature is available in Postfix 2.6 and later.
Do not change this unless you have a complete understanding of RFC 2821.
The default setting is 550 (reject mail) but it is safer to initially use 450 (try again later) so you have time to find out if your local_recipient_maps settings are OK.
Example:
unknown_local_recipient_reject_code = 450
This feature is available in Postfix 2.0 and later.
This feature is available in Postfix 2.0 and later.
This feature is available in Postfix 2.0 and later.
This feature is available in Postfix 2.0 and later.
Unlike elsewhere in Postfix, you can specify 250 in order to accept the address anyway.
Do not change this unless you have a complete understanding of RFC 2821.
This feature is available in Postfix 2.6 and later.
Unlike elsewhere in Postfix, you can specify 250 in order to accept the address anyway.
Do not change this unless you have a complete understanding of RFC 2821.
This feature is available in Postfix 2.1 and later.
Example:
unverified_recipient_reject_reason = Recipient address lookup failed
This feature is available in Postfix 2.6 and later.
This feature is available in Postfix 2.6 and later.
Unlike elsewhere in Postfix, you can specify 250 in order to accept the address anyway.
Do not change this unless you have a complete understanding of RFC 2821.
This feature is available in Postfix 2.6 and later.
Unlike elsewhere in Postfix, you can specify 250 in order to accept the address anyway.
Do not change this unless you have a complete understanding of RFC 2821.
This feature is available in Postfix 2.1 and later.
Example:
unverified_sender_reject_reason = Sender address lookup failed
This feature is available in Postfix 2.6 and later.
This feature is available in Postfix 2.6 and later.
This feature is available in Postfix 1.1 and later.
This feature is available in Postfix 2.0 and later. The default value is backwards compatible with Postfix version 1.1.
The default value is $virtual_alias_maps so that you can keep all information about virtual alias domains in one place. If you have many users, it is better to separate information that changes more frequently (virtual address -> local or remote address mapping) from information that changes less frequently (the list of virtual domain names).
Specify a list of host or domain names, "/file/name" or "type:table" patterns, separated by commas and/or whitespace. A "/file/name" pattern is replaced by its contents; a "type:table" lookup table is matched when a table entry matches a lookup string (the lookup result is ignored). Continue long lines by starting the next line with whitespace. Specify "!pattern" to exclude a host or domain name from the list. The form "!/file/name" is supported only in Postfix version 2.4 and later.
See also the VIRTUAL_README and ADDRESS_CLASS_README documents for further information.
Example:
virtual_alias_domains = virtual1.tld virtual2.tld
This feature is available in Postfix 2.1 and later.
This feature is available in Postfix 2.0 and later. The default value is backwards compatible with Postfix version 1.1.
If you use this feature with indexed files, run "postmap /etc/postfix/virtual" after changing the file.
Examples:
virtual_alias_maps = dbm:/etc/postfix/virtual
virtual_alias_maps = hash:/etc/postfix/virtual
This feature is available in Postfix 2.1 and later.
Setting this parameter to a value of 1 changes the meaning of virtual_destination_concurrency_limit from concurrency per domain into concurrency per recipient.
In a lookup table, specify a left-hand side of "@domain.tld" to match any user in the specified domain that does not have a specific "user@domain.tld" entry.
When a recipient address has an optional address extension (user+foo@domain.tld), the virtual(8) delivery agent looks up the full address first, and when the lookup fails, it looks up the unextended address (user@domain.tld).
Note 1: for security reasons, the virtual(8) delivery agent disallows regular expression substitution of $1 etc. in regular expression lookup tables, because that would open a security hole.
Note 2: for security reasons, the virtual(8) delivery agent will silently ignore requests to use the proxymap(8) server. Instead it will open the table directly. Before Postfix version 2.2, the virtual(8) delivery agent will terminate with a fatal error.
Example:
virtual_mailbox_base = /var/mail
This parameter expects the same syntax as the mydestination configuration parameter.
This feature is available in Postfix 2.0 and later. The default value is backwards compatible with Postfix version 1.1.
This setting is ignored with maildir style delivery, because such deliveries are safe without application-level locks.
Note 1: the dotlock method requires that the recipient UID or GID has write access to the parent directory of the recipient's mailbox file.
Note 2: the default setting of this parameter is system dependent.
In a lookup table, specify a left-hand side of "@domain.tld" to match any user in the specified domain that does not have a specific "user@domain.tld" entry.
The virtual(8) delivery agent uses this table to look up the per-recipient mailbox or maildir pathname. If the lookup result ends in a slash ("/"), maildir-style delivery is carried out, otherwise the path is assumed to specify a UNIX-style mailbox file. Note that $virtual_mailbox_base is unconditionally prepended to this path.
When a recipient address has an optional address extension (user+foo@domain.tld), the virtual(8) delivery agent looks up the full address first, and when the lookup fails, it looks up the unextended address (user@domain.tld).
Note 1: for security reasons, the virtual(8) delivery agent disallows regular expression substitution of $1 etc. in regular expression lookup tables, because that would open a security hole.
Note 2: for security reasons, the virtual(8) delivery agent will silently ignore requests to use the proxymap(8) server. Instead it will open the table directly. Before Postfix version 2.2, the virtual(8) delivery agent will terminate with a fatal error.
Specify a string of the form transport:nexthop, where transport is the name of a mail delivery transport defined in master.cf. The :nexthop destination is optional; its syntax is documented in the manual page of the corresponding delivery agent.
This feature is available in Postfix 2.0 and later.
In a lookup table, specify a left-hand side of "@domain.tld" to match any user in the specified domain that does not have a specific "user@domain.tld" entry.
When a recipient address has an optional address extension (user+foo@domain.tld), the virtual(8) delivery agent looks up the full address first, and when the lookup fails, it looks up the unextended address (user@domain.tld).
Note 1: for security reasons, the virtual(8) delivery agent disallows regular expression substitution of $1 etc. in regular expression lookup tables, because that would open a security hole.
Note 2: for security reasons, the virtual(8) delivery agent will silently ignore requests to use the proxymap(8) server. Instead it will open the table directly. Before Postfix version 2.2, the virtual(8) delivery agent will terminate with a fatal error.
August 25, 2011 |