From: Wietse Venema
With mandatory TLS encryption, the Postfix SMTP server will by -default only use SSLv3 or TLSv1. SSLv2 is only used when TLS encryption -is optional. This is controlled by the smtpd_tls_mandatory_protocols -configuration parameter.
-The Postfix SMTP server supports 5 distinct cipher security levels as specified by the smtpd_tls_mandatory_ciphers configuration parameter, which determines the cipher grade with mandatory TLS encryption. The default value is "medium" which is essentially 128-bit encryption or better. With opportunistic TLS encryption, the minimum accepted cipher grade is -always "export".
- -By default anonymous ciphers are allowed, and automatically disabled -when client certificates are requested. If clients are expected to always -verify the server certificate you may want to exclude anonymous ciphers -by setting "smtpd_tls_mandatory_exclude_ciphers = aNULL". -One can't force a client to check the server certificate, so excluding +typically "export". Postfix ≥ 2.6 has a corresponding smtpd_tls_ciphers +parameter which controls the cipher grade used with opportunistic TLS.
+ +By default anonymous ciphers are enabled. They are automatically +disabled when remote SMTP client certificates are requested. If +clients are expected to always verify the Postfix SMTP +server certificate you may want to disable anonymous ciphers +by setting "smtpd_tls_mandatory_exclude_ciphers = aNULL" or +"smtpd_tls_exclude_ciphers = aNULL", as appropriate. One can't force +a remote SMTP client to check the server certificate, so excluding anonymous ciphers is generally unnecessary.
-For a server that is not a public Internet MX host, Postfix 2.3 +
The "smtpd_tls_ciphers" (Postfix ≥ 2.6) configuration parameter +provides control over the minimum cipher grade for opportunistic TLS. With +Postfix < 2.6, the minimum opportunistic TLS cipher grade is always +"export".
+ +With mandatory TLS encryption, the Postfix SMTP server will by +default only use SSLv3 or TLSv1. SSLv2 is only used when TLS encryption +is optional. The mandatory TLS protocol list is specified via the +smtpd_tls_mandatory_protocols configuration parameter. Postfix ≥ +2.6 has a corresponding smtpd_tls_protocols parameter which controls +the SSL/TLS protocols used with opportunistic TLS.
+ +For a server that is not a public Internet MX host, Postfix (≥ 2.3) supports configurations with no server certificates that use only the anonymous ciphers. This is enabled by explicitly setting "smtpd_tls_cert_file = none" @@ -1264,11 +1274,12 @@ With Postfix 2.3 and later, opportunistic TLS can be configured by setting "smtp_tls_security_level = may".
Since sending in the clear is acceptable, demanding stronger -than default TLS security merely reduces inter-operability. For -this reason, Postfix 2.3 and later ignore the smtp_tls_mandatory_ciphers -and smtp_tls_mandatory_protocols parameters at the "may" -security level: all protocols are allowed, and "export" grade or -better ciphers are used.
+than default TLS security mostly reduces inter-operability. If you +must restrict TLS protocol or cipher selection even with opportunistic +TLS, the Postfix ≥ 2.6 "smtp_tls_ciphers" and "smtp_tls_protocols" +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.With Postfix 2.2 and earlier, or when smtp_tls_security_level is set to its default (backwards compatible) empty value, the appropriate @@ -1820,15 +1831,19 @@ describe the corresponding table syntax:
additional attributes are supported at this level.The "exclude" attribute (Postfix ≥ 2.6) is used to disable +ciphers that cause handshake failures with a specific mandatory TLS +destination, without disabling the ciphers for all mandatory destinations. +Alternatively, you can exclude ciphers that cause issues with multiple +remote servers in main.cf, and selectively enable them on a per-destination +basis in the policy table by setting a shorter or empty exclusion list. The +per-destination "exclude" list preempts both the opportunistic and +mandatory security level exclusions, so that all excluded ciphers +can be enabled for known-good destinations. For non-mandatory TLS +destinations that exhibit cipher-specific problems, Postfix will fall +back to plain-text delivery. If plain-text is not acceptable make TLS +mandatory and exclude the problem ciphers.
+@@ -1906,6 +1934,8 @@ Example: [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 + # Postfix 2.6 and later + example.info may protocols=!SSLv2 ciphers=medium exclude=3DES @@ -2193,6 +2223,18 @@ no need to take these measures. Anonymous ciphers save bandwidth and TLS session cache space, if certificates are ignored, there is little point in requesting them.
+The "smtp_tls_ciphers" (Postfix ≥ 2.6) configuration parameter +provides control over the minimum cipher grade for opportunistic TLS. With +Postfix < 2.6, the minimum opportunistic TLS cipher grade is always +"export".
+ +With mandatory TLS encryption, the Postfix SMTP client will by +default only use SSLv3 or TLSv1. SSLv2 is only used when TLS encryption +is optional. The mandatory TLS protocol list is specified via the +smtp_tls_mandatory_protocols configuration parameter. Postfix ≥ +2.6 has a corresponding smtp_tls_protocols parameter which controls +the SSL/TLS protocols used with opportunistic TLS.
+Example:
@@ -2204,6 +2246,9 @@ little point in requesting them. smtp_tls_mandatory_protocols = SSLv3, TLSv1 # Also available with Postfix ≥ 2.5: smtp_tls_mandatory_protocols = !SSLv2 + # Also available with Postfix ≥ 2.6: + smtp_tls_ciphers = export + smtp_tls_protocols =diff --git a/postfix/html/XFORWARD_README.html b/postfix/html/XFORWARD_README.html index 9eddd6170..64b60c662 100644 --- a/postfix/html/XFORWARD_README.html +++ b/postfix/html/XFORWARD_README.html @@ -95,6 +95,10 @@ names are shown in upper case, they are in fact case insensitive. is unavailable. Address information is not enclosed with []. +
When both the NAME and ADDR attributes have the value + [UNAVAILABLE], the upcoming MAIL FROM transaction corresponds + to a local submission.
+The PORT attribute specifies an up-stream client TCP port number in decimal, or [UNAVAILABLE] when the information is unavailable.
@@ -151,11 +155,6 @@ initializes all XFORWARD attributes to [UNAVAILABLE]. With each valid XFORWARD command, the server updates XFORWARD attributes with the specified values. -When both the NAME and ADDR attributes have the value [UNAVAILABLE], -the MAIL FROM transaction corresponds to a local submission. In -this case the server must also treat the HELO, PORT and PROTO -attributes as [UNAVAILABLE].
-When the server uses XFORWARD attributes for logging purposes, it must not mix XFORWARD attributes with attributes from the current SMTP session.
diff --git a/postfix/html/lmtp.8.html b/postfix/html/lmtp.8.html index ddfc4ab1c..fd01a39d5 100644 --- a/postfix/html/lmtp.8.html +++ b/postfix/html/lmtp.8.html @@ -194,7 +194,7 @@ SMTP(8) SMTP(8) smtp_quote_rfc821_envelope (yes) Quote addresses in SMTP MAIL FROM and RCPT TO com- - mands as required by RFC 821. + mands as required by RFC 2821. smtp_skip_5xx_greeting (yes) Skip SMTP servers that greet with a 5XX status code @@ -509,6 +509,17 @@ SMTP(8) SMTP(8) The message digest algorithm used to construct remote SMTP server certificate fingerprints. + Available in Postfix version 2.6 and later: + + smtp_tls_protocols (empty) + List of TLS protocols that the Postfix SMTP client + will exclude or include with opportunistic TLS + encryption. + + smtp_tls_ciphers (export) + The minimum TLS cipher grade that the Postfix SMTP + client will use with opportunistic TLS encryption. + OBSOLETE STARTTLS CONTROLS The following configuration parameters exist for compati- bility with Postfix versions before 2.3. Support for these @@ -547,7 +558,7 @@ SMTP(8) SMTP(8) smtp_destination_recipient_limit ($default_destina- tion_recipient_limit) - The maximal number of recipients per delivery via + The maximal number of recipients per message for the smtp message delivery transport. smtp_connect_timeout (30s) diff --git a/postfix/html/postconf.5.html b/postfix/html/postconf.5.html index bc1080e74..d8236ca9f 100644 --- a/postfix/html/postconf.5.html +++ b/postfix/html/postconf.5.html @@ -4185,6 +4185,17 @@ configuration parameter. See there for details.This feature is available in Postfix 2.3 and later.
+The LMTP-specific version of the smtp_tls_ciphers configuration +parameter. See there for details.
+ +This feature is available in Postfix 2.6 and later.
+ +This feature is available in Postfix 2.3 and later.
+ + +The LMTP-specific version of the smtp_tls_protocols configuration +parameter. See there for details.
+ +This feature is available in Postfix 2.6 and later.
+ +The minimum TLS cipher grade that the Postfix SMTP client +will use with opportunistic TLS encryption. Cipher types listed in +smtp_tls_exclude_ciphers are excluded from the base definition of +the selected cipher grade. The default value "export" ensures maximum +inter-operability. Because encryption is optional, stronger controls +are not appropriate, and this setting SHOULD NOT be changed unless the +change is essential.
+ +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.
+ +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.
@@ -9165,9 +9219,10 @@ settings. "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 only apply when TLS encryption -is mandatory. Connections for which encryption is optional enable -all "export" grade and better ciphers. +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 and all SSL/TLS protocols +(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 @@ -9223,21 +9278,23 @@ security are:
This feature is available in Postfix 2.3 and later.
+List of TLS protocols that the Postfix SMTP client will exclude +or include with opportunistic TLS encryption. This parameter SHOULD be +left at its default empty value, allowing all protocols to be used with +opportunistic TLS.
+ +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 SSL_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:
++smtp_tls_protocols = !SSLv2 ++ +
This feature is available in Postfix 2.6 and later.
+ +# Opportunistic TLS. smtp_tls_security_level = may +# Postfix ≥ 2.6: +# Do not tweak opportunistic ciphers or protocols 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 =
@@ -11929,6 +12028,33 @@ clients. Postfix 2.3 and later; use smtpd_tls_mandatory_ciphers instead. + + +
The minimum TLS cipher grade that the Postfix SMTP server +will use with opportunistic TLS encryption. Cipher types listed in +smtpd_tls_exclude_ciphers are excluded from the base definition of +the selected cipher grade. The default value "export" ensures maximum +inter-operability. Because encryption is optional, stronger controls +are not appropriate, and this setting SHOULD NOT be changed unless the +change is essential.
+ +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.
+ +The minimum TLS cipher grade that the Postfix SMTP server will -use with mandatory -TLS encryption. 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. With opportunistic TLS encryption, -the "export" grade is used unconditionally with exclusions specified -only via smtpd_tls_exclude_ciphers.
+The minimum TLS cipher grade that the Postfix SMTP server +will use with mandatory TLS encryption. 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 following cipher grades are supported:
@@ -12289,6 +12414,39 @@ level.This feature is available in Postfix 2.3 and later.
+List of TLS protocols that the Postfix SMTP server will exclude +or include with opportunistic TLS encryption. This parameter SHOULD be +left at its default empty value, allowing all protocols to be used with +opportunistic TLS.
+ +In main.cf the values are separated by whitespace, commas or +colons. An empty value means allow all protocols. The valid protocol +names, (see SSL_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.
+ +With mandatory TLS encryption, the Postfix SMTP server will by -default only use SSLv3 or TLSv1. SSLv2 is only used when TLS encryption -is optional. This is controlled by the smtpd_tls_mandatory_protocols -configuration parameter.
-The Postfix SMTP server supports 5 distinct cipher security levels as specified by the smtpd_tls_mandatory_ciphers configuration parameter, which determines the cipher grade with mandatory TLS encryption. The default value is "medium" which is essentially 128-bit encryption or better. With opportunistic TLS encryption, the minimum accepted cipher grade is -always "export".
- -By default anonymous ciphers are allowed, and automatically disabled -when client certificates are requested. If clients are expected to always -verify the server certificate you may want to exclude anonymous ciphers -by setting "smtpd_tls_mandatory_exclude_ciphers = aNULL". -One can't force a client to check the server certificate, so excluding +typically "export". Postfix ≥ 2.6 has a corresponding smtpd_tls_ciphers +parameter which controls the cipher grade used with opportunistic TLS.
+ +By default anonymous ciphers are enabled. They are automatically +disabled when remote SMTP client certificates are requested. If +clients are expected to always verify the Postfix SMTP +server certificate you may want to disable anonymous ciphers +by setting "smtpd_tls_mandatory_exclude_ciphers = aNULL" or +"smtpd_tls_exclude_ciphers = aNULL", as appropriate. One can't force +a remote SMTP client to check the server certificate, so excluding anonymous ciphers is generally unnecessary.
-For a server that is not a public Internet MX host, Postfix 2.3 +
The "smtpd_tls_ciphers" (Postfix ≥ 2.6) configuration parameter +provides control over the minimum cipher grade for opportunistic TLS. With +Postfix < 2.6, the minimum opportunistic TLS cipher grade is always +"export".
+ +With mandatory TLS encryption, the Postfix SMTP server will by +default only use SSLv3 or TLSv1. SSLv2 is only used when TLS encryption +is optional. The mandatory TLS protocol list is specified via the +smtpd_tls_mandatory_protocols configuration parameter. Postfix ≥ +2.6 has a corresponding smtpd_tls_protocols parameter which controls +the SSL/TLS protocols used with opportunistic TLS.
+ +For a server that is not a public Internet MX host, Postfix (≥ 2.3) supports configurations with no server certificates that use only the anonymous ciphers. This is enabled by explicitly setting "smtpd_tls_cert_file = none" @@ -1264,11 +1274,12 @@ With Postfix 2.3 and later, opportunistic TLS can be configured by setting "smtp_tls_security_level = may".
Since sending in the clear is acceptable, demanding stronger -than default TLS security merely reduces inter-operability. For -this reason, Postfix 2.3 and later ignore the smtp_tls_mandatory_ciphers -and smtp_tls_mandatory_protocols parameters at the "may" -security level: all protocols are allowed, and "export" grade or -better ciphers are used.
+than default TLS security mostly reduces inter-operability. If you +must restrict TLS protocol or cipher selection even with opportunistic +TLS, the Postfix ≥ 2.6 "smtp_tls_ciphers" and "smtp_tls_protocols" +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.With Postfix 2.2 and earlier, or when smtp_tls_security_level is set to its default (backwards compatible) empty value, the appropriate @@ -1820,15 +1831,19 @@ describe the corresponding table syntax:
additional attributes are supported at this level.The "exclude" attribute (Postfix ≥ 2.6) is used to disable +ciphers that cause handshake failures with a specific mandatory TLS +destination, without disabling the ciphers for all mandatory destinations. +Alternatively, you can exclude ciphers that cause issues with multiple +remote servers in main.cf, and selectively enable them on a per-destination +basis in the policy table by setting a shorter or empty exclusion list. The +per-destination "exclude" list preempts both the opportunistic and +mandatory security level exclusions, so that all excluded ciphers +can be enabled for known-good destinations. For non-mandatory TLS +destinations that exhibit cipher-specific problems, Postfix will fall +back to plain-text delivery. If plain-text is not acceptable make TLS +mandatory and exclude the problem ciphers.
+@@ -1906,6 +1934,8 @@ Example: [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 + # Postfix 2.6 and later + example.info may protocols=!SSLv2 ciphers=medium exclude=3DES @@ -2193,6 +2223,18 @@ no need to take these measures. Anonymous ciphers save bandwidth and TLS session cache space, if certificates are ignored, there is little point in requesting them.
+The "smtp_tls_ciphers" (Postfix ≥ 2.6) configuration parameter +provides control over the minimum cipher grade for opportunistic TLS. With +Postfix < 2.6, the minimum opportunistic TLS cipher grade is always +"export".
+ +With mandatory TLS encryption, the Postfix SMTP client will by +default only use SSLv3 or TLSv1. SSLv2 is only used when TLS encryption +is optional. The mandatory TLS protocol list is specified via the +smtp_tls_mandatory_protocols configuration parameter. Postfix ≥ +2.6 has a corresponding smtp_tls_protocols parameter which controls +the SSL/TLS protocols used with opportunistic TLS.
+Example:
@@ -2204,6 +2246,9 @@ little point in requesting them. smtp_tls_mandatory_protocols = SSLv3, TLSv1 # Also available with Postfix ≥ 2.5: smtp_tls_mandatory_protocols = !SSLv2 + # Also available with Postfix ≥ 2.6: + smtp_tls_ciphers = export + smtp_tls_protocols =diff --git a/postfix/proto/XFORWARD_README.html b/postfix/proto/XFORWARD_README.html index 0cff1389e..3762b537f 100644 --- a/postfix/proto/XFORWARD_README.html +++ b/postfix/proto/XFORWARD_README.html @@ -95,6 +95,10 @@ names are shown in upper case, they are in fact case insensitive. is unavailable. Address information is not enclosed with []. +
When both the NAME and ADDR attributes have the value + [UNAVAILABLE], the upcoming MAIL FROM transaction corresponds + to a local submission.
+The PORT attribute specifies an up-stream client TCP port number in decimal, or [UNAVAILABLE] when the information is unavailable.
@@ -151,11 +155,6 @@ initializes all XFORWARD attributes to [UNAVAILABLE]. With each valid XFORWARD command, the server updates XFORWARD attributes with the specified values. -When both the NAME and ADDR attributes have the value [UNAVAILABLE], -the MAIL FROM transaction corresponds to a local submission. In -this case the server must also treat the HELO, PORT and PROTO -attributes as [UNAVAILABLE].
-When the server uses XFORWARD attributes for logging purposes, it must not mix XFORWARD attributes with attributes from the current SMTP session.
diff --git a/postfix/proto/postconf.proto b/postfix/proto/postconf.proto index 6b45f1d36..eae09926c 100644 --- a/postfix/proto/postconf.proto +++ b/postfix/proto/postconf.proto @@ -9049,9 +9049,10 @@ settings.As long as no secure DNS lookup mechanism is available, false hostnames in MX or CNAME responses can change the server hostname @@ -9918,21 +9919,23 @@ security are:
# Opportunistic TLS. smtp_tls_security_level = may +# Postfix ≥ 2.6: +# Do not tweak opportunistic ciphers or protocols 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 =
@@ -10536,13 +10548,12 @@ meanings. %PARAM smtpd_tls_mandatory_ciphers medium -The minimum TLS cipher grade that the Postfix SMTP server will -use with mandatory -TLS encryption. 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. With opportunistic TLS encryption, -the "export" grade is used unconditionally with exclusions specified -only via smtpd_tls_exclude_ciphers.
+The minimum TLS cipher grade that the Postfix SMTP server +will use with mandatory TLS encryption. 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 following cipher grades are supported:
@@ -10760,6 +10771,10 @@ SMTP client cipher list at mandatory TLS security levels. This list works in addition to the exclusions listed with smtp_tls_exclude_ciphers (see there for syntax details). +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.
%PARAM tls_high_cipherlist ALL:!EXPORT:!LOW:!MEDIUM:+RC4:@STRENGTH @@ -11183,6 +11198,125 @@ the hostname and IP address. The logging format is "host[address]:port".This feature is available in Postfix 2.5 and later.
+%PARAM smtp_tls_protocols + +List of TLS protocols that the Postfix SMTP client will exclude +or include with opportunistic TLS encryption. This parameter SHOULD be +left at its default empty value, allowing all protocols to be used with +opportunistic TLS.
+ +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 SSL_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:
++smtp_tls_protocols = !SSLv2 ++ +This feature is available in Postfix 2.6 and later.
+ +%PARAM smtpd_tls_protocols + +List of TLS protocols that the Postfix SMTP server will exclude +or include with opportunistic TLS encryption. This parameter SHOULD be +left at its default empty value, allowing all protocols to be used with +opportunistic TLS.
+ +In main.cf the values are separated by whitespace, commas or +colons. An empty value means allow all protocols. The valid protocol +names, (see SSL_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.
+ +%PARAM lmtp_tls_protocols + +The LMTP-specific version of the smtp_tls_protocols configuration +parameter. See there for details.
+ +This feature is available in Postfix 2.6 and later.
+ +%PARAM smtp_tls_ciphers export + +The minimum TLS cipher grade that the Postfix SMTP client +will use with opportunistic TLS encryption. Cipher types listed in +smtp_tls_exclude_ciphers are excluded from the base definition of +the selected cipher grade. The default value "export" ensures maximum +inter-operability. Because encryption is optional, stronger controls +are not appropriate, and this setting SHOULD NOT be changed unless the +change is essential.
+ +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.
+ +%PARAM smtpd_tls_ciphers export + +The minimum TLS cipher grade that the Postfix SMTP server +will use with opportunistic TLS encryption. Cipher types listed in +smtpd_tls_exclude_ciphers are excluded from the base definition of +the selected cipher grade. The default value "export" ensures maximum +inter-operability. Because encryption is optional, stronger controls +are not appropriate, and this setting SHOULD NOT be changed unless the +change is essential.
+ +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.
+ +%PARAM lmtp_tls_ciphers export + +The LMTP-specific version of the smtp_tls_ciphers configuration +parameter. See there for details.
+ +This feature is available in Postfix 2.6 and later.
+ %PARAM smtp_header_checksRestricted header_checks(5) tables for the Postfix SMTP client. diff --git a/postfix/src/cleanup/cleanup_envelope.c b/postfix/src/cleanup/cleanup_envelope.c index 4a7b8cd1a..b21da3e85 100644 --- a/postfix/src/cleanup/cleanup_envelope.c +++ b/postfix/src/cleanup/cleanup_envelope.c @@ -176,6 +176,7 @@ static void cleanup_envelope_process(CLEANUP_STATE *state, int type, state->errs |= CLEANUP_STAT_BAD; return; } + /* Zero-length values are place holders for unavailable values. */ if (*attr_value == 0) { msg_warn("%s: spurious null attribute value for \"%s\" -- ignored", state->queue_id, attr_name); diff --git a/postfix/src/global/mail_params.h b/postfix/src/global/mail_params.h index 559ea4680..7fd009621 100644 --- a/postfix/src/global/mail_params.h +++ b/postfix/src/global/mail_params.h @@ -1189,10 +1189,18 @@ extern char *var_smtpd_tls_CAfile; #define DEF_SMTPD_TLS_CA_PATH "" extern char *var_smtpd_tls_CApath; +#define VAR_SMTPD_TLS_PROTO "smtpd_tls_protocols" +#define DEF_SMTPD_TLS_PROTO "" +extern char *var_smtpd_tls_proto; + #define VAR_SMTPD_TLS_MAND_PROTO "smtpd_tls_mandatory_protocols" #define DEF_SMTPD_TLS_MAND_PROTO "SSLv3, TLSv1" extern char *var_smtpd_tls_mand_proto; +#define VAR_SMTPD_TLS_CIPH "smtpd_tls_ciphers" +#define DEF_SMTPD_TLS_CIPH "export" +extern char *var_smtpd_tls_ciph; + #define VAR_SMTPD_TLS_MAND_CIPH "smtpd_tls_mandatory_ciphers" #define DEF_SMTPD_TLS_MAND_CIPH "medium" extern char *var_smtpd_tls_mand_ciph; @@ -1313,6 +1321,12 @@ extern char *var_smtp_tls_CAfile; #define DEF_LMTP_TLS_CA_PATH "" extern char *var_smtp_tls_CApath; +#define VAR_SMTP_TLS_CIPH "smtp_tls_ciphers" +#define DEF_SMTP_TLS_CIPH "export" +#define VAR_LMTP_TLS_CIPH "lmtp_tls_ciphers" +#define DEF_LMTP_TLS_CIPH "export" +extern char *var_smtp_tls_ciph; + #define VAR_SMTP_TLS_MAND_CIPH "smtp_tls_mandatory_ciphers" #define DEF_SMTP_TLS_MAND_CIPH "medium" #define VAR_LMTP_TLS_MAND_CIPH "lmtp_tls_mandatory_ciphers" @@ -1370,6 +1384,12 @@ extern int var_lmtp_tls_scache_timeout; #define DEF_LMTP_TLS_POLICY "" extern char *var_smtp_tls_policy; +#define VAR_SMTP_TLS_PROTO "smtp_tls_protocols" +#define DEF_SMTP_TLS_PROTO "" +#define VAR_LMTP_TLS_PROTO "lmtp_tls_protocols" +#define DEF_LMTP_TLS_PROTO "" +extern char *var_smtp_tls_proto; + #define VAR_SMTP_TLS_MAND_PROTO "smtp_tls_mandatory_protocols" #define DEF_SMTP_TLS_MAND_PROTO "SSLv3, TLSv1" #define VAR_LMTP_TLS_MAND_PROTO "lmtp_tls_mandatory_protocols" diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index 09700c2ee..0aabde098 100644 --- a/postfix/src/global/mail_version.h +++ b/postfix/src/global/mail_version.h @@ -20,19 +20,19 @@ * Patches change both the patchlevel and the release date. Snapshots have no * patchlevel; they change the release date only. */ -#define MAIL_RELEASE_DATE "20081007" +#define MAIL_RELEASE_DATE "20081010" #define MAIL_VERSION_NUMBER "2.6" #ifdef SNAPSHOT -# define MAIL_VERSION_DATE "-" MAIL_RELEASE_DATE +#define MAIL_VERSION_DATE "-" MAIL_RELEASE_DATE #else -# define MAIL_VERSION_DATE "" +#define MAIL_VERSION_DATE "" #endif #ifdef NONPROD -# define MAIL_VERSION_PROD "-nonprod" +#define MAIL_VERSION_PROD "-nonprod" #else -# define MAIL_VERSION_PROD "" +#define MAIL_VERSION_PROD "" #endif #define VAR_MAIL_VERSION "mail_version" diff --git a/postfix/src/smtp/lmtp_params.c b/postfix/src/smtp/lmtp_params.c index 5f7c41b5a..1373752fa 100644 --- a/postfix/src/smtp/lmtp_params.c +++ b/postfix/src/smtp/lmtp_params.c @@ -24,6 +24,8 @@ VAR_LMTP_TLS_SEC_CMATCH, DEF_LMTP_TLS_SEC_CMATCH, &var_smtp_tls_sec_cmatch, 1, 0, VAR_LMTP_TLS_FPT_CMATCH, DEF_LMTP_TLS_FPT_CMATCH, &var_smtp_tls_fpt_cmatch, 0, 0, VAR_LMTP_TLS_FPT_DGST, DEF_LMTP_TLS_FPT_DGST, &var_smtp_tls_fpt_dgst, 1, 0, + VAR_LMTP_TLS_PROTO, DEF_LMTP_TLS_PROTO, &var_smtp_tls_proto, 0, 0, + VAR_LMTP_TLS_CIPH, DEF_LMTP_TLS_CIPH, &var_smtp_tls_ciph, 1, 0, #endif VAR_LMTP_SASL_MECHS, DEF_LMTP_SASL_MECHS, &var_smtp_sasl_mechs, 0, 0, VAR_LMTP_SASL_TYPE, DEF_LMTP_SASL_TYPE, &var_smtp_sasl_type, 1, 0, diff --git a/postfix/src/smtp/smtp.c b/postfix/src/smtp/smtp.c index 487178781..56b63580f 100644 --- a/postfix/src/smtp/smtp.c +++ b/postfix/src/smtp/smtp.c @@ -162,7 +162,7 @@ /* per-destination workarounds for CISCO PIX firewall bugs. /* .IP "\fBsmtp_quote_rfc821_envelope (yes)\fR" /* Quote addresses in SMTP MAIL FROM and RCPT TO commands as required -/* by RFC 821. +/* by RFC 2821. /* .IP "\fBsmtp_skip_5xx_greeting (yes)\fR" /* Skip SMTP servers that greet with a 5XX status code (go away, do /* not try again later). @@ -384,6 +384,14 @@ /* .IP "\fBsmtp_tls_fingerprint_digest (md5)\fR" /* The message digest algorithm used to construct remote SMTP server /* certificate fingerprints. +/* .PP +/* Available in Postfix version 2.6 and later: +/* .IP "\fBsmtp_tls_protocols (empty)\fR" +/* List of TLS protocols that the Postfix SMTP client will exclude +/* or include with opportunistic TLS encryption. +/* .IP "\fBsmtp_tls_ciphers (export)\fR" +/* The minimum TLS cipher grade that the Postfix SMTP client +/* will use with opportunistic TLS encryption. /* OBSOLETE STARTTLS CONTROLS /* .ad /* .fi @@ -413,7 +421,7 @@ /* The maximal number of parallel deliveries to the same destination /* via the smtp message delivery transport. /* .IP "\fBsmtp_destination_recipient_limit ($default_destination_recipient_limit)\fR" -/* The maximal number of recipients per delivery via the smtp +/* The maximal number of recipients per message for the smtp /* message delivery transport. /* .IP "\fBsmtp_connect_timeout (30s)\fR" /* The SMTP client time limit for completing a TCP connection, or @@ -745,6 +753,8 @@ int var_smtp_tls_scert_vd; char *var_smtp_tls_vfy_cmatch; char *var_smtp_tls_fpt_cmatch; char *var_smtp_tls_fpt_dgst; +char *var_smtp_tls_proto; +char *var_smtp_tls_ciph; #endif diff --git a/postfix/src/smtp/smtp_params.c b/postfix/src/smtp/smtp_params.c index 61cf8b33c..39ef024ba 100644 --- a/postfix/src/smtp/smtp_params.c +++ b/postfix/src/smtp/smtp_params.c @@ -25,6 +25,8 @@ VAR_SMTP_TLS_SEC_CMATCH, DEF_SMTP_TLS_SEC_CMATCH, &var_smtp_tls_sec_cmatch, 1, 0, VAR_SMTP_TLS_FPT_CMATCH, DEF_SMTP_TLS_FPT_CMATCH, &var_smtp_tls_fpt_cmatch, 0, 0, VAR_SMTP_TLS_FPT_DGST, DEF_SMTP_TLS_FPT_DGST, &var_smtp_tls_fpt_dgst, 1, 0, + VAR_SMTP_TLS_PROTO, DEF_SMTP_TLS_PROTO, &var_smtp_tls_proto, 0, 0, + VAR_SMTP_TLS_CIPH, DEF_SMTP_TLS_CIPH, &var_smtp_tls_ciph, 1, 0, #endif VAR_SMTP_SASL_MECHS, DEF_SMTP_SASL_MECHS, &var_smtp_sasl_mechs, 0, 0, VAR_SMTP_SASL_TYPE, DEF_SMTP_SASL_TYPE, &var_smtp_sasl_type, 1, 0, diff --git a/postfix/src/smtp/smtp_session.c b/postfix/src/smtp/smtp_session.c index b67bc8524..c87fe7535 100644 --- a/postfix/src/smtp/smtp_session.c +++ b/postfix/src/smtp/smtp_session.c @@ -264,12 +264,6 @@ static int tls_policy_lookup_one(SMTP_SESSION *session, int *site_level, } /* Only one instance per policy. */ if (!strcasecmp(name, "ciphers")) { - if (*site_level < TLS_LEV_ENCRYPT) { - msg_warn("%s: attribute \"%s\" invalid at security level \"%s\"", - WHERE, name, policy_name(*site_level)); - *site_level = TLS_LEV_INVALID; - break; - } if (*val == 0) { msg_warn("%s: attribute \"%s\" has empty value", WHERE, name); *site_level = TLS_LEV_INVALID; @@ -281,18 +275,11 @@ static int tls_policy_lookup_one(SMTP_SESSION *session, int *site_level, *site_level = TLS_LEV_INVALID; break; } - /* set_cipher_grade() assumes this is NULL with level < encrypt */ session->tls_grade = mystrdup(val); continue; } /* Only one instance per policy. */ if (!strcasecmp(name, "protocols")) { - if (*site_level < TLS_LEV_ENCRYPT) { - msg_warn("%s: attribute \"%s\" invalid at security level \"%s\"", - WHERE, name, policy_name(*site_level)); - *site_level = TLS_LEV_INVALID; - break; - } if (session->tls_protocols) { msg_warn("%s: attribute \"%s\" is specified multiple times", WHERE, name); @@ -322,6 +309,17 @@ static int tls_policy_lookup_one(SMTP_SESSION *session, int *site_level, else argv_split_append(session->tls_matchargv, val, delim); continue; + } + /* Only one instance per policy. */ + if (!strcasecmp(name, "exclude")) { + if (session->tls_exclusions) { + msg_warn("%s: attribute \"%s\" is specified multiple times", + WHERE, name); + *site_level = TLS_LEV_INVALID; + break; + } + session->tls_exclusions = vstring_strcpy(vstring_alloc(10), val); + continue; } else { msg_warn("%s: invalid attribute name: \"%s\"", WHERE, name); *site_level = TLS_LEV_INVALID; @@ -382,8 +380,8 @@ static void set_cipher_grade(SMTP_SESSION *session) return; case TLS_LEV_MAY: - /* tls_policy_lookup_one() leaves this NULL with level < encrypt. */ - session->tls_grade = mystrdup("export");/* XXX: For now */ + if (session->tls_grade == 0) + session->tls_grade = mystrdup(var_smtp_tls_ciph); break; case TLS_LEV_ENCRYPT: @@ -411,9 +409,8 @@ static void set_cipher_grade(SMTP_SESSION *session) } while (0) /* - * Soon, the "exclude" policy table attribute will be able to override - * the main.cf mandatory exclusion list, and the latter may become - * obsolete. + * The "exclude" policy table attribute overrides main.cf exclusion + * lists. */ if (session->tls_exclusions == 0) { session->tls_exclusions = vstring_alloc(10); @@ -511,7 +508,7 @@ static void session_tls_init(SMTP_SESSION *session, const char *dest, if (session->tls_level > TLS_LEV_NONE && session->tls_protocols == 0) session->tls_protocols = mystrdup((session->tls_level == TLS_LEV_MAY) ? - "" : var_smtp_tls_mand_proto); + var_smtp_tls_proto : var_smtp_tls_mand_proto); /* * Compute cipher grade (if set in per-destination table, else diff --git a/postfix/src/smtpd/smtpd.c b/postfix/src/smtpd/smtpd.c index e55814706..3440430c5 100644 --- a/postfix/src/smtpd/smtpd.c +++ b/postfix/src/smtpd/smtpd.c @@ -338,9 +338,8 @@ /* .IP "\fBsmtpd_tls_loglevel (0)\fR" /* Enable additional Postfix SMTP server logging of TLS activity. /* .IP "\fBsmtpd_tls_mandatory_ciphers (medium)\fR" -/* The minimum TLS cipher grade that the Postfix SMTP server will -/* use with mandatory -/* TLS encryption. +/* The minimum TLS cipher grade that the Postfix SMTP server +/* will use with mandatory TLS encryption. /* .IP "\fBsmtpd_tls_mandatory_exclude_ciphers (empty)\fR" /* Additional list of ciphers or cipher types to exclude from the /* SMTP server cipher list at mandatory TLS security levels. @@ -385,6 +384,14 @@ /* The message digest algorithm used to construct client-certificate /* fingerprints for \fBcheck_ccert_access\fR and /* \fBpermit_tls_clientcerts\fR. +/* .PP +/* Available in Postfix version 2.6 and later: +/* .IP "\fBsmtpd_tls_protocols (empty)\fR" +/* List of TLS protocols that the Postfix SMTP server will exclude +/* or include with opportunistic TLS encryption. +/* .IP "\fBsmtpd_tls_ciphers (export)\fR" +/* The minimum TLS cipher grade that the Postfix SMTP server +/* will use with opportunistic TLS encryption. /* OBSOLETE STARTTLS CONTROLS /* .ad /* .fi @@ -1141,6 +1148,8 @@ bool var_smtpd_tls_req_ccert; int var_smtpd_tls_scache_timeout; bool var_smtpd_tls_set_sessid; char *var_smtpd_tls_fpt_dgst; +char *var_smtpd_tls_ciph; +char *var_smtpd_tls_proto; #endif @@ -3847,7 +3856,7 @@ static void smtpd_start_tls(SMTPD_STATE *state) if (cipher_grade == 0) { cipher_grade = - enforce_tls ? var_smtpd_tls_mand_ciph : "export"; + enforce_tls ? var_smtpd_tls_mand_ciph : var_smtpd_tls_ciph; cipher_exclusions = vstring_alloc(10); ADD_EXCLUDE(cipher_exclusions, var_smtpd_tls_excl_ciph); if (enforce_tls) @@ -4691,7 +4700,8 @@ static void pre_jail_init(char *unused_name, char **unused_argv) dh512_param_file = var_smtpd_tls_dh512_param_file, protocols = enforce_tls ? - var_smtpd_tls_mand_proto : "", + var_smtpd_tls_mand_proto : + var_smtpd_tls_proto, ask_ccert = var_smtpd_tls_ask_ccert, fpt_dgst = var_smtpd_tls_fpt_dgst); else @@ -4920,9 +4930,11 @@ int main(int argc, char **argv) VAR_SMTPD_TLS_DKEY_FILE, DEF_SMTPD_TLS_DKEY_FILE, &var_smtpd_tls_dkey_file, 0, 0, VAR_SMTPD_TLS_CA_FILE, DEF_SMTPD_TLS_CA_FILE, &var_smtpd_tls_CAfile, 0, 0, VAR_SMTPD_TLS_CA_PATH, DEF_SMTPD_TLS_CA_PATH, &var_smtpd_tls_CApath, 0, 0, + VAR_SMTPD_TLS_CIPH, DEF_SMTPD_TLS_CIPH, &var_smtpd_tls_ciph, 1, 0, VAR_SMTPD_TLS_MAND_CIPH, DEF_SMTPD_TLS_MAND_CIPH, &var_smtpd_tls_mand_ciph, 1, 0, VAR_SMTPD_TLS_EXCL_CIPH, DEF_SMTPD_TLS_EXCL_CIPH, &var_smtpd_tls_excl_ciph, 0, 0, VAR_SMTPD_TLS_MAND_EXCL, DEF_SMTPD_TLS_MAND_EXCL, &var_smtpd_tls_mand_excl, 0, 0, + VAR_SMTPD_TLS_PROTO, DEF_SMTPD_TLS_PROTO, &var_smtpd_tls_proto, 0, 0, VAR_SMTPD_TLS_MAND_PROTO, DEF_SMTPD_TLS_MAND_PROTO, &var_smtpd_tls_mand_proto, 0, 0, VAR_SMTPD_TLS_512_FILE, DEF_SMTPD_TLS_512_FILE, &var_smtpd_tls_dh512_param_file, 0, 0, VAR_SMTPD_TLS_1024_FILE, DEF_SMTPD_TLS_1024_FILE, &var_smtpd_tls_dh1024_param_file, 0, 0, diff --git a/postfix/src/smtpd/smtpd.h b/postfix/src/smtpd/smtpd.h index 71184151d..e796ac65d 100644 --- a/postfix/src/smtpd/smtpd.h +++ b/postfix/src/smtpd/smtpd.h @@ -301,20 +301,27 @@ extern void smtpd_peer_reset(SMTPD_STATE *state); /* * Choose between normal or forwarded attributes. * - * Note 1: inside the SMTP server, forwarded attributes must have the exact - * same representation as normal attributes: unknown string values are - * "unknown", and non-existent HELO is null. + * Inside the SMTP server, unknown real client attributes are represented by + * the string "unknown", and non-existent HELO is represented as a null + * pointer. The SMTP server uses this same representation internally for + * forwarded client attributes; the XFORWARD syntax makes no distinction + * between unknown (remote submission) and non-existent (local submission). + * The SMTP server decides between remote and local submission when it + * generates queue file records (see below) so that the correct result is + * produced with down-stream logging and with $name expansion in delivery + * agents. * - * Note 2: the SMTP server representation of unknown/known attribute values is - * also used in queue files and in delivery requests, while non-existent - * information is represented in those contexts as empty strings. In queue - * files and delivery requests, forwarded local submissions are represented - * by forwarded client attributes with empty string values (actually one - * attribute is sufficient). + * Known/unknown client attribute values use the SMTP server's internal + * representation in queue files, in queue manager delivery requests, and in + * delivery agent $name expansions. * - * Note 3: if forwarding client information, don't mix information from the - * current SMTP session with forwarded information from an up-stream - * session. + * Non-existent attribute values are never present in queue files. The SMTP + * server stores a dummy attribute to indicate that no client attributes + * exist. Non-existent information is represented as empty strings in queue + * manager delivery requests and in delivery agent $name expansions. + * + * When forwarding client information, don't mix information from the current + * SMTP session with forwarded information from an up-stream session. */ #define SMTPD_HAVE_XFORWARD_ATTR(s) \ ((s)->xforward.flags & SMTPD_STATE_XFORWARD_INIT)