From dec262c51fd4b4604eeef7211e5eb0b02da88e57 Mon Sep 17 00:00:00 2001
From: Wietse Venema Inside the list, syntax is similar to what we already know from
main.cf: items separated by space or comma. There is one difference:
you must enclose a setting in parentheses, as in "{ name = value
-}", if you want to have space within a value or around "=".
-
Each restriction list is evaluated from left to right until some restriction produces a result of PERMIT, REJECT or DEFER (try -again later). The end of the list is equivalent to a PERMIT result. +again later). The end of each list is equivalent to a PERMIT result. By placing a PERMIT restriction before a REJECT restriction you can make exceptions for specific clients or users. This is called whitelisting; the fourth example above allows mail from local diff --git a/postfix/html/SMTPD_POLICY_README.html b/postfix/html/SMTPD_POLICY_README.html index a783310f6..14f9fa030 100644 --- a/postfix/html/SMTPD_POLICY_README.html +++ b/postfix/html/SMTPD_POLICY_README.html @@ -425,9 +425,10 @@ and have the same name as those parameters, without the
Inside the list, syntax is similar to what we already know from main.cf: items separated by space or comma. There is one difference: you must enclose a setting in parentheses, as in "{ name = value -}", if you want to have space within a value or around "=". -This comes in handy when different policy servers require different -default actions with different SMTP status codes or text:
+}", if you want to have space or comma within a value or around +"=". This comes in handy when different policy servers require +different default actions with different SMTP status codes or text: +-diff --git a/postfix/html/SMTPUTF8_README.html b/postfix/html/SMTPUTF8_README.html index 9d26c6c72..c2f7d67b9 100644 --- a/postfix/html/SMTPUTF8_README.html +++ b/postfix/html/SMTPUTF8_README.html @@ -50,12 +50,16 @@ header values.Enabling Postfix SMTPUTF8 support
-Before turning on SMTPUTF8 support in Postfix, you need to -verify that the rest of your email infrastructure can handle UTF-8 -email addresses and message header values, including SMTPUTF8 +
There is more to SMTPUTF8 than just Postfix itself. The rest +of your email infrastructure also needs to be able to handle UTF-8 +email addresses and message header values. This includes SMTPUTF8 protocol support in SMTP-based content filters (Amavisd), LMTP servers (Dovecot), and down-stream SMTP servers.
+Postfix SMTPUTF8 support is enabled by default, but it may be +disabled as part of a backwards-compatibility safety net (see the +Postfix 2.12 RELEASE_NOTES file).
+SMTPUTF8 support is enabled by setting the smtputf8_enable parameter in main.cf:
@@ -66,7 +70,8 @@ parameter in main.cf:
With SMTPUTF8 support enabled, Postfix changes behavior as follows:
+With SMTPUTF8 support enabled, Postfix changes behavior with +respect to earlier Postfix releases:
With locally submitted mail, append the string ".$mydomain" to @@ -1534,6 +1534,33 @@ global ipc_timeout parameter as well.
+A safety net that forces Postfix to keep running with +backwards-compatible main.cf and master.cf default settings after +an upgrade to a newer but incompatible Postfix version.
+ +Depending on the compatibility_level parameter setting, Postfix +continues to use backwards-compatible default settings, and logs +the use of those backwards-compatible default settings with messages +that contain the string "using legacy default setting". Based on +this logging the system administrator can determine that a new +default setting breaks nothing or that a backwards-compatible +default setting needs to be made permanent in main.cf or master.cf. +
+ +After this review is complete, and no more backwards-compatible +settings need to be made permanent, the administrator should accept +the remaining Postfix built-in default settings by updating the +compatibility_level setting in main.cf as recommended in the Postfix +RELEASE_NOTES.
+ +This feature is available in Postfix 2.12 and later.
+ + Enable experimental SMTPUTF8 support for the protocols described
in RFC 6531..6533. This requires that Postfix is built to support
diff --git a/postfix/html/smtp.8.html b/postfix/html/smtp.8.html
index 92a57e071..f07bc31f1 100644
--- a/postfix/html/smtp.8.html
+++ b/postfix/html/smtp.8.html
@@ -695,7 +695,7 @@ SMTP(8) SMTP(8)
SMTPUTF8 CONTROLS
Preliminary SMTPUTF8 support is introduced with Postfix 2.12.
- smtputf8_enable (no)
+ smtputf8_enable (yes)
Enable experimental SMTPUTF8 support for the protocols described
in RFC 6531..6533.
diff --git a/postfix/html/smtpd.8.html b/postfix/html/smtpd.8.html
index a8528abbe..2c7a2dba8 100644
--- a/postfix/html/smtpd.8.html
+++ b/postfix/html/smtpd.8.html
@@ -564,7 +564,7 @@ SMTPD(8) SMTPD(8)
SMTPUTF8 CONTROLS
Preliminary SMTPUTF8 support is introduced with Postfix 2.12.
- smtputf8_enable (no)
+ smtputf8_enable (yes)
Enable experimental SMTPUTF8 support for the protocols described
in RFC 6531..6533.
diff --git a/postfix/html/trivial-rewrite.8.html b/postfix/html/trivial-rewrite.8.html
index 95e245fba..578f29429 100644
--- a/postfix/html/trivial-rewrite.8.html
+++ b/postfix/html/trivial-rewrite.8.html
@@ -119,7 +119,7 @@ TRIVIAL-REWRITE(8) TRIVIAL-REWRITE(8)
With locally submitted mail, append the string "@$myorigin" to
mail addresses without domain information.
- append_dot_mydomain (yes)
+ append_dot_mydomain (Postfix ≥ 2.12: no, Postfix < 2.12: yes)
With locally submitted mail, append the string ".$mydomain" to
addresses that have no ".domain" information.
diff --git a/postfix/man/man5/master.5 b/postfix/man/man5/master.5
index 882893ca8..47f3937fc 100644
--- a/postfix/man/man5/master.5
+++ b/postfix/man/man5/master.5
@@ -126,7 +126,7 @@ main.cf file).
.sp
The \fBlocal\fR(8), \fBpipe\fR(8), \fBspawn\fR(8), and
\fBvirtual\fR(8) daemons require privileges.
-.IP "\fBChroot (default: y)\fR"
+.IP "\fBChroot (default: Postfix >= 2.12: y, Postfix <2.12: n)\fR"
Whether or not the service runs chrooted to the mail queue
directory (pathname is controlled by the \fBqueue_directory\fR
configuration variable in the main.cf file).
diff --git a/postfix/man/man5/postconf.5 b/postfix/man/man5/postconf.5
index 970608a44..86ebfd11b 100644
--- a/postfix/man/man5/postconf.5
+++ b/postfix/man/man5/postconf.5
@@ -515,7 +515,7 @@ remote_header_rewrite_domain parameter specifies a non-empty value.
.PP
To get the behavior before Postfix version 2.2, specify
"local_header_rewrite_clients = static:all".
-.SH append_dot_mydomain (default: yes)
+.SH append_dot_mydomain (default: Postfix >= 2.12: no, Postfix < 2.12: yes)
With locally submitted mail, append the string ".$mydomain" to
addresses that have no ".domain" information. With remotely submitted
mail, append the string ".$remote_header_rewrite_domain"
@@ -889,6 +889,26 @@ delivery by the \fBpipe\fR(8) delivery agent.
.PP
Note: if you set this time limit to a large value you must update the
global ipc_timeout parameter as well.
+.SH compatibility_level (default: 0)
+A safety net that forces Postfix to keep running with
+backwards-compatible main.cf and master.cf default settings after
+an upgrade to a newer but incompatible Postfix version.
+.PP
+Depending on the compatibility_level parameter setting, Postfix
+continues to use backwards-compatible default settings, and logs
+the use of those backwards-compatible default settings with messages
+that contain the string "using legacy default setting". Based on
+this logging the system administrator can determine that a new
+default setting breaks nothing or that a backwards-compatible
+default setting needs to be made permanent in main.cf or master.cf.
+.PP
+After this review is complete, and no more backwards-compatible
+settings need to be made permanent, the administrator should accept
+the remaining Postfix built-in default settings by updating the
+compatibility_level setting in main.cf as recommended in the Postfix
+RELEASE_NOTES.
+.PP
+This feature is available in Postfix 2.12 and later.
.SH config_directory (default: see "postconf -d" output)
The default location of the Postfix main.cf and master.cf
configuration files. This can be overruled via the following
@@ -11331,7 +11351,7 @@ mail.
.br
.PP
This feature is available in Postfix 2.12 and later.
-.SH smtputf8_enable (default: no)
+.SH smtputf8_enable (default: yes)
Enable experimental SMTPUTF8 support for the protocols described
in RFC 6531..6533. This requires that Postfix is built to support
these protocols.
diff --git a/postfix/man/man8/smtp.8 b/postfix/man/man8/smtp.8
index 7836549c2..c0c3ed2bc 100644
--- a/postfix/man/man8/smtp.8
+++ b/postfix/man/man8/smtp.8
@@ -613,7 +613,7 @@ limit).
.ad
.fi
Preliminary SMTPUTF8 support is introduced with Postfix 2.12.
-.IP "\fBsmtputf8_enable (no)\fR"
+.IP "\fBsmtputf8_enable (yes)\fR"
Enable experimental SMTPUTF8 support for the protocols described
in RFC 6531..6533.
.IP "\fBsmtputf8_autodetect_classes (sendmail, verify)\fR"
diff --git a/postfix/man/man8/smtpd.8 b/postfix/man/man8/smtpd.8
index b77072289..da88cc8f5 100644
--- a/postfix/man/man8/smtpd.8
+++ b/postfix/man/man8/smtpd.8
@@ -514,7 +514,7 @@ cipher list.
.ad
.fi
Preliminary SMTPUTF8 support is introduced with Postfix 2.12.
-.IP "\fBsmtputf8_enable (no)\fR"
+.IP "\fBsmtputf8_enable (yes)\fR"
Enable experimental SMTPUTF8 support for the protocols described
in RFC 6531..6533.
.IP "\fBstrict_smtputf8 (no)\fR"
diff --git a/postfix/man/man8/trivial-rewrite.8 b/postfix/man/man8/trivial-rewrite.8
index 547d79066..ca81ee7d6 100644
--- a/postfix/man/man8/trivial-rewrite.8
+++ b/postfix/man/man8/trivial-rewrite.8
@@ -130,7 +130,7 @@ Enable the rewriting of the form "user%domain" to "user@domain".
.IP "\fBappend_at_myorigin (yes)\fR"
With locally submitted mail, append the string "@$myorigin" to mail
addresses without domain information.
-.IP "\fBappend_dot_mydomain (yes)\fR"
+.IP "\fBappend_dot_mydomain (Postfix ≥ 2.12: no, Postfix < 2.12: yes)\fR"
With locally submitted mail, append the string ".$mydomain" to
addresses that have no ".domain" information.
.IP "\fBrecipient_delimiter (empty)\fR"
diff --git a/postfix/mantools/postlink b/postfix/mantools/postlink
index 733640dd4..2f978eb37 100755
--- a/postfix/mantools/postlink
+++ b/postfix/mantools/postlink
@@ -1061,6 +1061,10 @@ while (<>) {
s;\bpolicy_time_limit\b;$&;g;
s;\bgreylist_time_limit\b;$&;g;
+ # Compatibility and migration
+
+ s;\bcompatibility_level\b;$&;g;
+
# Hyperlink URLs and RFC documents
s/(http:\/\/[^ ,"\(\)]*[^ ,"\(\):;!?.])/$1<\/a>/;
diff --git a/postfix/proto/MILTER_README.html b/postfix/proto/MILTER_README.html
index 626f229e1..27984feca 100644
--- a/postfix/proto/MILTER_README.html
+++ b/postfix/proto/MILTER_README.html
@@ -583,8 +583,8 @@ have the same name as those parameters, without the "milter_" prefix.
Inside the list, syntax is similar to what we already know from
main.cf: items separated by space or comma. There is one difference:
you must enclose a setting in parentheses, as in "{ name = value
-}", if you want to have space within a value or around "=".
-
Each restriction list is evaluated from left to right until some restriction produces a result of PERMIT, REJECT or DEFER (try -again later). The end of the list is equivalent to a PERMIT result. +again later). The end of each list is equivalent to a PERMIT result. By placing a PERMIT restriction before a REJECT restriction you can make exceptions for specific clients or users. This is called whitelisting; the fourth example above allows mail from local diff --git a/postfix/proto/SMTPD_POLICY_README.html b/postfix/proto/SMTPD_POLICY_README.html index e874c5598..3742e6462 100644 --- a/postfix/proto/SMTPD_POLICY_README.html +++ b/postfix/proto/SMTPD_POLICY_README.html @@ -425,9 +425,10 @@ and have the same name as those parameters, without the
Inside the list, syntax is similar to what we already know from main.cf: items separated by space or comma. There is one difference: you must enclose a setting in parentheses, as in "{ name = value -}", if you want to have space within a value or around "=". -This comes in handy when different policy servers require different -default actions with different SMTP status codes or text:
+}", if you want to have space or comma within a value or around +"=". This comes in handy when different policy servers require +different default actions with different SMTP status codes or text: +-diff --git a/postfix/proto/SMTPUTF8_README.html b/postfix/proto/SMTPUTF8_README.html index 41d845085..70522c4ce 100644 --- a/postfix/proto/SMTPUTF8_README.html +++ b/postfix/proto/SMTPUTF8_README.html @@ -50,12 +50,16 @@ header values.Enabling Postfix SMTPUTF8 support
-Before turning on SMTPUTF8 support in Postfix, you need to -verify that the rest of your email infrastructure can handle UTF-8 -email addresses and message header values, including SMTPUTF8 +
There is more to SMTPUTF8 than just Postfix itself. The rest +of your email infrastructure also needs to be able to handle UTF-8 +email addresses and message header values. This includes SMTPUTF8 protocol support in SMTP-based content filters (Amavisd), LMTP servers (Dovecot), and down-stream SMTP servers.
+Postfix SMTPUTF8 support is enabled by default, but it may be +disabled as part of a backwards-compatibility safety net (see the +Postfix 2.12 RELEASE_NOTES file).
+SMTPUTF8 support is enabled by setting the smtputf8_enable parameter in main.cf:
@@ -66,7 +70,8 @@ parameter in main.cf:
With SMTPUTF8 support enabled, Postfix changes behavior as follows:
+With SMTPUTF8 support enabled, Postfix changes behavior with +respect to earlier Postfix releases:
To get the behavior before Postfix version 2.2, specify "local_header_rewrite_clients = static:all".
-%PARAM append_dot_mydomain yes +%PARAM append_dot_mydomain Postfix ≥ 2.12: no, Postfix < 2.12: yesWith locally submitted mail, append the string ".$mydomain" to @@ -16123,7 +16123,7 @@ service request. Specify a value greater than zero.
This feature is available in Postfix 2.12 and later.
-%PARAM smtputf8_enable no +%PARAM smtputf8_enable yesEnable experimental SMTPUTF8 support for the protocols described in RFC 6531..6533. This requires that Postfix is built to support @@ -16196,3 +16196,26 @@ mail.
This feature is available in Postfix 2.12 and later.
+ +%PARAM compatibility_level 0 + +A safety net that forces Postfix to keep running with +backwards-compatible main.cf and master.cf default settings after +an upgrade to a newer but incompatible Postfix version.
+ +Depending on the compatibility_level parameter setting, Postfix +continues to use backwards-compatible default settings, and logs +the use of those backwards-compatible default settings with messages +that contain the string "using legacy default setting". Based on +this logging the system administrator can determine that a new +default setting breaks nothing or that a backwards-compatible +default setting needs to be made permanent in main.cf or master.cf. +
+ +After this review is complete, and no more backwards-compatible +settings need to be made permanent, the administrator should accept +the remaining Postfix built-in default settings by updating the +compatibility_level setting in main.cf as recommended in the Postfix +RELEASE_NOTES.
+ +This feature is available in Postfix 2.12 and later.
diff --git a/postfix/src/global/mail_params.c b/postfix/src/global/mail_params.c index 85682c7b4..318fbe2cd 100644 --- a/postfix/src/global/mail_params.c +++ b/postfix/src/global/mail_params.c @@ -127,10 +127,15 @@ /* int var_smtputf8_enable /* int var_strict_smtputf8; /* char *var_smtputf8_autoclass; +/* int var_compat_level; /* /* void mail_params_init() /* /* const char null_format_string[1]; +/* +/* int warn_compat_break_app_dot_mydomain; +/* int warn_compat_break_smtputf8_enable; +/* int warn_compat_break_chroot; /* DESCRIPTION /* This module (actually the associated include file) define the names /* and defaults of all mail configuration parameters. @@ -143,6 +148,9 @@ /* /* null_format_string is a workaround for gcc compilers that complain /* about empty or null format strings. +/* +/* The warn_compat_XXX variables enable warnings for the use +/* of legacy default settings after an incompatible change. /* DIAGNOSTICS /* Fatal errors: out of memory; null system or domain name. /* LICENSE @@ -322,9 +330,14 @@ char *var_dsn_filter; int var_smtputf8_enable; int var_strict_smtputf8; char *var_smtputf8_autoclass; +int var_compat_level; const char null_format_string[1] = ""; +int warn_compat_break_app_dot_mydomain; +int warn_compat_break_smtputf8_enable; +int warn_compat_break_chroot; + /* check_myhostname - lookup hostname and validate */ static const char *check_myhostname(void) @@ -525,10 +538,52 @@ static char *read_param_from_file(const char *path) #endif +/* check_legacy_defaults - flag parameters that require safety-net logging */ + +static void check_legacy_defaults(void) +{ + + /* + * Basic idea: when an existing parameter default is changed, or a new + * parameter is introduced with incompatible default behavior, force + * Postfix to run with backwards-compatible default settings and log a + * warning when the backwards-compatible behavior is used. + * + * Based on a review of Postfix logging the system administrator can decide + * whether or not to make backwards-compatible default settings permanent + * in main.cf or master.cf. + * + * To turn off further warnings and deploy the new default settings, the + * system administrator should update the compatibility_level setting as + * recommended in the RELASE_NOTES file. + * + * Each incompatible change has its own flag variable, instead of bit in a + * shared variable. We don't want to rip up code when we need more flag + * bits. + */ + + /* + * Look for specific parameters that were left behind at legacy defaults + * when the compatibility level changed for the first time, from 0 to 1. + */ + if (var_compat_level < 1) { + /* Should inet_protocols also be listed here? */ + if (mail_conf_lookup(VAR_APP_DOT_MYDOMAIN) == 0) + warn_compat_break_app_dot_mydomain = 1; + if (mail_conf_lookup(VAR_SMTPUTF8_ENABLE) == 0) + warn_compat_break_smtputf8_enable = 1; + warn_compat_break_chroot = 1; + } +} + /* mail_params_init - configure built-in parameters */ void mail_params_init() { + static const CONFIG_INT_TABLE first_int_defaults[] = { + VAR_COMPAT_LEVEL, DEF_COMPAT_LEVEL, &var_compat_level, 0, 0, + 0, + }; static const CONFIG_STR_TABLE first_str_defaults[] = { /* $mail_version may appear in other parameters. */ VAR_MAIL_VERSION, DEF_MAIL_VERSION, &var_mail_version, 1, 0, @@ -663,13 +718,23 @@ void mail_params_init() VAR_CYRUS_SASL_AUTHZID, DEF_CYRUS_SASL_AUTHZID, &var_cyrus_sasl_authzid, VAR_MULTI_ENABLE, DEF_MULTI_ENABLE, &var_multi_enable, VAR_LONG_QUEUE_IDS, DEF_LONG_QUEUE_IDS, &var_long_queue_ids, - VAR_SMTPUTF8_ENABLE, DEF_SMTPUTF8_ENABLE, &var_smtputf8_enable, VAR_STRICT_SMTPUTF8, DEF_STRICT_SMTPUTF8, &var_strict_smtputf8, 0, }; + static const CONFIG_NBOOL_TABLE nbool_defaults[] = { + VAR_SMTPUTF8_ENABLE, DEF_SMTPUTF8_ENABLE, &var_smtputf8_enable, + 0, + }; const char *cp; INET_PROTO_INFO *proto_info; + /* + * Extract compatibility level first, so that we can determine what + * parameters of interest are left at their legacy defaults. + */ + get_mail_conf_int_table(first_int_defaults); + check_legacy_defaults(); + /* * Extract syslog_facility early, so that from here on all errors are * logged with the proper facility. @@ -732,6 +797,7 @@ void mail_params_init() get_mail_conf_int_table(other_int_defaults); get_mail_conf_long_table(long_defaults); get_mail_conf_bool_table(bool_defaults); + get_mail_conf_nbool_table(nbool_defaults); get_mail_conf_time_table(time_defaults); check_default_privs(); check_mail_owner(); diff --git a/postfix/src/global/mail_params.h b/postfix/src/global/mail_params.h index 1ae2a0114..5c0472f76 100644 --- a/postfix/src/global/mail_params.h +++ b/postfix/src/global/mail_params.h @@ -37,6 +37,18 @@ extern bool var_helpful_warnings; #define DEF_SHOW_UNK_RCPT_TABLE 1 extern bool var_show_unk_rcpt_table; + /* + * Compatibility level and migration support. + */ +#define VAR_COMPAT_LEVEL "compatibility_level" +#define DEF_COMPAT_LEVEL 0 +#define CUR_COMPAT_LEVEL 1 +extern int var_compat_level; + +extern int warn_compat_break_app_dot_mydomain; +extern int warn_compat_break_smtputf8_enable; +extern int warn_compat_break_chroot; + /* * What problem classes should be reported to the postmaster via email. * Default is bad problems only. See mail_error(3). Even when mail notices @@ -467,7 +479,7 @@ extern bool var_swap_bangpath; extern bool var_append_at_myorigin; #define VAR_APP_DOT_MYDOMAIN "append_dot_mydomain" -#define DEF_APP_DOT_MYDOMAIN 1 +#define DEF_APP_DOT_MYDOMAIN "${{$compatibility_level} < {1} ? {yes} : {no}}" extern bool var_append_dot_mydomain; #define VAR_PERCENT_HACK "allow_percent_hack" @@ -3830,7 +3842,7 @@ extern char *var_meta_dir; * SMTPUTF8 support. */ #define VAR_SMTPUTF8_ENABLE "smtputf8_enable" -#define DEF_SMTPUTF8_ENABLE 0 +#define DEF_SMTPUTF8_ENABLE "${{$compatibility_level} < {1} ? {no} : {yes}}" extern int var_smtputf8_enable; #define VAR_STRICT_SMTPUTF8 "strict_smtputf8" diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index eb4fb97ae..464009f1f 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 "20140929" +#define MAIL_RELEASE_DATE "20141001" #define MAIL_VERSION_NUMBER "2.12" #ifdef SNAPSHOT diff --git a/postfix/src/master/master_ent.c b/postfix/src/master/master_ent.c index f657a60fa..3681e038d 100644 --- a/postfix/src/master/master_ent.c +++ b/postfix/src/master/master_ent.c @@ -202,6 +202,10 @@ static char *get_str_ent(char **bufp, char *name, char *def_val) if (strcmp(value, "-") == 0) { if (def_val == 0) fatal_with_context("field \"%s\" has no default value", name); + if (warn_compat_break_chroot && strcmp(name, "chroot") == 0) + msg_info("%s: line %d: using legacy default setting %s=%s (" + VAR_COMPAT_LEVEL "<1)", master_path, master_line, + name, def_val); return (def_val); } else { return (value); @@ -469,7 +473,7 @@ MASTER_SERV *get_master_ent() * XXX Chroot cannot imply unprivileged service (for example, the pickup * service runs chrooted but needs privileges to open files as the user). */ - chroot = get_bool_ent(&bufp, "chroot", "y"); + chroot = get_bool_ent(&bufp, "chroot", var_compat_level < 1 ? "y" : "n"); /* * Wakeup timer. XXX should we require that var_proc_limit == 1? Right diff --git a/postfix/src/postfix/postfix.c b/postfix/src/postfix/postfix.c index 6909e1c24..bada7b928 100644 --- a/postfix/src/postfix/postfix.c +++ b/postfix/src/postfix/postfix.c @@ -495,6 +495,20 @@ int main(int argc, char **argv) mail_conf_read(); get_mail_conf_str_table(str_table); + /* + * Alert the sysadmin that the backwards-compatible settings are still + * in effect. + */ + if (var_compat_level < CUR_COMPAT_LEVEL) { + msg_warn("Postfix is running with backwards-compatible default " + "settings"); + msg_warn("See http://www.postfix.org/postconf.5.html#" + VAR_COMPAT_LEVEL " for details"); + msg_warn("Use \"postconf " VAR_COMPAT_LEVEL "=%d\" to disable " + "the backwards-compatible default settings", + CUR_COMPAT_LEVEL); + } + /* * Environment import filter, to enforce consistent behavior whether this * command is started by hand, or at system boot time. This is necessary diff --git a/postfix/src/smtp/smtp.c b/postfix/src/smtp/smtp.c index 6e0ce6925..99d12085e 100644 --- a/postfix/src/smtp/smtp.c +++ b/postfix/src/smtp/smtp.c @@ -577,7 +577,7 @@ /* .ad /* .fi /* Preliminary SMTPUTF8 support is introduced with Postfix 2.12. -/* .IP "\fBsmtputf8_enable (no)\fR" +/* .IP "\fBsmtputf8_enable (yes)\fR" /* Enable experimental SMTPUTF8 support for the protocols described /* in RFC 6531..6533. /* .IP "\fBsmtputf8_autodetect_classes (sendmail, verify)\fR" diff --git a/postfix/src/smtpd/smtpd.c b/postfix/src/smtpd/smtpd.c index ba9e77682..8245db982 100644 --- a/postfix/src/smtpd/smtpd.c +++ b/postfix/src/smtpd/smtpd.c @@ -476,7 +476,7 @@ /* .ad /* .fi /* Preliminary SMTPUTF8 support is introduced with Postfix 2.12. -/* .IP "\fBsmtputf8_enable (no)\fR" +/* .IP "\fBsmtputf8_enable (yes)\fR" /* Enable experimental SMTPUTF8 support for the protocols described /* in RFC 6531..6533. /* .IP "\fBstrict_smtputf8 (no)\fR" @@ -2483,12 +2483,19 @@ static int mail_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *argv) * Changing this would be a compatibility break. That can't happen in the * forseeable future. */ - if (var_strict_smtputf8 && (state->flags & SMTPD_FLAG_SMTPUTF8) == 0) { - if (*STR(state->addr_buf) && !allascii(STR(state->addr_buf))) { - mail_reset(state); - smtpd_chat_reply(state, "553 5.6.7 Must declare SMTPUTF8 to send unicode address"); + if ((var_strict_smtputf8 || warn_compat_break_smtputf8_enable) + && (state->flags & SMTPD_FLAG_SMTPUTF8) == 0 + && *STR(state->addr_buf) && !allascii(STR(state->addr_buf))) { + if (var_strict_smtputf8) { + smtpd_chat_reply(state, "553 5.6.7 Must declare SMTPUTF8 to " + "send unicode address"); return (-1); } + if (warn_compat_break_smtputf8_enable) + msg_info("using legacy default setting " VAR_SMTPUTF8_ENABLE + "=no to accept non-ASCII sender address \"%s\" from " + "%s (" VAR_COMPAT_LEVEL "<1)", STR(state->addr_buf), + state->namaddr); } /* @@ -2734,12 +2741,19 @@ static int rcpt_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *argv) * Changing this would be a compatibility break. That can't happen in the * forseeable future. */ - if (var_strict_smtputf8 && (state->flags & SMTPD_FLAG_SMTPUTF8) == 0) { - if (*STR(state->addr_buf) && !allascii(STR(state->addr_buf))) { - mail_reset(state); - smtpd_chat_reply(state, "553 5.6.7 Must declare SMTPUTF8 to send unicode address"); + if ((var_strict_smtputf8 || warn_compat_break_smtputf8_enable) + && (state->flags & SMTPD_FLAG_SMTPUTF8) == 0 + && *STR(state->addr_buf) && !allascii(STR(state->addr_buf))) { + if (var_strict_smtputf8) { + smtpd_chat_reply(state, "553 5.6.7 Must declare SMTPUTF8 to " + "send unicode address"); return (-1); } + if (warn_compat_break_smtputf8_enable) + msg_info("using legacy default setting " VAR_SMTPUTF8_ENABLE + "=no to accept non-ASCII recipient address \"%s\" from" + " %s (" VAR_COMPAT_LEVEL "<1)", STR(state->addr_buf), + state->namaddr); } if (SMTPD_STAND_ALONE(state) == 0) { const char *verify_sender; diff --git a/postfix/src/trivial-rewrite/rewrite.c b/postfix/src/trivial-rewrite/rewrite.c index 60155de03..b09cc8cee 100644 --- a/postfix/src/trivial-rewrite/rewrite.c +++ b/postfix/src/trivial-rewrite/rewrite.c @@ -105,6 +105,7 @@ void rewrite_tree(RWR_CONTEXT *context, TOK822 *tree) TOK822 *domain; TOK822 *bang; TOK822 *local; + VSTRING *vstringval; /* * XXX If you change this module, quote_822_local.c, or tok822_parse.c, @@ -194,6 +195,12 @@ void rewrite_tree(RWR_CONTEXT *context, TOK822 *tree) && domain != tree->tail && tok822_find_type(domain, TOK822_DOMLIT) == 0 && tok822_find_type(domain, '.') == 0) { + if (warn_compat_break_app_dot_mydomain + && (vstringval = domain->next->vstr) != 0) + msg_info("using legacy default setting " VAR_APP_DOT_MYDOMAIN + "=yes to rewrite \"%s\" to \"%s.%s\" (" VAR_COMPAT_LEVEL + " < 1)", vstring_str(vstringval), + vstring_str(vstringval), var_mydomain); tok822_sub_append(tree, tok822_alloc('.', (char *) 0)); tok822_sub_append(tree, tok822_scan(REW_PARAM_VALUE(context->domain), (TOK822 **) 0)); diff --git a/postfix/src/trivial-rewrite/trivial-rewrite.c b/postfix/src/trivial-rewrite/trivial-rewrite.c index 6c1fb49e5..3b88be611 100644 --- a/postfix/src/trivial-rewrite/trivial-rewrite.c +++ b/postfix/src/trivial-rewrite/trivial-rewrite.c @@ -110,7 +110,7 @@ /* .IP "\fBappend_at_myorigin (yes)\fR" /* With locally submitted mail, append the string "@$myorigin" to mail /* addresses without domain information. -/* .IP "\fBappend_dot_mydomain (yes)\fR" +/* .IP "\fBappend_dot_mydomain (Postfix ≥ 2.12: no, Postfix < 2.12: yes)\fR" /* With locally submitted mail, append the string ".$mydomain" to /* addresses that have no ".domain" information. /* .IP "\fBrecipient_delimiter (empty)\fR" @@ -609,7 +609,6 @@ int main(int argc, char **argv) }; static const CONFIG_BOOL_TABLE bool_table[] = { VAR_SWAP_BANGPATH, DEF_SWAP_BANGPATH, &var_swap_bangpath, - VAR_APP_DOT_MYDOMAIN, DEF_APP_DOT_MYDOMAIN, &var_append_dot_mydomain, VAR_APP_AT_MYORIGIN, DEF_APP_AT_MYORIGIN, &var_append_at_myorigin, VAR_PERCENT_HACK, DEF_PERCENT_HACK, &var_percent_hack, VAR_RESOLVE_DEQUOTED, DEF_RESOLVE_DEQUOTED, &var_resolve_dequoted, @@ -619,6 +618,10 @@ int main(int argc, char **argv) VAR_ALLOW_MIN_USER, DEF_ALLOW_MIN_USER, &var_allow_min_user, 0, }; + static const CONFIG_NBOOL_TABLE nbool_table[] = { + VAR_APP_DOT_MYDOMAIN, DEF_APP_DOT_MYDOMAIN, &var_append_dot_mydomain, + 0, + }; /* * Fingerprint executables and core dumps. @@ -628,6 +631,7 @@ int main(int argc, char **argv) multi_server_main(argc, argv, rewrite_service, MAIL_SERVER_STR_TABLE, str_table, MAIL_SERVER_BOOL_TABLE, bool_table, + MAIL_SERVER_NBOOL_TABLE, nbool_table, MAIL_SERVER_PRE_INIT, pre_jail_init, MAIL_SERVER_POST_INIT, post_jail_init, #ifdef CHECK_TABLE_STATS_BEFORE_ACCEPT diff --git a/postfix/src/util/dict_union.c b/postfix/src/util/dict_union.c index cb2300954..88091311b 100644 --- a/postfix/src/util/dict_union.c +++ b/postfix/src/util/dict_union.c @@ -145,7 +145,6 @@ DICT *dict_union_open(const char *name, int open_flags, int dict_flags) /* * Split the table name into its constituent parts. */ - saved_name = mystrdup(name + 1); /* XXX ASCII delimiter */ if ((len = balpar(name, "{}")) == 0 || name[len] != 0 || *(saved_name = mystrndup(name + 1, len - 2)) == 0) DICT_UNION_RETURN(dict_surrogate(DICT_TYPE_UNION, name, diff --git a/postfix/src/util/mac_expand.c b/postfix/src/util/mac_expand.c index f0934f94d..0e4cd7cdf 100644 --- a/postfix/src/util/mac_expand.c +++ b/postfix/src/util/mac_expand.c @@ -123,6 +123,7 @@ #include