From 649a63ae62c2ebae181dfd76510f0e8dee3de2be Mon Sep 17 00:00:00 2001
From: Wietse Venema
The default setting, shown below, assumes that you use the default Postfix local(8) delivery agent for local delivery, where diff --git a/postfix/html/cleanup.8.html b/postfix/html/cleanup.8.html index 6ee8804e4..442ce03db 100644 --- a/postfix/html/cleanup.8.html +++ b/postfix/html/cleanup.8.html @@ -513,6 +513,13 @@ CLEANUP(8) CLEANUP(8) The email address form that will be used in non-debug logging (info, warning, etc.). + Available in Postfix 3.9 and later: + + enforce_mime_input_conversion (no) + Convert content that claims to be 8-bit into quoted-printable, + before header_checks, body_checks, Milters, and before + after-queue content filters. + FILES /etc/postfix/canonical*, canonical mapping table /etc/postfix/virtual*, virtual mapping table diff --git a/postfix/html/postconf.5.html b/postfix/html/postconf.5.html index 0f895dcf1..d9bc50bc6 100644 --- a/postfix/html/postconf.5.html +++ b/postfix/html/postconf.5.html @@ -3423,6 +3423,25 @@ instead of deleting only the non-delivery notification.
This feature is available in Postfix 3.6 and later.
+ + +Convert content that claims to be 8-bit into quoted-printable, +before header_checks, body_checks, Milters, and before after-queue +content filters. This feature does not affect messages that are +sent into smtpd_proxy_filter.
+ +The typical use case is an MTA that applies this conversion +before signing outbound messages, so that the signatures will remain +valid when a message is later delivered to an MTA that does not +announce 8BITMIME support, or when a message line exceeds the SMTP +length limit.
+ +This feature is available in Postfix ≥ 3.9.
+ +If this parameter is non-empty (the default), then the Postfix SMTP -server will reject mail for unknown local users. -
+server will reject mail for unknown local users. Other Postfix +interfaces may still accept an "unknown" recipient.To turn off local recipient checking in the Postfix SMTP server, diff --git a/postfix/man/man5/postconf.5 b/postfix/man/man5/postconf.5 index 553d07411..8ddb007c2 100644 --- a/postfix/man/man5/postconf.5 +++ b/postfix/man/man5/postconf.5 @@ -2206,6 +2206,19 @@ instead of deleting only the non\-delivery notification. .br .PP This feature is available in Postfix 3.6 and later. +.SH enforce_mime_input_conversion (default: no) +Convert content that claims to be 8\-bit into quoted\-printable, +before header_checks, body_checks, Milters, and before after\-queue +content filters. This feature does not affect messages that are +sent into smtpd_proxy_filter. +.PP +The typical use case is an MTA that applies this conversion +before signing outbound messages, so that the signatures will remain +valid when a message is later delivered to an MTA that does not +announce 8BITMIME support, or when a message line exceeds the SMTP +length limit. +.PP +This feature is available in Postfix >= 3.9. .SH error_notice_recipient (default: postmaster) The recipient of postmaster notifications about mail delivery problems that are caused by policy, resource, software or protocol @@ -3820,7 +3833,8 @@ whitespace or comma. Tables will be searched in the specified order until a match is found. .PP If this parameter is non\-empty (the default), then the Postfix SMTP -server will reject mail for unknown local users. +server will reject mail for unknown local users. Other Postfix +interfaces may still accept an "unknown" recipient. .PP To turn off local recipient checking in the Postfix SMTP server, specify "local_recipient_maps =" (i.e. empty). diff --git a/postfix/man/man8/cleanup.8 b/postfix/man/man8/cleanup.8 index a6bec00c0..d9170647e 100644 --- a/postfix/man/man8/cleanup.8 +++ b/postfix/man/man8/cleanup.8 @@ -459,6 +459,12 @@ Available in Postfix 3.5 and later: .IP "\fBinfo_log_address_format (external)\fR" The email address form that will be used in non\-debug logging (info, warning, etc.). +.PP +Available in Postfix 3.9 and later: +.IP "\fBenforce_mime_input_conversion (no)\fR" +Convert content that claims to be 8\-bit into quoted\-printable, +before header_checks, body_checks, Milters, and before after\-queue +content filters. .SH "FILES" .na .nf diff --git a/postfix/mantools/postlink b/postfix/mantools/postlink index 59b2716ea..54d29adb3 100755 --- a/postfix/mantools/postlink +++ b/postfix/mantools/postlink @@ -169,6 +169,7 @@ while (<>) { s;\bdisable_dns_lookups\b;$&;g; s;\bdisable_mime_input_processing\b;$&;g; s;\bdisable_mime_output_conversion\b;$&;g; + s;\benforce_mime_input_conversion\b;$&;g; s;\bdisable_verp_bounces\b;$&;g; s;\bdisable_vrfy_command\b;$&;g; s;\bdont_remove\b;$&;g; diff --git a/postfix/proto/LOCAL_RECIPIENT_README.html b/postfix/proto/LOCAL_RECIPIENT_README.html index a06b81f2e..2cb3fb296 100644 --- a/postfix/proto/LOCAL_RECIPIENT_README.html +++ b/postfix/proto/LOCAL_RECIPIENT_README.html @@ -57,7 +57,8 @@ all names or addresses of local recipients. A recipient address is local when its domain matches $mydestination, $inet_interfaces or $proxy_interfaces. If a local username or address is not listed in $local_recipient_maps, then the Postfix SMTP server will reject -the address with "User unknown in local recipient table".
+the address with "User unknown in local recipient table". Other +Postfix interfaces may still accept an "unknown" recipient.The default setting, shown below, assumes that you use the default Postfix local(8) delivery agent for local delivery, where diff --git a/postfix/proto/postconf.proto b/postfix/proto/postconf.proto index c47af13c3..6de5a6c3b 100644 --- a/postfix/proto/postconf.proto +++ b/postfix/proto/postconf.proto @@ -2468,8 +2468,8 @@ until a match is found.
If this parameter is non-empty (the default), then the Postfix SMTP -server will reject mail for unknown local users. -
+server will reject mail for unknown local users. Other Postfix +interfaces may still accept an "unknown" recipient.To turn off local recipient checking in the Postfix SMTP server, @@ -19026,3 +19026,18 @@ SMTP client input. This feature is enabled by default with Postfix
This feature is available in Postfix ≥ 3.9, 3.8.1, 3.7.6, 3.6.10, and 3.5.20.
+ +%PARAM enforce_mime_input_conversion no + +Convert content that claims to be 8-bit into quoted-printable, +before header_checks, body_checks, Milters, and before after-queue +content filters. This feature does not affect messages that are +sent into smtpd_proxy_filter.
+ +The typical use case is an MTA that applies this conversion +before signing outbound messages, so that the signatures will remain +valid when a message is later delivered to an MTA that does not +announce 8BITMIME support, or when a message line exceeds the SMTP +length limit.
+ +This feature is available in Postfix ≥ 3.9.
diff --git a/postfix/proto/stop.double-history b/postfix/proto/stop.double-history index d0e837eb9..2fb2cee88 100644 --- a/postfix/proto/stop.double-history +++ b/postfix/proto/stop.double-history @@ -65,3 +65,4 @@ proto proto aliases proto virtual proto ADDRESS_REWRITING_README html reported by Serg File smtp smtp h smtp lmtp_params c smtp smtp c smtp smtp_params c plaintext Problem reported by Serg File smtp smtp h + cleanup cleanup c cleanup cleanup_init c proto postconf proto diff --git a/postfix/src/cleanup/cleanup.c b/postfix/src/cleanup/cleanup.c index b1f475dcc..ab9ae249e 100644 --- a/postfix/src/cleanup/cleanup.c +++ b/postfix/src/cleanup/cleanup.c @@ -427,6 +427,12 @@ /* .IP "\fBinfo_log_address_format (external)\fR" /* The email address form that will be used in non-debug logging /* (info, warning, etc.). +/* .PP +/* Available in Postfix 3.9 and later: +/* .IP "\fBenforce_mime_input_conversion (no)\fR" +/* Convert content that claims to be 8-bit into quoted-printable, +/* before header_checks, body_checks, Milters, and before after-queue +/* content filters. /* FILES /* /etc/postfix/canonical*, canonical mapping table /* /etc/postfix/virtual*, virtual mapping table diff --git a/postfix/src/cleanup/cleanup_init.c b/postfix/src/cleanup/cleanup_init.c index 8c43a0212..a25068dd9 100644 --- a/postfix/src/cleanup/cleanup_init.c +++ b/postfix/src/cleanup/cleanup_init.c @@ -174,6 +174,7 @@ int var_auto_8bit_enc_hdr; /* auto-detect 8bit encoding header */ int var_always_add_hdrs; /* always add missing headers */ int var_virt_addrlen_limit; /* stop exponential growth */ char *var_hfrom_format; /* header_from_format */ +int var_enforce_mime_iconv; /* enforce mime downgrade on input */ const CONFIG_INT_TABLE cleanup_int_table[] = { VAR_HOPCOUNT_LIMIT, DEF_HOPCOUNT_LIMIT, &var_hopcount_limit, 1, 0, @@ -190,6 +191,7 @@ const CONFIG_BOOL_TABLE cleanup_bool_table[] = { VAR_VERP_BOUNCE_OFF, DEF_VERP_BOUNCE_OFF, &var_verp_bounce_off, VAR_AUTO_8BIT_ENC_HDR, DEF_AUTO_8BIT_ENC_HDR, &var_auto_8bit_enc_hdr, VAR_ALWAYS_ADD_HDRS, DEF_ALWAYS_ADD_HDRS, &var_always_add_hdrs, + VAR_ENFORCE_MIME_ICONV, DEF_ENFORCE_MIME_ICONV, &var_enforce_mime_iconv, 0, }; diff --git a/postfix/src/cleanup/cleanup_message.c b/postfix/src/cleanup/cleanup_message.c index f2b86d05b..3eb893863 100644 --- a/postfix/src/cleanup/cleanup_message.c +++ b/postfix/src/cleanup/cleanup_message.c @@ -1052,6 +1052,9 @@ void cleanup_message(CLEANUP_STATE *state, int type, const char *buf, ssize_t */ mime_options = 0; if (var_disable_mime_input) { + if (var_enforce_mime_iconv) + msg_fatal("do not specify both %s=yes and %s=yes", + VAR_DISABLE_MIME_INPUT, VAR_ENFORCE_MIME_ICONV); mime_options |= MIME_OPT_DISABLE_MIME; } else { /* Turn off content checks if bouncing or forwarding mail. */ @@ -1068,6 +1071,8 @@ void cleanup_message(CLEANUP_STATE *state, int type, const char *buf, ssize_t || *var_nesthdr_checks) mime_options |= MIME_OPT_REPORT_NESTING; } + if (var_enforce_mime_iconv) + mime_options |= MIME_OPT_DOWNGRADE; } state->mime_state = mime_state_alloc(mime_options, cleanup_header_callback, diff --git a/postfix/src/dns/dns_lookup.c b/postfix/src/dns/dns_lookup.c index 06028c804..bccdd83f5 100644 --- a/postfix/src/dns/dns_lookup.c +++ b/postfix/src/dns/dns_lookup.c @@ -85,6 +85,12 @@ /* an invalid name is reported as a DNS_INVAL result, while /* malformed replies are reported as transient errors. /* +/* Note: in dns_lookup*() results and queries, a name may start +/* with a "*" label, which is valid according to RFC 1034 +/* section 4.3.3. Such a name will not pass valid_hostname() +/* checks in the rest of Postfix, because it is not a valid +/* host or domain name. +/* /* dns_get_h_errno() returns the last error. This deprecates /* usage of the global h_errno variable. We should not rely /* on that being updated. diff --git a/postfix/src/global/mail_params.h b/postfix/src/global/mail_params.h index 1d964b496..649b8290a 100644 --- a/postfix/src/global/mail_params.h +++ b/postfix/src/global/mail_params.h @@ -3088,6 +3088,10 @@ extern bool var_disable_mime_input; #define DEF_DISABLE_MIME_OCONV 0 extern bool var_disable_mime_oconv; +#define VAR_ENFORCE_MIME_ICONV "enforce_mime_input_conversion" +#define DEF_ENFORCE_MIME_ICONV 0 +extern bool var_enforce_mime_iconv; + #define VAR_STRICT_8BITMIME "strict_8bitmime" #define DEF_STRICT_8BITMIME 0 extern bool var_strict_8bitmime; diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index 7d6a25f33..e85db1d76 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 "20230821" +#define MAIL_RELEASE_DATE "20230901" #define MAIL_VERSION_NUMBER "3.9" #ifdef SNAPSHOT -- 2.47.3