From: Wietse Venema Date: Fri, 23 Oct 2009 05:00:00 +0000 (-0500) Subject: postfix-2.7-20091023 X-Git-Tag: v2.7.0-RC1~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ceb3391972977a64bc004e6e9e8c662a9cc97af8;p=thirdparty%2Fpostfix.git postfix-2.7-20091023 --- diff --git a/postfix/HISTORY b/postfix/HISTORY index bd80ff95a..b37c9c902 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -15432,7 +15432,7 @@ Apologies for any names omitted. Feature: postscreen_blacklist_action (default: continue) to control what happens with a permanently blacklisted - client. + client. File: postscreen/postscreen.c. 20091007 @@ -15445,3 +15445,16 @@ Apologies for any names omitted. Documentation: restructured the postscreen(8) manpage as a sequence of tests. File: postscreen/postscreen.c. + +20091012 + + Bugfix: postmulti did not skip commands with -p. Luca + Berra. File: postmulti/postmulti.c. + +20091023 + + Feature: specify "smtp_command_maps = pcre:/file/name" to + replace incoming SMTP commands before they are executed by + the Postfix SMTP server. This a last-resort tool to fix bad + command syntax that Postfix would otherwise reject. See + examples in the postconf(5) manual page. File: smtpd/smtpd.c. diff --git a/postfix/README_FILES/STANDARD_CONFIGURATION_README b/postfix/README_FILES/STANDARD_CONFIGURATION_README index b47c6f01f..39ff4f609 100644 --- a/postfix/README_FILES/STANDARD_CONFIGURATION_README +++ b/postfix/README_FILES/STANDARD_CONFIGURATION_README @@ -318,6 +318,10 @@ Translation: listed in $mydestination, or when it matches $inet_interfaces or $proxy_interfaces. +Execute the command "ppoossttmmaapp //eettcc//ppoossttffiixx//vviirrttuuaall" after editing the file. + +. + RRuunnnniinngg PPoossttffiixx bbeehhiinndd aa ffiirreewwaallll The simplest way to set up Postfix on a host behind a firewalled network is to diff --git a/postfix/RELEASE_NOTES-2.6 b/postfix/RELEASE_NOTES-2.6 index 0a926aa38..ff0743155 100644 --- a/postfix/RELEASE_NOTES-2.6 +++ b/postfix/RELEASE_NOTES-2.6 @@ -241,7 +241,7 @@ Major changes - header rewriting Message-ID: or To: headers only when clients match $local_header_rewrite_clients. Specify "always_add_missing_headers = yes" for backwards compatibility. Adding such headers can break -DKIM signatures that cover headers that are not present. +DKIM signatures that cover headers that are not present. For compatibility with existing logfile processing software, Postfix will log ``message-id=<>'' for messages without Message-Id header. diff --git a/postfix/WISHLIST b/postfix/WISHLIST index 0ec301189..89e3b8783 100644 --- a/postfix/WISHLIST +++ b/postfix/WISHLIST @@ -2,9 +2,17 @@ Wish list: Remove this file from the stable release. + Add smtpd_sender_login_maps to proxy_read_maps. + SMTP connection caching without storing connections, to improve TLS mail delivery performance. + postscreen has separate socket budgets for whitelisted + clients and for other clients. If we add a dummy SMTP engine + then we extend the session length for non-whitelisted clients + and need to increase the socket budget (or create a new + budget class, which complicates the user interface). + Should not milter8_mail_event() unset the "hold" default reply? Better, the default reply should not be used for this purpose. diff --git a/postfix/conf/master.cf b/postfix/conf/master.cf index d89a16406..a973e4f28 100644 --- a/postfix/conf/master.cf +++ b/postfix/conf/master.cf @@ -65,10 +65,14 @@ scache unix - - n - 1 scache # # ==================================================================== # -# The Cyrus deliver program has changed incompatibly, multiple times. +# Recent Cyrus versions can use the existing "lmtp" master.cf entry. # -#old-cyrus unix - n n - - pipe -# flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user} +# Specify in cyrus.conf: +# lmtp cmd="lmtpd -a" listen="localhost:lmtp" proto=tcp4 +# +# Specify in main.cf one or more of the following: +# mailbox_transport = lmtp:inet:localhost +# virtual_transport = lmtp:inet:localhost # # ==================================================================== # @@ -80,6 +84,13 @@ scache unix - - n - 1 scache # # ==================================================================== # +# Old example of delivery via Cyrus. +# +#old-cyrus unix - n n - - pipe +# flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user} +# +# ==================================================================== +# # See the Postfix UUCP_README file for configuration details. # #uucp unix - n n - - pipe diff --git a/postfix/html/STANDARD_CONFIGURATION_README.html b/postfix/html/STANDARD_CONFIGURATION_README.html index 12d22ca06..bb746e369 100644 --- a/postfix/html/STANDARD_CONFIGURATION_README.html +++ b/postfix/html/STANDARD_CONFIGURATION_README.html @@ -442,6 +442,9 @@ matches $inet_interfaces or $ +

Execute the command "postmap /etc/postfix/virtual" after +editing the file.

. +

Running Postfix behind a firewall

The simplest way to set up Postfix on a host behind a firewalled diff --git a/postfix/html/postconf.5.html b/postfix/html/postconf.5.html index c73971ea1..03621e7af 100644 --- a/postfix/html/postconf.5.html +++ b/postfix/html/postconf.5.html @@ -6494,10 +6494,10 @@ action, or forward the connection to a real SMTP server process.

Drop the connection immediately with a 521 SMTP reply, without reporting PREGREET, HANGUP or DNSBL results.
-

This feature is available in Postfix 2.7.

- +

This feature is available in Postfix 2.7.

+ @@ -11071,6 +11071,49 @@ Example: + + +
smtpd_command_filter +(default: empty)
+ +

A mechanism to substitute incoming SMTP commands. This is a +last-resort tool to work around problems with clients that send +invalid command syntax that would otherwise be rejected by Postfix. +

+ +

Specify the name of a "type:table" lookup table. The search +string is the SMTP command as received from the SMTP client. The +only change made is to remove initial whitespace and the trailing + characters. The result value is executed by the Postfix +SMTP server.

+ +

Examples:

+ +
+/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 enclose addresses in single quotes.
+    # WARNING: do not lose the parameters that follow the address.
+    /^RCPT\s+TO:\s*<'([^[:space:]]+)'>(.*)/     RCPT TO:<$1>$2
+
+ +

This feature is available in Postfix 2.7.

+ +
smtpd_data_restrictions diff --git a/postfix/html/postscreen.8.html b/postfix/html/postscreen.8.html index 73fbc512e..374c46f31 100644 --- a/postfix/html/postscreen.8.html +++ b/postfix/html/postscreen.8.html @@ -17,36 +17,38 @@ POSTSCREEN(8) POSTSCREEN(8) ple inbound SMTP connections in parallel. The program can run in two basic modes. - In observation mode the purpose is to collect statistics + The purpose of observation mode is to collect statistics without actually blocking mail. postscreen(8) runs a num- ber of tests before it forwards a connection to a real SMTP server process. These tests introduce a delay of a few seconds; once a client passes the tests as "clean", - its IP address is whitelisted and subsequent connections - incur no delays until the whitelist entry expires. + its IP address is temporarily whitelisted and subsequent + connections incur no delays until the temporary whitelist + entry expires. - In enforcement mode the purpose is to block mail without + The purpose of enforcement mode is to block mail without using up one Postfix SMTP server process for every connec- - tion. Here, postscreen(8) terminates connections from - SMTP clients that fail the above tests, and forwards only - the remaining connections to a real SMTP server process. + tion. Here, postscreen(8) terminates connections from + SMTP clients that fail the above tests, and forwards only + the remaining connections to a real SMTP server process. By running time-consuming spam tests in parallel in - postscreen(8), more Postfix SMTP server processes remain + postscreen(8), more Postfix SMTP server processes remain available for legitimate clients. - Note: postscreen(8) is not an SMTP proxy; this is inten- - tional. The purpose is to prioritize legitimate clients + Note: postscreen(8) is not an SMTP proxy; this is inten- + tional. The purpose is to prioritize legitimate clients with as little overhead as possible. - postscreen(8) logs its observations and takes actions as + postscreen(8) logs its observations and takes actions as described in the sections that follow. PERMANENT BLACKLIST TEST - The postscreen_blacklist_networks parameter (default: - empty) specifies a permanent blacklist for SMTP client IP - addresses. The address syntax is as with mynetworks. When - the SMTP client address matches the permanent blacklist, - this is logged as: + The postscreen_blacklist_networks parameter (default: + empty) specifies a permanent blacklist for SMTP client IP + addresses. The address syntax is as with mynetworks. + + When the SMTP client address matches the permanent black- + list, this is logged as: BLACKLISTED address @@ -66,122 +68,125 @@ POSTSCREEN(8) POSTSCREEN(8) The postscreen_whitelist_networks parameter (default: $mynetworks) specifies a permanent whitelist for SMTP client IP addresses. This feature is not used for - addresses that appear on the permanent blacklist. When the - SMTP client address matches the permanent whitelist, this - is logged as: + addresses that appear on the permanent blacklist. + + When the SMTP client address matches the permanent + whitelist, this is logged as: WHITELISTED address - The action is not configurable: immediately forward the + The action is not configurable: immediately forward the connection to a real SMTP server process. TEMPORARY WHITELIST TEST - The postscreen(8) daemon maintains a temporary whitelist - for SMTP client IP addresses that have passed all the - tests described below. The postscreen_cache_map parameter - specifies the location of the temporary whitelist. The - temporary whitelist is not used for SMTP client addresses + The postscreen(8) daemon maintains a temporary whitelist + for SMTP client IP addresses that have passed all the + tests described below. The postscreen_cache_map parameter + specifies the location of the temporary whitelist. The + temporary whitelist is not used for SMTP client addresses that appear on the permanent blacklist or whitelist. - When the SMTP client address appears on the temporary + When the SMTP client address appears on the temporary whitelist, this is logged as: PASS OLD address - The action is not configurable: immediately forward the - connection to a real SMTP server process. The client is - excluded from further tests until its temporary whitelist + The action is not configurable: immediately forward the + connection to a real SMTP server process. The client is + excluded from further tests until its temporary whitelist entry expires, as controlled with the postscreen_cache_ttl parameter. Expired entries are silently renewed if possi- ble. SMTP GREETING PHASE TESTS - The postscreen_greet_wait parameter specifies a time + The postscreen_greet_wait parameter specifies a time interval during which postscreen(8) runs a number of tests as described below. These tests run before the client may - see the real SMTP server's "220 text..." server greeting. - When the SMTP client passes all the tests, this is logged + see the real SMTP server's "220 text..." server greeting. + + When the SMTP client passes all the tests, this is logged as: PASS NEW address - The action is to forward the connection to a real SMTP - server process and to create a temporary whitelist entry - that excludes the client IP address from further tests + The action is to forward the connection to a real SMTP + server process and to create a temporary whitelist entry + that excludes the client IP address from further tests until the temporary whitelist entry expires, as controlled with the postscreen_cache_ttl parameter. - In a future implementation, the connection may first be - passed to a dummy SMTP protocol engine that implements - more protocol tests including greylisting, before the + In a future implementation, the connection may first be + passed to a dummy SMTP protocol engine that implements + more protocol tests including greylisting, before the client is allowed to talk to a real SMTP server process. PREGREET TEST - The postscreen_greet_banner parameter specifies the text - for a "220-text..." teaser banner (default: $smtpd_ban- - ner). The postscreen(8) daemon sends this before the - postscreen_greet_wait timer is started. The purpose of - the teaser banner is to confuse SPAM clients so that they - speak before their turn. It has no effect on SMTP clients + The postscreen_greet_banner parameter specifies the text + for a "220-text..." teaser banner (default: $smtpd_ban- + ner). The postscreen(8) daemon sends this before the + postscreen_greet_wait timer is started. The purpose of + the teaser banner is to confuse SPAM clients so that they + speak before their turn. It has no effect on SMTP clients that correctly implement the protocol. - To avoid problems with broken SMTP engines in network - appliances, either exclude them from all tests with the - postscreen_whitelist_networks feature or else specify an - empty postscreen_greet_banner value to disable the + To avoid problems with broken SMTP engines in network + appliances, either exclude them from all tests with the + postscreen_whitelist_networks feature or else specify an + empty postscreen_greet_banner value to disable the "220-text..." teaser banner. - When an SMTP client speaks before the + When an SMTP client sends a command before the postscreen_greet_wait time has elapsed, this is logged as: PREGREET count after time from address text... Translation: the client at address sent count bytes before - its turn to speak, and this happened time seconds after - the test started. The text is what the client sent (trun- - cated at 100 bytes, and with non-printable characters - replaced with "?"). + its turn to speak, and this happened time seconds after + the postscreen_greet_wait timer was started. The text is + what the client sent (truncated to 100 bytes, and with + non-printable characters replaced with "?"). The postscreen_greet_action parameter specifies the action that is taken next: continue (default, observation mode) - Wait until the postscreen_greet_wait time has + Wait until the postscreen_greet_wait time has elapsed, then report DNSBL lookup results if appli- cable. Either perform DNSBL-related actions or for- - ward the connection to a real SMTP server process. + ward the connection to a real SMTP server process. drop (enforcement mode) - Drop the connection immediately with a 521 SMTP - reply. In a future implementation, the connection - may instead be passed to a dummy SMTP protocol - engine that logs sender and recipient information. + Drop the connection immediately with a 521 SMTP + reply. In a future implementation, the connection + may instead be passed to a dummy SMTP protocol + engine that logs sender and recipient information. HANGUP TEST - When the SMTP client hangs up without sending any data + When the SMTP client hangs up without sending any data before the postscreen_greet_wait time has elapsed, this is logged as: HANGUP after time from address - The postscreen_hangup_action specifies the action that is + The postscreen_hangup_action specifies the action that is taken next: continue (default, observation mode) - Wait until the postscreen_greet_wait time has + Wait until the postscreen_greet_wait time has elapsed, then report DNSBL lookup results if appli- - cable. Do not forward the broken connection to a + cable. Do not forward the broken connection to a real SMTP server process. drop (enforcement mode) Drop the connection immediately. DNS BLOCKLIST TEST - The postscreen_dnsbl_sites parameter (default: empty) - specifies a list of DNS blocklist servers. When the - postscreen_greet_wait time has elapsed, and the SMTP - client address is reported by at least one of these block- - lists, this is logged as: + The postscreen_dnsbl_sites parameter (default: empty) + specifies a list of DNS blocklist servers. + + When the postscreen_greet_wait time has elapsed, and the + SMTP client address is listed with at least one of these + blocklists, this is logged as: DNSBL rank count for address diff --git a/postfix/html/smtpd.8.html b/postfix/html/smtpd.8.html index 836e9c09c..800220400 100644 --- a/postfix/html/smtpd.8.html +++ b/postfix/html/smtpd.8.html @@ -105,88 +105,92 @@ SMTPD(8) SMTPD(8) as if the local hostname were specified, instead of rejecting the address as invalid. + smtpd_command_filter (empty) + A mechanism to substitute incoming SMTP commands by + other commands. + smtpd_reject_unlisted_sender (no) - Request that the Postfix SMTP server rejects mail - from unknown sender addresses, even when no - explicit reject_unlisted_sender access restriction + Request that the Postfix SMTP server rejects mail + from unknown sender addresses, even when no + explicit reject_unlisted_sender access restriction is specified. smtpd_sasl_exceptions_networks (empty) - What remote SMTP clients the Postfix SMTP server + What remote SMTP clients the Postfix SMTP server will not offer AUTH support to. Available in Postfix version 2.2 and later: smtpd_discard_ehlo_keyword_address_maps (empty) - Lookup tables, indexed by the remote SMTP client - address, with case insensitive lists of EHLO key- - words (pipelining, starttls, auth, etc.) that the + Lookup tables, indexed by the remote SMTP client + address, with case insensitive lists of EHLO key- + words (pipelining, starttls, auth, etc.) that the SMTP server will not send in the EHLO response to a remote SMTP client. smtpd_discard_ehlo_keywords (empty) - A case insensitive list of EHLO keywords (pipelin- - ing, starttls, auth, etc.) that the SMTP server + A case insensitive list of EHLO keywords (pipelin- + ing, starttls, auth, etc.) that the SMTP server will not send in the EHLO response to a remote SMTP client. smtpd_delay_open_until_valid_rcpt (yes) - Postpone the start of an SMTP mail transaction + Postpone the start of an SMTP mail transaction until a valid RCPT TO command is received. Available in Postfix version 2.3 and later: smtpd_tls_always_issue_session_ids (yes) - Force the Postfix SMTP server to issue a TLS ses- - sion id, even when TLS session caching is turned + Force the Postfix SMTP server to issue a TLS ses- + sion id, even when TLS session caching is turned off (smtpd_tls_session_cache_database is empty). Available in Postfix version 2.6 and later: tcp_windowsize (0) - An optional workaround for routers that break TCP + An optional workaround for routers that break TCP window scaling. ADDRESS REWRITING CONTROLS - See the ADDRESS_REWRITING_README document for a detailed + See the ADDRESS_REWRITING_README document for a detailed discussion of Postfix address rewriting. receive_override_options (empty) - Enable or disable recipient validation, built-in + Enable or disable recipient validation, built-in content filtering, or address mapping. Available in Postfix version 2.2 and later: local_header_rewrite_clients (permit_inet_interfaces) Rewrite message header addresses in mail from these - clients and update incomplete addresses with the + clients and update incomplete addresses with the domain name in $myorigin or $mydomain; either don't - rewrite message headers from other clients at all, - or rewrite message headers and update incomplete - addresses with the domain specified in the + rewrite message headers from other clients at all, + or rewrite message headers and update incomplete + addresses with the domain specified in the remote_header_rewrite_domain parameter. AFTER QUEUE EXTERNAL CONTENT INSPECTION CONTROLS - As of version 1.0, Postfix can be configured to send new - mail to an external content filter AFTER the mail is - queued. This content filter is expected to inject mail - back into a (Postfix or other) MTA for further delivery. + As of version 1.0, Postfix can be configured to send new + mail to an external content filter AFTER the mail is + queued. This content filter is expected to inject mail + back into a (Postfix or other) MTA for further delivery. See the FILTER_README document for details. content_filter (empty) - The name of a mail delivery transport that filters + The name of a mail delivery transport that filters mail after it is queued. BEFORE QUEUE EXTERNAL CONTENT INSPECTION CONTROLS - As of version 2.1, the Postfix SMTP server can be config- - ured to send incoming mail to a real-time SMTP-based con- + As of version 2.1, the Postfix SMTP server can be config- + ured to send incoming mail to a real-time SMTP-based con- tent filter BEFORE mail is queued. This content filter is - expected to inject mail back into Postfix. See the - SMTPD_PROXY_README document for details on how to config- + expected to inject mail back into Postfix. See the + SMTPD_PROXY_README document for details on how to config- ure and operate this feature. smtpd_proxy_filter (empty) - The hostname and TCP port of the mail filtering + The hostname and TCP port of the mail filtering proxy server. smtpd_proxy_ehlo ($myhostname) @@ -199,24 +203,24 @@ SMTPD(8) SMTPD(8) BEFORE QUEUE MILTER CONTROLS As of version 2.3, Postfix supports the Sendmail version 8 - Milter (mail filter) protocol. These content filters run - outside Postfix. They can inspect the SMTP command stream - and the message content, and can request modifications - before mail is queued. For details see the MILTER_README + Milter (mail filter) protocol. These content filters run + outside Postfix. They can inspect the SMTP command stream + and the message content, and can request modifications + before mail is queued. For details see the MILTER_README document. smtpd_milters (empty) A list of Milter (mail filter) applications for new - mail that arrives via the Postfix smtpd(8) server. + mail that arrives via the Postfix smtpd(8) server. milter_protocol (6) - The mail filter protocol version and optional pro- - tocol extensions for communication with a Milter - application; prior to Postfix 2.6 the default pro- + The mail filter protocol version and optional pro- + tocol extensions for communication with a Milter + application; prior to Postfix 2.6 the default pro- tocol is 2. milter_default_action (tempfail) - The default action when a Milter (mail filter) + The default action when a Milter (mail filter) application is unavailable or mis-configured. milter_macro_daemon_name ($myhostname) @@ -228,190 +232,190 @@ SMTPD(8) SMTPD(8) cations. milter_connect_timeout (30s) - The time limit for connecting to a Milter (mail - filter) application, and for negotiating protocol + The time limit for connecting to a Milter (mail + filter) application, and for negotiating protocol options. milter_command_timeout (30s) - The time limit for sending an SMTP command to a + The time limit for sending an SMTP command to a Milter (mail filter) application, and for receiving the response. milter_content_timeout (300s) - The time limit for sending message content to a + The time limit for sending message content to a Milter (mail filter) application, and for receiving the response. milter_connect_macros (see 'postconf -d' output) - The macros that are sent to Milter (mail filter) - applications after completion of an SMTP connec- + The macros that are sent to Milter (mail filter) + applications after completion of an SMTP connec- tion. milter_helo_macros (see 'postconf -d' output) - The macros that are sent to Milter (mail filter) + The macros that are sent to Milter (mail filter) applications after the SMTP HELO or EHLO command. milter_mail_macros (see 'postconf -d' output) - The macros that are sent to Milter (mail filter) + The macros that are sent to Milter (mail filter) applications after the SMTP MAIL FROM command. milter_rcpt_macros (see 'postconf -d' output) - The macros that are sent to Milter (mail filter) + The macros that are sent to Milter (mail filter) applications after the SMTP RCPT TO command. milter_data_macros (see 'postconf -d' output) - The macros that are sent to version 4 or higher - Milter (mail filter) applications after the SMTP + The macros that are sent to version 4 or higher + Milter (mail filter) applications after the SMTP DATA command. milter_unknown_command_macros (see 'postconf -d' output) - The macros that are sent to version 3 or higher - Milter (mail filter) applications after an unknown + The macros that are sent to version 3 or higher + Milter (mail filter) applications after an unknown SMTP command. milter_end_of_header_macros (see 'postconf -d' output) - The macros that are sent to Milter (mail filter) + The macros that are sent to Milter (mail filter) applications after the end of the message header. milter_end_of_data_macros (see 'postconf -d' output) - The macros that are sent to Milter (mail filter) + The macros that are sent to Milter (mail filter) applications after the message end-of-data. GENERAL CONTENT INSPECTION CONTROLS - The following parameters are applicable for both built-in + The following parameters are applicable for both built-in and external content filters. Available in Postfix version 2.1 and later: receive_override_options (empty) - Enable or disable recipient validation, built-in + Enable or disable recipient validation, built-in content filtering, or address mapping. EXTERNAL CONTENT INSPECTION CONTROLS - The following parameters are applicable for both before- + The following parameters are applicable for both before- queue and after-queue content filtering. Available in Postfix version 2.1 and later: smtpd_authorized_xforward_hosts (empty) - What SMTP clients are allowed to use the XFORWARD + What SMTP clients are allowed to use the XFORWARD feature. SASL AUTHENTICATION CONTROLS - Postfix SASL support (RFC 4954) can be used to authenti- - cate remote SMTP clients to the Postfix SMTP server, and - to authenticate the Postfix SMTP client to a remote SMTP + Postfix SASL support (RFC 4954) can be used to authenti- + cate remote SMTP clients to the Postfix SMTP server, and + to authenticate the Postfix SMTP client to a remote SMTP server. See the SASL_README document for details. broken_sasl_auth_clients (no) - Enable inter-operability with SMTP clients that - implement an obsolete version of the AUTH command + Enable inter-operability with SMTP clients that + implement an obsolete version of the AUTH command (RFC 4954). smtpd_sasl_auth_enable (no) - Enable SASL authentication in the Postfix SMTP + Enable SASL authentication in the Postfix SMTP server. smtpd_sasl_local_domain (empty) - The name of the Postfix SMTP server's local SASL + The name of the Postfix SMTP server's local SASL authentication realm. smtpd_sasl_security_options (noanonymous) - Postfix SMTP server SASL security options; as of - Postfix 2.3 the list of available features depends - on the SASL server implementation that is selected + Postfix SMTP server SASL security options; as of + Postfix 2.3 the list of available features depends + on the SASL server implementation that is selected with smtpd_sasl_type. smtpd_sender_login_maps (empty) - Optional lookup table with the SASL login names + Optional lookup table with the SASL login names that own sender (MAIL FROM) addresses. Available in Postfix version 2.1 and later: smtpd_sasl_exceptions_networks (empty) - What remote SMTP clients the Postfix SMTP server + What remote SMTP clients the Postfix SMTP server will not offer AUTH support to. Available in Postfix version 2.1 and 2.2: smtpd_sasl_application_name (smtpd) - The application name that the Postfix SMTP server + The application name that the Postfix SMTP server uses for SASL server initialization. Available in Postfix version 2.3 and later: smtpd_sasl_authenticated_header (no) - Report the SASL authenticated user name in the + Report the SASL authenticated user name in the smtpd(8) Received message header. smtpd_sasl_path (smtpd) - Implementation-specific information that the Post- - fix SMTP server passes through to the SASL plug-in - implementation that is selected with + Implementation-specific information that the Post- + fix SMTP server passes through to the SASL plug-in + implementation that is selected with smtpd_sasl_type. smtpd_sasl_type (cyrus) - The SASL plug-in type that the Postfix SMTP server + The SASL plug-in type that the Postfix SMTP server should use for authentication. Available in Postfix version 2.5 and later: cyrus_sasl_config_path (empty) - Search path for Cyrus SASL application configura- - tion files, currently used only to locate the + Search path for Cyrus SASL application configura- + tion files, currently used only to locate the $smtpd_sasl_path.conf file. STARTTLS SUPPORT CONTROLS - Detailed information about STARTTLS configuration may be + Detailed information about STARTTLS configuration may be found in the TLS_README document. smtpd_tls_security_level (empty) - The SMTP TLS security level for the Postfix SMTP - server; when a non-empty value is specified, this + The SMTP TLS security level for the Postfix SMTP + server; when a non-empty value is specified, this overrides the obsolete parameters smtpd_use_tls and smtpd_enforce_tls. smtpd_sasl_tls_security_options ($smtpd_sasl_secu- rity_options) - The SASL authentication security options that the - Postfix SMTP server uses for TLS encrypted SMTP + The SASL authentication security options that the + Postfix SMTP server uses for TLS encrypted SMTP sessions. smtpd_starttls_timeout (300s) - The time limit for Postfix SMTP server write and - read operations during TLS startup and shutdown + The time limit for Postfix SMTP server write and + read operations during TLS startup and shutdown handshake procedures. smtpd_tls_CAfile (empty) - A file containing (PEM format) CA certificates of - root CAs trusted to sign either remote SMTP client + A file containing (PEM format) CA certificates of + root CAs trusted to sign either remote SMTP client certificates or intermediate CA certificates. smtpd_tls_CApath (empty) A directory containing (PEM format) CA certificates - of root CAs trusted to sign either remote SMTP - client certificates or intermediate CA certifi- + of root CAs trusted to sign either remote SMTP + client certificates or intermediate CA certifi- cates. smtpd_tls_always_issue_session_ids (yes) - Force the Postfix SMTP server to issue a TLS ses- - sion id, even when TLS session caching is turned + Force the Postfix SMTP server to issue a TLS ses- + sion id, even when TLS session caching is turned off (smtpd_tls_session_cache_database is empty). smtpd_tls_ask_ccert (no) - Ask a remote SMTP client for a client certificate. + Ask a remote SMTP client for a client certificate. smtpd_tls_auth_only (no) When TLS encryption is optional in the Postfix SMTP - server, do not announce or accept SASL authentica- + server, do not announce or accept SASL authentica- tion over unencrypted connections. smtpd_tls_ccert_verifydepth (9) - The verification depth for remote SMTP client cer- + The verification depth for remote SMTP client cer- tificates. smtpd_tls_cert_file (empty) - File with the Postfix SMTP server RSA certificate + File with the Postfix SMTP server RSA certificate in PEM format. smtpd_tls_exclude_ciphers (empty) @@ -419,56 +423,56 @@ SMTPD(8) SMTPD(8) SMTP server cipher list at all TLS security levels. smtpd_tls_dcert_file (empty) - File with the Postfix SMTP server DSA certificate + File with the Postfix SMTP server DSA certificate in PEM format. smtpd_tls_dh1024_param_file (empty) - File with DH parameters that the Postfix SMTP + File with DH parameters that the Postfix SMTP server should use with EDH ciphers. smtpd_tls_dh512_param_file (empty) - File with DH parameters that the Postfix SMTP + File with DH parameters that the Postfix SMTP server should use with EDH ciphers. smtpd_tls_dkey_file ($smtpd_tls_dcert_file) - File with the Postfix SMTP server DSA private key + File with the Postfix SMTP server DSA private key in PEM format. smtpd_tls_key_file ($smtpd_tls_cert_file) - File with the Postfix SMTP server RSA private key + File with the Postfix SMTP server RSA private key in PEM format. smtpd_tls_loglevel (0) - Enable additional Postfix SMTP server logging of + Enable additional Postfix SMTP server logging of TLS activity. smtpd_tls_mandatory_ciphers (medium) - The minimum TLS cipher grade that the Postfix SMTP + The minimum TLS cipher grade that the Postfix SMTP server will use with mandatory TLS encryption. smtpd_tls_mandatory_exclude_ciphers (empty) - Additional list of ciphers or cipher types to - exclude from the SMTP server cipher list at manda- + Additional list of ciphers or cipher types to + exclude from the SMTP server cipher list at manda- tory TLS security levels. smtpd_tls_mandatory_protocols (SSLv3, TLSv1) - The SSL/TLS protocols accepted by the Postfix SMTP + The SSL/TLS protocols accepted by the Postfix SMTP server with mandatory TLS encryption. smtpd_tls_received_header (no) Request that the Postfix SMTP server produces Received: message headers that include information - about the protocol and cipher used, as well as the - client CommonName and client certificate issuer + about the protocol and cipher used, as well as the + client CommonName and client certificate issuer CommonName. smtpd_tls_req_ccert (no) - With mandatory TLS encryption, require a trusted - remote SMTP client certificate in order to allow + With mandatory TLS encryption, require a trusted + remote SMTP client certificate in order to allow TLS connections to proceed. smtpd_tls_session_cache_database (empty) - Name of the file containing the optional Postfix + Name of the file containing the optional Postfix SMTP server TLS session cache. smtpd_tls_session_cache_timeout (3600s) @@ -476,14 +480,14 @@ SMTPD(8) SMTPD(8) sion cache information. smtpd_tls_wrappermode (no) - Run the Postfix SMTP server in the non-standard - "wrapper" mode, instead of using the STARTTLS com- + Run the Postfix SMTP server in the non-standard + "wrapper" mode, instead of using the STARTTLS com- mand. tls_daemon_random_bytes (32) - The number of pseudo-random bytes that an smtp(8) - or smtpd(8) process requests from the tlsmgr(8) - server in order to seed its internal pseudo random + The number of pseudo-random bytes that an smtp(8) + or smtpd(8) process requests from the tlsmgr(8) + server in order to seed its internal pseudo random number generator (PRNG). tls_high_cipherlist @@ -495,7 +499,7 @@ SMTPD(8) SMTPD(8) ciphers. tls_low_cipherlist (ALL:!EXPORT:+RC4:@STRENGTH) - The OpenSSL cipherlist for "LOW" or higher grade + The OpenSSL cipherlist for "LOW" or higher grade ciphers. tls_export_cipherlist (ALL:+RC4:@STRENGTH) @@ -503,26 +507,26 @@ SMTPD(8) SMTPD(8) ciphers. tls_null_cipherlist (eNULL:!aNULL) - The OpenSSL cipherlist for "NULL" grade ciphers + The OpenSSL cipherlist for "NULL" grade ciphers that provide authentication without encryption. Available in Postfix version 2.5 and later: smtpd_tls_fingerprint_digest (md5) - The message digest algorithm used to construct + The message digest algorithm used to construct client-certificate fingerprints for check_ccert_access and permit_tls_clientcerts. Available in Postfix version 2.6 and later: smtpd_tls_protocols (empty) - List of TLS protocols that the Postfix SMTP server - will exclude or include with opportunistic TLS + List of TLS protocols that the Postfix SMTP server + will exclude or include with opportunistic TLS encryption. smtpd_tls_ciphers (export) - The minimum TLS cipher grade that the Postfix SMTP - server will use with opportunistic TLS encryption. + The minimum TLS cipher grade that the Postfix SMTP + server will use with opportunistic TLS encryption. smtpd_tls_eccert_file (empty) File with the Postfix SMTP server ECDSA certificate @@ -533,7 +537,7 @@ SMTPD(8) SMTPD(8) in PEM format. smtpd_tls_eecdh_grade (see 'postconf -d' output) - The Postfix SMTP server security grade for + The Postfix SMTP server security grade for ephemeral elliptic-curve Diffie-Hellman (EECDH) key exchange. @@ -546,18 +550,18 @@ SMTPD(8) SMTPD(8) imally strong ephemeral ECDH key exchange. OBSOLETE STARTTLS CONTROLS - The following configuration parameters exist for compati- + The following configuration parameters exist for compati- bility with Postfix versions before 2.3. Support for these will be removed in a future release. smtpd_use_tls (no) - Opportunistic TLS: announce STARTTLS support to - SMTP clients, but do not require that clients use + Opportunistic TLS: announce STARTTLS support to + SMTP clients, but do not require that clients use TLS encryption. smtpd_enforce_tls (no) - Mandatory TLS: announce STARTTLS support to SMTP - clients, and require that clients use TLS encryp- + Mandatory TLS: announce STARTTLS support to SMTP + clients, and require that clients use TLS encryp- tion. smtpd_tls_cipherlist (empty) @@ -565,64 +569,64 @@ SMTPD(8) SMTPD(8) server TLS cipher list. VERP SUPPORT CONTROLS - With VERP style delivery, each recipient of a message + With VERP style delivery, each recipient of a message receives a customized copy of the message with his/her own - recipient address encoded in the envelope sender address. + recipient address encoded in the envelope sender address. The VERP_README file describes configuration and operation - details of Postfix support for variable envelope return + details of Postfix support for variable envelope return path addresses. VERP style delivery is requested with the - SMTP XVERP command or with the "sendmail -V" command-line - option and is available in Postfix version 1.1 and later. + SMTP XVERP command or with the "sendmail -V" command-line + option and is available in Postfix version 1.1 and later. default_verp_delimiters (+=) The two default VERP delimiter characters. verp_delimiter_filter (-=+) - The characters Postfix accepts as VERP delimiter - characters on the Postfix sendmail(1) command line + The characters Postfix accepts as VERP delimiter + characters on the Postfix sendmail(1) command line and in SMTP commands. Available in Postfix version 1.1 and 2.0: authorized_verp_clients ($mynetworks) - What SMTP clients are allowed to specify the XVERP + What SMTP clients are allowed to specify the XVERP command. Available in Postfix version 2.1 and later: smtpd_authorized_verp_clients ($authorized_verp_clients) - What SMTP clients are allowed to specify the XVERP + What SMTP clients are allowed to specify the XVERP command. TROUBLE SHOOTING CONTROLS - The DEBUG_README document describes how to debug parts of - the Postfix mail system. The methods vary from making the - software log a lot of detail, to running some daemon pro- + The DEBUG_README document describes how to debug parts of + the Postfix mail system. The methods vary from making the + software log a lot of detail, to running some daemon pro- cesses under control of a call tracer or debugger. debug_peer_level (2) - The increment in verbose logging level when a - remote client or server matches a pattern in the + The increment in verbose logging level when a + remote client or server matches a pattern in the debug_peer_list parameter. debug_peer_list (empty) - Optional list of remote client or server hostname - or network address patterns that cause the verbose - logging level to increase by the amount specified + Optional list of remote client or server hostname + or network address patterns that cause the verbose + logging level to increase by the amount specified in $debug_peer_level. error_notice_recipient (postmaster) - The recipient of postmaster notifications about - mail delivery problems that are caused by policy, + The recipient of postmaster notifications about + mail delivery problems that are caused by policy, resource, software or protocol errors. internal_mail_filter_classes (empty) - What categories of Postfix-generated mail are sub- - ject to before-queue content inspection by + What categories of Postfix-generated mail are sub- + ject to before-queue content inspection by non_smtpd_milters, header_checks and body_checks. notify_classes (resource, software) - The list of error classes that are reported to the + The list of error classes that are reported to the postmaster. soft_bounce (no) @@ -632,22 +636,22 @@ SMTPD(8) SMTPD(8) Available in Postfix version 2.1 and later: smtpd_authorized_xclient_hosts (empty) - What SMTP clients are allowed to use the XCLIENT + What SMTP clients are allowed to use the XCLIENT feature. KNOWN VERSUS UNKNOWN RECIPIENT CONTROLS - As of Postfix version 2.0, the SMTP server rejects mail - for unknown recipients. This prevents the mail queue from - clogging up with undeliverable MAILER-DAEMON messages. - Additional information on this topic is in the + As of Postfix version 2.0, the SMTP server rejects mail + for unknown recipients. This prevents the mail queue from + clogging up with undeliverable MAILER-DAEMON messages. + Additional information on this topic is in the LOCAL_RECIPIENT_README and ADDRESS_CLASS_README documents. show_user_unknown_table_name (yes) - Display the name of the recipient table in the + Display the name of the recipient table in the "User unknown" responses. canonical_maps (empty) - Optional address mapping lookup tables for message + Optional address mapping lookup tables for message headers and envelopes. recipient_canonical_maps (empty) @@ -658,7 +662,7 @@ SMTPD(8) SMTPD(8) mydestination ($myhostname, localhost.$mydomain, local- host) - The list of domains that are delivered via the + The list of domains that are delivered via the $local_transport mail delivery transport. inet_interfaces (all) @@ -667,146 +671,146 @@ SMTPD(8) SMTPD(8) proxy_interfaces (empty) The network interface addresses that this mail sys- - tem receives mail on by way of a proxy or network + tem receives mail on by way of a proxy or network address translation unit. inet_protocols (ipv4) - The Internet protocols Postfix will attempt to use + The Internet protocols Postfix will attempt to use when making or accepting connections. local_recipient_maps (proxy:unix:passwd.byname $alias_maps) - Lookup tables with all names or addresses of local - recipients: a recipient address is local when its - domain matches $mydestination, $inet_interfaces or + Lookup tables with all names or addresses of local + recipients: a recipient address is local when its + domain matches $mydestination, $inet_interfaces or $proxy_interfaces. unknown_local_recipient_reject_code (550) - The numerical Postfix SMTP server response code - when a recipient address is local, and - $local_recipient_maps specifies a list of lookup + The numerical Postfix SMTP server response code + when a recipient address is local, and + $local_recipient_maps specifies a list of lookup tables that does not match the recipient. - Parameters concerning known/unknown recipients of relay + Parameters concerning known/unknown recipients of relay destinations: relay_domains ($mydestination) - What destination domains (and subdomains thereof) + What destination domains (and subdomains thereof) this system will relay mail to. relay_recipient_maps (empty) - Optional lookup tables with all valid addresses in + Optional lookup tables with all valid addresses in the domains that match $relay_domains. unknown_relay_recipient_reject_code (550) The numerical Postfix SMTP server reply code when a - recipient address matches $relay_domains, and - relay_recipient_maps specifies a list of lookup + recipient address matches $relay_domains, and + relay_recipient_maps specifies a list of lookup tables that does not match the recipient address. - Parameters concerning known/unknown recipients in virtual + Parameters concerning known/unknown recipients in virtual alias domains: virtual_alias_domains ($virtual_alias_maps) Postfix is final destination for the specified list - of virtual alias domains, that is, domains for - which all addresses are aliased to addresses in + of virtual alias domains, that is, domains for + which all addresses are aliased to addresses in other local or remote domains. virtual_alias_maps ($virtual_maps) - Optional lookup tables that alias specific mail - addresses or domains to other local or remote + Optional lookup tables that alias specific mail + addresses or domains to other local or remote address. unknown_virtual_alias_reject_code (550) The SMTP server reply code when a recipient address - matches $virtual_alias_domains, and $vir- - tual_alias_maps specifies a list of lookup tables + matches $virtual_alias_domains, and $vir- + tual_alias_maps specifies a list of lookup tables that does not match the recipient address. - Parameters concerning known/unknown recipients in virtual + Parameters concerning known/unknown recipients in virtual mailbox domains: virtual_mailbox_domains ($virtual_mailbox_maps) Postfix is final destination for the specified list - of domains; mail is delivered via the $vir- + of domains; mail is delivered via the $vir- tual_transport mail delivery transport. virtual_mailbox_maps (empty) - Optional lookup tables with all valid addresses in + Optional lookup tables with all valid addresses in the domains that match $virtual_mailbox_domains. unknown_virtual_mailbox_reject_code (550) The SMTP server reply code when a recipient address - matches $virtual_mailbox_domains, and $vir- + matches $virtual_mailbox_domains, and $vir- tual_mailbox_maps specifies a list of lookup tables that does not match the recipient address. RESOURCE AND RATE CONTROLS - The following parameters limit resource usage by the SMTP + The following parameters limit resource usage by the SMTP server and/or control client request rates. line_length_limit (2048) - Upon input, long lines are chopped up into pieces - of at most this length; upon delivery, long lines + Upon input, long lines are chopped up into pieces + of at most this length; upon delivery, long lines are reconstructed. queue_minfree (0) - The minimal amount of free space in bytes in the + The minimal amount of free space in bytes in the queue file system that is needed to receive mail. message_size_limit (10240000) - The maximal size in bytes of a message, including + The maximal size in bytes of a message, including envelope information. smtpd_recipient_limit (1000) - The maximal number of recipients that the Postfix + The maximal number of recipients that the Postfix SMTP server accepts per message delivery request. smtpd_timeout (normal: 300s, stress: 10s) - The time limit for sending a Postfix SMTP server - response and for receiving a remote SMTP client + The time limit for sending a Postfix SMTP server + response and for receiving a remote SMTP client request. smtpd_history_flush_threshold (100) - The maximal number of lines in the Postfix SMTP - server command history before it is flushed upon + The maximal number of lines in the Postfix SMTP + server command history before it is flushed upon receipt of EHLO, RSET, or end of DATA. Available in Postfix version 2.3 and later: smtpd_peername_lookup (yes) Attempt to look up the remote SMTP client hostname, - and verify that the name matches the client IP + and verify that the name matches the client IP address. The per SMTP client connection count and request rate lim- its are implemented in co-operation with the anvil(8) ser- - vice, and are available in Postfix version 2.2 and later. + vice, and are available in Postfix version 2.2 and later. smtpd_client_connection_count_limit (50) - How many simultaneous connections any client is + How many simultaneous connections any client is allowed to make to this service. smtpd_client_connection_rate_limit (0) The maximal number of connection attempts any - client is allowed to make to this service per time + client is allowed to make to this service per time unit. smtpd_client_message_rate_limit (0) - The maximal number of message delivery requests - that any client is allowed to make to this service + The maximal number of message delivery requests + that any client is allowed to make to this service per time unit, regardless of whether or not Postfix actually accepts those messages. smtpd_client_recipient_rate_limit (0) - The maximal number of recipient addresses that any - client is allowed to send to this service per time + The maximal number of recipient addresses that any + client is allowed to send to this service per time unit, regardless of whether or not Postfix actually accepts those recipients. smtpd_client_event_limit_exceptions ($mynetworks) - Clients that are excluded from connection count, + Clients that are excluded from connection count, connection rate, or SMTP request rate restrictions. Available in Postfix version 2.3 and later: @@ -817,52 +821,52 @@ SMTPD(8) SMTPD(8) tiate with this service per time unit. TARPIT CONTROLS - When a remote SMTP client makes errors, the Postfix SMTP - server can insert delays before responding. This can help - to slow down run-away software. The behavior is con- - trolled by an error counter that counts the number of - errors within an SMTP session that a client makes without + When a remote SMTP client makes errors, the Postfix SMTP + server can insert delays before responding. This can help + to slow down run-away software. The behavior is con- + trolled by an error counter that counts the number of + errors within an SMTP session that a client makes without delivering mail. smtpd_error_sleep_time (1s) With Postfix version 2.1 and later: the SMTP server - response delay after a client has made more than - $smtpd_soft_error_limit errors, and fewer than - $smtpd_hard_error_limit errors, without delivering + response delay after a client has made more than + $smtpd_soft_error_limit errors, and fewer than + $smtpd_hard_error_limit errors, without delivering mail. smtpd_soft_error_limit (10) - The number of errors a remote SMTP client is - allowed to make without delivering mail before the + The number of errors a remote SMTP client is + allowed to make without delivering mail before the Postfix SMTP server slows down all its responses. smtpd_hard_error_limit (normal: 20, stress: 1) - The maximal number of errors a remote SMTP client + The maximal number of errors a remote SMTP client is allowed to make without delivering mail. smtpd_junk_command_limit (normal: 100, stress: 1) - The number of junk commands (NOOP, VRFY, ETRN or + The number of junk commands (NOOP, VRFY, ETRN or RSET) that a remote SMTP client can send before the - Postfix SMTP server starts to increment the error + Postfix SMTP server starts to increment the error counter with each junk command. Available in Postfix version 2.1 and later: smtpd_recipient_overshoot_limit (1000) - The number of recipients that a remote SMTP client - can send in excess of the limit specified with + The number of recipients that a remote SMTP client + can send in excess of the limit specified with $smtpd_recipient_limit, before the Postfix SMTP - server increments the per-session error count for + server increments the per-session error count for each excess recipient. ACCESS POLICY DELEGATION CONTROLS - As of version 2.1, Postfix can be configured to delegate - access policy decisions to an external server that runs - outside Postfix. See the file SMTPD_POLICY_README for + As of version 2.1, Postfix can be configured to delegate + access policy decisions to an external server that runs + outside Postfix. See the file SMTPD_POLICY_README for more information. smtpd_policy_service_max_idle (300s) - The time after which an idle SMTPD policy service + The time after which an idle SMTPD policy service connection is closed. smtpd_policy_service_max_ttl (1000s) @@ -870,150 +874,150 @@ SMTPD(8) SMTPD(8) connection is closed. smtpd_policy_service_timeout (100s) - The time limit for connecting to, writing to or + The time limit for connecting to, writing to or receiving from a delegated SMTPD policy server. ACCESS CONTROLS - The SMTPD_ACCESS_README document gives an introduction to + The SMTPD_ACCESS_README document gives an introduction to all the SMTP server access control features. smtpd_delay_reject (yes) - Wait until the RCPT TO command before evaluating + Wait until the RCPT TO command before evaluating $smtpd_client_restrictions, $smtpd_helo_restric- tions and $smtpd_sender_restrictions, or wait until - the ETRN command before evaluating + the ETRN command before evaluating $smtpd_client_restrictions and $smtpd_helo_restric- tions. - parent_domain_matches_subdomains (see 'postconf -d' out- + parent_domain_matches_subdomains (see 'postconf -d' out- put) What Postfix features match subdomains of "domain.tld" automatically, instead of requiring an explicit ".domain.tld" pattern. smtpd_client_restrictions (empty) - Optional SMTP server access restrictions in the + Optional SMTP server access restrictions in the context of a client SMTP connection request. smtpd_helo_required (no) Require that a remote SMTP client introduces itself - at the beginning of an SMTP session with the HELO + at the beginning of an SMTP session with the HELO or EHLO command. smtpd_helo_restrictions (empty) - Optional restrictions that the Postfix SMTP server + Optional restrictions that the Postfix SMTP server applies in the context of the SMTP HELO command. smtpd_sender_restrictions (empty) - Optional restrictions that the Postfix SMTP server + Optional restrictions that the Postfix SMTP server applies in the context of the MAIL FROM command. smtpd_recipient_restrictions (permit_mynetworks, reject_unauth_destination) The access restrictions that the Postfix SMTP - server applies in the context of the RCPT TO com- + server applies in the context of the RCPT TO com- mand. smtpd_etrn_restrictions (empty) - Optional SMTP server access restrictions in the + Optional SMTP server access restrictions in the context of a client ETRN request. allow_untrusted_routing (no) - Forward mail with sender-specified routing - (user[@%!]remote[@%!]site) from untrusted clients + Forward mail with sender-specified routing + (user[@%!]remote[@%!]site) from untrusted clients to destinations matching $relay_domains. smtpd_restriction_classes (empty) - User-defined aliases for groups of access restric- + User-defined aliases for groups of access restric- tions. smtpd_null_access_lookup_key (<>) - The lookup key to be used in SMTP access(5) tables + The lookup key to be used in SMTP access(5) tables instead of the null sender address. permit_mx_backup_networks (empty) Restrict the use of the permit_mx_backup SMTP - access feature to only domains whose primary MX + access feature to only domains whose primary MX hosts match the listed networks. Available in Postfix version 2.0 and later: smtpd_data_restrictions (empty) - Optional access restrictions that the Postfix SMTP + Optional access restrictions that the Postfix SMTP server applies in the context of the SMTP DATA com- mand. smtpd_expansion_filter (see 'postconf -d' output) - What characters are allowed in $name expansions of + What characters are allowed in $name expansions of RBL reply templates. Available in Postfix version 2.1 and later: smtpd_reject_unlisted_sender (no) - Request that the Postfix SMTP server rejects mail - from unknown sender addresses, even when no - explicit reject_unlisted_sender access restriction + Request that the Postfix SMTP server rejects mail + from unknown sender addresses, even when no + explicit reject_unlisted_sender access restriction is specified. smtpd_reject_unlisted_recipient (yes) - Request that the Postfix SMTP server rejects mail + Request that the Postfix SMTP server rejects mail for unknown recipient addresses, even when no - explicit reject_unlisted_recipient access restric- + explicit reject_unlisted_recipient access restric- tion is specified. Available in Postfix version 2.2 and later: smtpd_end_of_data_restrictions (empty) - Optional access restrictions that the Postfix SMTP - server applies in the context of the SMTP END-OF- + Optional access restrictions that the Postfix SMTP + server applies in the context of the SMTP END-OF- DATA command. SENDER AND RECIPIENT ADDRESS VERIFICATION CONTROLS - Postfix version 2.1 introduces sender and recipient - address verification. This feature is implemented by - sending probe email messages that are not actually deliv- - ered. This feature is requested via the reject_unveri- - fied_sender and reject_unverified_recipient access - restrictions. The status of verification probes is main- + Postfix version 2.1 introduces sender and recipient + address verification. This feature is implemented by + sending probe email messages that are not actually deliv- + ered. This feature is requested via the reject_unveri- + fied_sender and reject_unverified_recipient access + restrictions. The status of verification probes is main- tained by the verify(8) server. See the file ADDRESS_VER- - IFICATION_README for information about how to configure + IFICATION_README for information about how to configure and operate the Postfix sender/recipient address verifica- tion service. address_verify_poll_count (3) - How many times to query the verify(8) service for - the completion of an address verification request + How many times to query the verify(8) service for + the completion of an address verification request in progress. address_verify_poll_delay (3s) - The delay between queries for the completion of an + The delay between queries for the completion of an address verification request in progress. address_verify_sender ($double_bounce_sender) - The sender address to use in address verification + The sender address to use in address verification probes; prior to Postfix 2.5 the default was "post- master". unverified_sender_reject_code (450) - The numerical Postfix SMTP server response code - when a recipient address is rejected by the + The numerical Postfix SMTP server response code + when a recipient address is rejected by the reject_unverified_sender restriction. unverified_recipient_reject_code (450) - The numerical Postfix SMTP server response when a + The numerical Postfix SMTP server response when a recipient address is rejected by the reject_unveri- fied_recipient restriction. Available in Postfix version 2.6 and later: unverified_sender_defer_code (450) - The numerical Postfix SMTP server response code - when a sender address probe fails due to a tempo- + The numerical Postfix SMTP server response code + when a sender address probe fails due to a tempo- rary error condition. unverified_recipient_defer_code (450) - The numerical Postfix SMTP server response when a - recipient address probe fails due to a temporary + The numerical Postfix SMTP server response when a + recipient address probe fails due to a temporary error condition. unverified_sender_reject_reason (empty) @@ -1027,7 +1031,7 @@ SMTPD(8) SMTPD(8) unverified_sender_tempfail_action ($reject_temp- fail_action) The Postfix SMTP server's action when reject_unver- - ified_sender fails due to a temporary error condi- + ified_sender fails due to a temporary error condi- tion. unverified_recipient_tempfail_action ($reject_temp- @@ -1037,7 +1041,7 @@ SMTPD(8) SMTPD(8) dition. ACCESS CONTROL RESPONSES - The following parameters control numerical SMTP reply + The following parameters control numerical SMTP reply codes and/or text responses. access_map_reject_code (554) @@ -1045,18 +1049,18 @@ SMTPD(8) SMTPD(8) an access(5) map "reject" action. defer_code (450) - The numerical Postfix SMTP server response code - when a remote SMTP client request is rejected by + The numerical Postfix SMTP server response code + when a remote SMTP client request is rejected by the "defer" restriction. invalid_hostname_reject_code (501) - The numerical Postfix SMTP server response code - when the client HELO or EHLO command parameter is - rejected by the reject_invalid_helo_hostname + The numerical Postfix SMTP server response code + when the client HELO or EHLO command parameter is + rejected by the reject_invalid_helo_hostname restriction. maps_rbl_reject_code (554) - The numerical Postfix SMTP server response code + The numerical Postfix SMTP server response code when a remote SMTP client request is blocked by the reject_rbl_client, reject_rhsbl_client, reject_rhsbl_sender or reject_rhsbl_recipient @@ -1064,53 +1068,53 @@ SMTPD(8) SMTPD(8) non_fqdn_reject_code (504) The numerical Postfix SMTP server reply code when a - client request is rejected by the + client request is rejected by the reject_non_fqdn_helo_hostname, reject_non_fqdn_sender or reject_non_fqdn_recipient restriction. plaintext_reject_code (450) - The numerical Postfix SMTP server response code - when a request is rejected by the reject_plain- + The numerical Postfix SMTP server response code + when a request is rejected by the reject_plain- text_session restriction. reject_code (554) - The numerical Postfix SMTP server response code - when a remote SMTP client request is rejected by + The numerical Postfix SMTP server response code + when a remote SMTP client request is rejected by the "reject" restriction. relay_domains_reject_code (554) - The numerical Postfix SMTP server response code - when a client request is rejected by the + The numerical Postfix SMTP server response code + when a client request is rejected by the reject_unauth_destination recipient restriction. unknown_address_reject_code (450) - The numerical Postfix SMTP server response code - when a sender or recipient address is rejected by + The numerical Postfix SMTP server response code + when a sender or recipient address is rejected by the reject_unknown_sender_domain or reject_unknown_recipient_domain restriction. unknown_client_reject_code (450) - The numerical Postfix SMTP server response code - when a client without valid address <=> name map- + The numerical Postfix SMTP server response code + when a client without valid address <=> name map- ping is rejected by the reject_unknown_client_host- name restriction. unknown_hostname_reject_code (450) - The numerical Postfix SMTP server response code - when the hostname specified with the HELO or EHLO - command is rejected by the + The numerical Postfix SMTP server response code + when the hostname specified with the HELO or EHLO + command is rejected by the reject_unknown_helo_hostname restriction. Available in Postfix version 2.0 and later: default_rbl_reply (see 'postconf -d' output) - The default SMTP server response template for a - request that is rejected by an RBL-based restric- + The default SMTP server response template for a + request that is rejected by an RBL-based restric- tion. multi_recipient_bounce_reject_code (550) - The numerical Postfix SMTP server response code + The numerical Postfix SMTP server response code when a remote SMTP client request is blocked by the reject_multi_recipient_bounce restriction. @@ -1121,38 +1125,38 @@ SMTPD(8) SMTPD(8) access_map_defer_code (450) The numerical Postfix SMTP server response code for - an access(5) map "defer" action, including + an access(5) map "defer" action, including "defer_if_permit" or "defer_if_reject". reject_tempfail_action (defer_if_permit) The Postfix SMTP server's action when a reject-type - restriction fails due to a temporary error condi- + restriction fails due to a temporary error condi- tion. unknown_helo_hostname_tempfail_action ($reject_temp- fail_action) - The Postfix SMTP server's action when + The Postfix SMTP server's action when reject_unknown_helo_hostname fails due to an tempo- rary error condition. unknown_address_tempfail_action ($reject_tempfail_action) - The Postfix SMTP server's action when + The Postfix SMTP server's action when reject_unknown_sender_domain or - reject_unknown_recipient_domain fail due to a tem- + reject_unknown_recipient_domain fail due to a tem- porary error condition. MISCELLANEOUS CONTROLS config_directory (see 'postconf -d' output) - The default location of the Postfix main.cf and + The default location of the Postfix main.cf and master.cf configuration files. daemon_timeout (18000s) - How much time a Postfix daemon process may take to - handle a request before it is terminated by a + How much time a Postfix daemon process may take to + handle a request before it is terminated by a built-in watchdog timer. command_directory (see 'postconf -d' output) - The location of all postfix administrative com- + The location of all postfix administrative com- mands. double_bounce_sender (double-bounce) @@ -1173,37 +1177,37 @@ SMTPD(8) SMTPD(8) and most Postfix daemon processes. max_idle (100s) - The maximum amount of time that an idle Postfix - daemon process waits for an incoming connection + The maximum amount of time that an idle Postfix + daemon process waits for an incoming connection before terminating voluntarily. max_use (100) - The maximal number of incoming connections that a - Postfix daemon process will service before termi- + The maximal number of incoming connections that a + Postfix daemon process will service before termi- nating voluntarily. myhostname (see 'postconf -d' output) The internet hostname of this mail system. mynetworks (see 'postconf -d' output) - The list of "trusted" SMTP clients that have more + The list of "trusted" SMTP clients that have more privileges than "strangers". myorigin ($myhostname) The domain name that locally-posted mail appears to - come from, and that locally posted mail is deliv- + come from, and that locally posted mail is deliv- ered to. process_id (read-only) - The process ID of a Postfix command or daemon + The process ID of a Postfix command or daemon process. process_name (read-only) - The process name of a Postfix command or daemon + The process name of a Postfix command or daemon process. queue_directory (see 'postconf -d' output) - The location of the Postfix top-level queue direc- + The location of the Postfix top-level queue direc- tory. recipient_delimiter (empty) @@ -1211,28 +1215,28 @@ SMTPD(8) SMTPD(8) sions (user+foo). smtpd_banner ($myhostname ESMTP $mail_name) - The text that follows the 220 status code in the + The text that follows the 220 status code in the SMTP greeting banner. syslog_facility (mail) The syslog facility of Postfix logging. syslog_name (see 'postconf -d' output) - The mail system name that is prepended to the - process name in syslog records, so that "smtpd" + The mail system name that is prepended to the + process name in syslog records, so that "smtpd" becomes, for example, "postfix/smtpd". Available in Postfix version 2.2 and later: smtpd_forbidden_commands (CONNECT, GET, POST) - List of commands that causes the Postfix SMTP - server to immediately terminate the session with a + List of commands that causes the Postfix SMTP + server to immediately terminate the session with a 221 code. Available in Postfix version 2.5 and later: smtpd_client_port_logging (no) - Enable logging of the remote SMTP client port in + Enable logging of the remote SMTP client port in addition to the hostname and IP address. SEE ALSO @@ -1262,7 +1266,7 @@ SMTPD(8) SMTPD(8) XFORWARD_README, Postfix XFORWARD extension LICENSE - The Secure Mailer license must be distributed with this + The Secure Mailer license must be distributed with this software. AUTHOR(S) diff --git a/postfix/makedefs b/postfix/makedefs index 071a30ef0..dd486cc9b 100644 --- a/postfix/makedefs +++ b/postfix/makedefs @@ -144,6 +144,8 @@ case "$SYSTEM.$RELEASE" in ;; FreeBSD.7*) SYSTYPE=FREEBSD7 ;; + FreeBSD.8*) SYSTYPE=FREEBSD8 + ;; OpenBSD.2*) SYSTYPE=OPENBSD2 ;; OpenBSD.3*) SYSTYPE=OPENBSD3 diff --git a/postfix/man/man5/postconf.5 b/postfix/man/man5/postconf.5 index 2cf5b4959..898a5329f 100644 --- a/postfix/man/man5/postconf.5 +++ b/postfix/man/man5/postconf.5 @@ -6779,6 +6779,58 @@ smtpd_client_restrictions = permit_mynetworks, reject_unknown_client_hostname .fi .ad .ft R +.SH smtpd_command_filter (default: empty) +A mechanism to substitute incoming SMTP commands. This is a +last-resort tool to work around problems with clients that send +invalid command syntax that would otherwise be rejected by Postfix. +.PP +Specify the name of a "type:table" lookup table. The search +string is the SMTP command as received from the SMTP client. The +only change made is to remove initial whitespace and the trailing + characters. The result value is executed by the Postfix +SMTP server. +.PP +Examples: +.PP +.nf +.na +.ft C +/etc/postfix/main.cf: + smtpd_command_filter = pcre:/etc/postfix/command_filter +.fi +.ad +.ft R +.PP +.nf +.na +.ft C +/etc/postfix/command_filter: + # Work around clients that send malformed HELO commands. + /^HELO\es*$/ HELO domain.invalid +.fi +.ad +.ft R +.PP +.nf +.na +.ft C + # Work around clients that send empty lines. + /^\es*$/ NOOP +.fi +.ad +.ft R +.PP +.nf +.na +.ft C + # Work around clients that enclose addresses in single quotes. + # WARNING: do not lose the parameters that follow the address. + /^RCPT\es+TO:\es*<'([^[:space:]]+)'>(.*)/ RCPT TO:<$1>$2 +.fi +.ad +.ft R +.PP +This feature is available in Postfix 2.7. .SH smtpd_data_restrictions (default: empty) Optional access restrictions that the Postfix SMTP server applies in the context of the SMTP DATA command. diff --git a/postfix/man/man8/postscreen.8 b/postfix/man/man8/postscreen.8 index 550f3252c..1d2e0cca4 100644 --- a/postfix/man/man8/postscreen.8 +++ b/postfix/man/man8/postscreen.8 @@ -16,15 +16,16 @@ The Postfix \fBpostscreen\fR(8) server performs triage on multiple inbound SMTP connections in parallel. The program can run in two basic modes. -In \fBobservation mode\fR the purpose is to collect statistics +The purpose of \fBobservation mode\fR is to collect statistics without actually blocking mail. \fBpostscreen\fR(8) runs a number of tests before it forwards a connection to a real SMTP server process. These tests introduce a delay of a few seconds; once a client passes the tests as "clean", its -IP address is whitelisted and subsequent connections incur -no delays until the whitelist entry expires. +IP address is temporarily whitelisted and subsequent +connections incur no delays until the temporary whitelist +entry expires. -In \fBenforcement mode\fR the purpose is to block mail +The purpose of \fBenforcement mode\fR is to block mail without using up one Postfix SMTP server process for every connection. Here, \fBpostscreen\fR(8) terminates connections from SMTP clients that fail the above tests, and forwards @@ -46,9 +47,10 @@ as described in the sections that follow. .fi The postscreen_blacklist_networks parameter (default: empty) specifies a permanent blacklist for SMTP client IP addresses. -The address syntax is as with mynetworks. When the SMTP -client address matches the permanent blacklist, this is -logged as: +The address syntax is as with mynetworks. + +When the SMTP client address matches the permanent blacklist, +this is logged as: .sp .nf \fBBLACKLISTED \fIaddress\fR @@ -71,8 +73,10 @@ recipient information. The postscreen_whitelist_networks parameter (default: $mynetworks) specifies a permanent whitelist for SMTP client IP addresses. This feature is not used for addresses that -appear on the permanent blacklist. When the SMTP client -address matches the permanent whitelist, this is logged as: +appear on the permanent blacklist. + +When the SMTP client address matches the permanent whitelist, +this is logged as: .sp .nf \fBWHITELISTED \fIaddress\fR @@ -113,6 +117,7 @@ The postscreen_greet_wait parameter specifies a time interval during which \fBpostscreen\fR(8) runs a number of tests as described below. These tests run before the client may see the real SMTP server's "220 text..." server greeting. + When the SMTP client passes all the tests, this is logged as: .sp @@ -149,8 +154,8 @@ postscreen_whitelist_networks feature or else specify an empty postscreen_greet_banner value to disable the "220-text..." teaser banner. -When an SMTP client speaks before the postscreen_greet_wait -time has elapsed, this is logged as: +When an SMTP client sends a command before the +postscreen_greet_wait time has elapsed, this is logged as: .sp .nf \fBPREGREET \fIcount \fBafter \fItime \fBfrom \fIaddress text...\fR @@ -158,9 +163,9 @@ time has elapsed, this is logged as: .sp Translation: the client at \fIaddress\fR sent \fIcount\fR bytes before its turn to speak, and this happened \fItime\fR -seconds after the test started. The \fItext\fR is what the -client sent (truncated at 100 bytes, and with non-printable -characters replaced with "?"). +seconds after the postscreen_greet_wait timer was started. +The \fItext\fR is what the client sent (truncated to 100 +bytes, and with non-printable characters replaced with "?"). The postscreen_greet_action parameter specifies the action that is taken next: @@ -201,10 +206,11 @@ Drop the connection immediately. .ad .fi The postscreen_dnsbl_sites parameter (default: empty) -specifies a list of DNS blocklist servers. When the -postscreen_greet_wait time has elapsed, and the SMTP client -address is reported by at least one of these blocklists, -this is logged as: +specifies a list of DNS blocklist servers. + +When the postscreen_greet_wait time has elapsed, and the +SMTP client address is listed with at least one of these +blocklists, this is logged as: .sp .nf \fBDNSBL rank \fIcount \fBfor \fIaddress\fR diff --git a/postfix/man/man8/smtpd.8 b/postfix/man/man8/smtpd.8 index dc7ebc13d..6ef70df25 100644 --- a/postfix/man/man8/smtpd.8 +++ b/postfix/man/man8/smtpd.8 @@ -108,6 +108,9 @@ Available in Postfix version 2.1 and later: Resolve an address that ends in the "@" null domain as if the local hostname were specified, instead of rejecting the address as invalid. +.IP "\fBsmtpd_command_filter (empty)\fR" +A mechanism to substitute incoming SMTP commands by other +commands. .IP "\fBsmtpd_reject_unlisted_sender (no)\fR" Request that the Postfix SMTP server rejects mail from unknown sender addresses, even when no explicit reject_unlisted_sender diff --git a/postfix/mantools/postlink b/postfix/mantools/postlink index 4e0a3d69f..a07af388d 100755 --- a/postfix/mantools/postlink +++ b/postfix/mantools/postlink @@ -484,6 +484,7 @@ while (<>) { s;\bsmtpd_client_recipient_rate_limit\b;$&;g; s;\bsmtpd_client_new_tls_session_rate_limit\b;$&;g; s;\bsmtpd_client_restrictions\b;$&;g; + s;\bsmtpd_command_filter\b;$&;g; s;\bsmtpd_data_restrictions\b;$&;g; s;\bsmtpd_delay_open_until_valid_rcpt\b;$&;g; s;\bsmtpd_delay_reject\b;$&;g; diff --git a/postfix/proto/STANDARD_CONFIGURATION_README.html b/postfix/proto/STANDARD_CONFIGURATION_README.html index 4edc339f1..f5f5c9eb5 100644 --- a/postfix/proto/STANDARD_CONFIGURATION_README.html +++ b/postfix/proto/STANDARD_CONFIGURATION_README.html @@ -442,6 +442,9 @@ matches $inet_interfaces or $proxy_interfaces.

+

Execute the command "postmap /etc/postfix/virtual" after +editing the file.

. +

Running Postfix behind a firewall

The simplest way to set up Postfix on a host behind a firewalled diff --git a/postfix/proto/postconf.proto b/postfix/proto/postconf.proto index 335e230b7..5340ea671 100644 --- a/postfix/proto/postconf.proto +++ b/postfix/proto/postconf.proto @@ -12555,6 +12555,45 @@ action, or forward the connection to a real SMTP server process.

Drop the connection immediately with a 521 SMTP reply, without reporting PREGREET, HANGUP or DNSBL results.
+ +

This feature is available in Postfix 2.7.

- +%PARAM smtpd_command_filter + +

A mechanism to substitute incoming SMTP commands. This is a +last-resort tool to work around problems with clients that send +invalid command syntax that would otherwise be rejected by Postfix. +

+ +

Specify the name of a "type:table" lookup table. The search +string is the SMTP command as received from the SMTP client. The +only change made is to remove initial whitespace and the trailing + characters. The result value is executed by the Postfix +SMTP server.

+ +

Examples:

+ +
+/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 enclose addresses in single quotes.
+    # WARNING: do not lose the parameters that follow the address.
+    /^RCPT\s+TO:\s*<'([^[:space:]]+)'>(.*)/     RCPT TO:<$1>$2
+
+ +

This feature is available in Postfix 2.7.

diff --git a/postfix/src/global/mail_params.h b/postfix/src/global/mail_params.h index cdb691078..4b84ca454 100644 --- a/postfix/src/global/mail_params.h +++ b/postfix/src/global/mail_params.h @@ -1148,6 +1148,10 @@ extern char *var_smtpd_noop_cmds; #define DEF_SMTPD_FORBID_CMDS "CONNECT GET POST" extern char *var_smtpd_forbid_cmds; +#define VAR_SMTPD_CMD_FILTER "smtpd_command_filter" +#define DEF_SMTPD_CMD_FILTER "" +extern char *var_smtpd_cmd_filter; + #define VAR_SMTPD_TLS_WRAPPER "smtpd_tls_wrappermode" #define DEF_SMTPD_TLS_WRAPPER 0 extern bool var_smtpd_tls_wrappermode; diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index 29735886b..58e17d866 100644 --- a/postfix/src/global/mail_version.h +++ b/postfix/src/global/mail_version.h @@ -20,7 +20,7 @@ * Patches change both the patchlevel and the release date. Snapshots have no * patchlevel; they change the release date only. */ -#define MAIL_RELEASE_DATE "20091008" +#define MAIL_RELEASE_DATE "20091023" #define MAIL_VERSION_NUMBER "2.7" #ifdef SNAPSHOT diff --git a/postfix/src/postmulti/postmulti.c b/postfix/src/postmulti/postmulti.c index 9cfec54a2..d8f12e1a0 100644 --- a/postfix/src/postmulti/postmulti.c +++ b/postfix/src/postmulti/postmulti.c @@ -1528,6 +1528,8 @@ static int iterate_command(int iter_cmd, int iter_flags, char **argv, */ FOREACH_ITERATOR_INSTANCE(iter_flags, entry) { ip = RING_TO_INSTANCE(entry); + if ((iter_flags & ITER_FLAG_SKIP_DISABLED) && !ip->enabled) + continue; if (!match_instance_selection(ip, selection)) continue; matched = 1; diff --git a/postfix/src/postscreen/postscreen.c b/postfix/src/postscreen/postscreen.c index 76595bf92..4178a57c5 100644 --- a/postfix/src/postscreen/postscreen.c +++ b/postfix/src/postscreen/postscreen.c @@ -10,15 +10,16 @@ /* multiple inbound SMTP connections in parallel. The program /* can run in two basic modes. /* -/* In \fBobservation mode\fR the purpose is to collect statistics +/* The purpose of \fBobservation mode\fR is to collect statistics /* without actually blocking mail. \fBpostscreen\fR(8) runs a /* number of tests before it forwards a connection to a real /* SMTP server process. These tests introduce a delay of a /* few seconds; once a client passes the tests as "clean", its -/* IP address is whitelisted and subsequent connections incur -/* no delays until the whitelist entry expires. +/* IP address is temporarily whitelisted and subsequent +/* connections incur no delays until the temporary whitelist +/* entry expires. /* -/* In \fBenforcement mode\fR the purpose is to block mail +/* The purpose of \fBenforcement mode\fR is to block mail /* without using up one Postfix SMTP server process for every /* connection. Here, \fBpostscreen\fR(8) terminates connections /* from SMTP clients that fail the above tests, and forwards @@ -38,9 +39,10 @@ /* .fi /* The postscreen_blacklist_networks parameter (default: empty) /* specifies a permanent blacklist for SMTP client IP addresses. -/* The address syntax is as with mynetworks. When the SMTP -/* client address matches the permanent blacklist, this is -/* logged as: +/* The address syntax is as with mynetworks. +/* +/* When the SMTP client address matches the permanent blacklist, +/* this is logged as: /* .sp /* .nf /* \fBBLACKLISTED \fIaddress\fR @@ -61,8 +63,10 @@ /* The postscreen_whitelist_networks parameter (default: /* $mynetworks) specifies a permanent whitelist for SMTP client /* IP addresses. This feature is not used for addresses that -/* appear on the permanent blacklist. When the SMTP client -/* address matches the permanent whitelist, this is logged as: +/* appear on the permanent blacklist. +/* +/* When the SMTP client address matches the permanent whitelist, +/* this is logged as: /* .sp /* .nf /* \fBWHITELISTED \fIaddress\fR @@ -99,6 +103,7 @@ /* during which \fBpostscreen\fR(8) runs a number of tests as /* described below. These tests run before the client may /* see the real SMTP server's "220 text..." server greeting. +/* /* When the SMTP client passes all the tests, this is logged /* as: /* .sp @@ -133,8 +138,8 @@ /* empty postscreen_greet_banner value to disable the "220-text..." /* teaser banner. /* -/* When an SMTP client speaks before the postscreen_greet_wait -/* time has elapsed, this is logged as: +/* When an SMTP client sends a command before the +/* postscreen_greet_wait time has elapsed, this is logged as: /* .sp /* .nf /* \fBPREGREET \fIcount \fBafter \fItime \fBfrom \fIaddress text...\fR @@ -142,9 +147,9 @@ /* .sp /* Translation: the client at \fIaddress\fR sent \fIcount\fR /* bytes before its turn to speak, and this happened \fItime\fR -/* seconds after the test started. The \fItext\fR is what the -/* client sent (truncated at 100 bytes, and with non-printable -/* characters replaced with "?"). +/* seconds after the postscreen_greet_wait timer was started. +/* The \fItext\fR is what the client sent (truncated to 100 +/* bytes, and with non-printable characters replaced with "?"). /* /* The postscreen_greet_action parameter specifies the action /* that is taken next: @@ -181,10 +186,11 @@ /* .ad /* .fi /* The postscreen_dnsbl_sites parameter (default: empty) -/* specifies a list of DNS blocklist servers. When the -/* postscreen_greet_wait time has elapsed, and the SMTP client -/* address is reported by at least one of these blocklists, -/* this is logged as: +/* specifies a list of DNS blocklist servers. +/* +/* When the postscreen_greet_wait time has elapsed, and the +/* SMTP client address is listed with at least one of these +/* blocklists, this is logged as: /* .sp /* .nf /* \fBDNSBL rank \fIcount \fBfor \fIaddress\fR @@ -1089,9 +1095,6 @@ static void postscreen_service(VSTREAM *smtp_client_stream, * by way of teaser, then wait briefly to see if the client speaks before * its turn. * - * This is where we would do DNS blocklist lookup in the background, and - * cancel the lookup when the client takes action first. - * * Before sending the banner we could set the TCP window to the smallest * possible value to save some network bandwidth, at least with spamware * that waits until the server starts speaking. diff --git a/postfix/src/smtpd/smtpd.c b/postfix/src/smtpd/smtpd.c index 5d1b20a58..787c48414 100644 --- a/postfix/src/smtpd/smtpd.c +++ b/postfix/src/smtpd/smtpd.c @@ -92,6 +92,9 @@ /* Resolve an address that ends in the "@" null domain as if the /* local hostname were specified, instead of rejecting the address as /* invalid. +/* .IP "\fBsmtpd_command_filter (empty)\fR" +/* A mechanism to substitute incoming SMTP commands by other +/* commands. /* .IP "\fBsmtpd_reject_unlisted_sender (no)\fR" /* Request that the Postfix SMTP server rejects mail from unknown /* sender addresses, even when no explicit reject_unlisted_sender @@ -1164,6 +1167,7 @@ bool var_smtpd_use_tls; bool var_smtpd_enforce_tls; bool var_smtpd_tls_wrappermode; bool var_smtpd_tls_auth_only; +char *var_smtpd_cmd_filter; #ifdef USE_TLS char *var_smtpd_relay_ccerts; @@ -1306,6 +1310,11 @@ static int ask_client_cert; static int enforce_tls; + /* + * SMTP command mapping for broken clients. + */ +static DICT *smtpd_cmd_filter; + #ifdef USE_SASL_AUTH /* @@ -4163,6 +4172,7 @@ static void smtpd_proto(SMTPD_STATE *state) const char *ehlo_words; const char *err; int status; + const char *cp; /* * Print a greeting banner and run the state machine. Read SMTP commands @@ -4423,6 +4433,12 @@ static void smtpd_proto(SMTPD_STATE *state) } watchdog_pat(); smtpd_chat_query(state); + if (smtpd_cmd_filter != 0) { + for (cp = STR(state->buffer); *cp && IS_SPACE_TAB(*cp); cp++) + /* void */ ; + if ((cp = dict_get(smtpd_cmd_filter, cp)) != 0) + vstring_strcpy(state->buffer, cp); + } if ((argc = smtpd_token(vstring_str(state->buffer), &argv)) == 0) { state->error_mask |= MAIL_ERROR_PROTOCOL; smtpd_chat_reply(state, "500 5.5.2 Error: bad syntax"); @@ -4696,6 +4712,10 @@ static void pre_jail_init(char *unused_name, char **unused_argv) VAR_SMTPD_SASL_ENABLE); #endif + if (*var_smtpd_cmd_filter) + smtpd_cmd_filter = dict_open(var_smtpd_cmd_filter, O_RDONLY, + DICT_FLAG_LOCK | DICT_FLAG_FOLD_FIX); + /* * XXX Temporary fix to pretend that we consistently implement TLS * security levels. We implement only a subset for now. If we implement @@ -5069,6 +5089,7 @@ int main(int argc, char **argv) VAR_UNK_ADDR_TF_ACT, DEF_UNK_ADDR_TF_ACT, &var_unk_addr_tf_act, 1, 0, VAR_UNV_RCPT_TF_ACT, DEF_UNV_RCPT_TF_ACT, &var_unv_rcpt_tf_act, 1, 0, VAR_UNV_FROM_TF_ACT, DEF_UNV_FROM_TF_ACT, &var_unv_from_tf_act, 1, 0, + VAR_SMTPD_CMD_FILTER, DEF_SMTPD_CMD_FILTER, &var_smtpd_cmd_filter, 0, 0, 0, }; static const CONFIG_RAW_TABLE raw_table[] = { diff --git a/postfix/src/util/sys_defs.h b/postfix/src/util/sys_defs.h index 5e5368bc3..0d25348b5 100644 --- a/postfix/src/util/sys_defs.h +++ b/postfix/src/util/sys_defs.h @@ -25,6 +25,7 @@ */ #if defined(FREEBSD2) || defined(FREEBSD3) || defined(FREEBSD4) \ || defined(FREEBSD5) || defined(FREEBSD6) || defined(FREEBSD7) \ + || defined(FREEBSD8) \ || defined(BSDI2) || defined(BSDI3) || defined(BSDI4) \ || defined(OPENBSD2) || defined(OPENBSD3) || defined(OPENBSD4) \ || defined(NETBSD1) || defined(NETBSD2) || defined(NETBSD3) \