From ae2374038b534b2c90e6b8ba2763915070bef16c Mon Sep 17 00:00:00 2001 From: Wietse Venema Date: Sun, 6 Nov 2016 00:00:00 -0500 Subject: [PATCH] postfix-3.2-20161106 --- postfix/HISTORY | 10 ++++++++++ postfix/src/global/mail_params.c | 6 +++++- postfix/src/global/mail_params.h | 1 + postfix/src/global/mail_version.h | 2 +- postfix/src/postsuper/postsuper.c | 2 +- postfix/src/util/midna_domain.c | 32 ------------------------------- 6 files changed, 18 insertions(+), 35 deletions(-) diff --git a/postfix/HISTORY b/postfix/HISTORY index 0515875ef..d17d5e4fa 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -22559,3 +22559,13 @@ Apologies for any names omitted. restore historical behavior. Files: util/midna_domain.[hc], mantools/postlink, global/mail_params.[hc], proto/postconf.proto, proto/SMTPUTF8_README.html. + +20161105 + + Bugfix (introduced: Postfix 1.1): the postsuper command did + not count a successful rename operation after error recovery. + Problem reported by Markus Schönhaber. File: postsuper/postsuper.c. + + Cleanup: error reporting for IDNA (non-ASCII domain name) + conversion errors, and enable_idna2003_compatibility + configuration. File: util/midna_domain.c. diff --git a/postfix/src/global/mail_params.c b/postfix/src/global/mail_params.c index 4c2b09ed9..ece9ec071 100644 --- a/postfix/src/global/mail_params.c +++ b/postfix/src/global/mail_params.c @@ -127,6 +127,7 @@ /* int var_smtputf8_enable /* int var_strict_smtputf8; /* char *var_smtputf8_autoclass; +/* int var_idna2003_compat; /* int var_compat_level; /* char *var_drop_hdrs; /* @@ -338,6 +339,7 @@ char *var_dsn_filter; int var_smtputf8_enable; int var_strict_smtputf8; char *var_smtputf8_autoclass; +int var_idna2003_compat; int var_compat_level; char *var_drop_hdrs; @@ -658,7 +660,7 @@ void mail_params_init() static const CONFIG_NBOOL_TABLE first_nbool_defaults[] = { /* read and process the following before opening tables. */ VAR_SMTPUTF8_ENABLE, DEF_SMTPUTF8_ENABLE, &var_smtputf8_enable, - VAR_IDNA2003_COMPAT, DEF_IDNA2003_COMPAT, &midna_domain_transitional, + VAR_IDNA2003_COMPAT, DEF_IDNA2003_COMPAT, &var_idna2003_compat, 0, }; static const CONFIG_STR_FN_TABLE function_str_defaults[] = { @@ -825,6 +827,8 @@ void mail_params_init() msg_warn("%s is true, but EAI support is not compiled in", VAR_SMTPUTF8_ENABLE); var_smtputf8_enable = 0; +#else + midna_domain_transitional = var_idna2003_compat; #endif util_utf8_enable = var_smtputf8_enable; diff --git a/postfix/src/global/mail_params.h b/postfix/src/global/mail_params.h index c4d70c8c5..716c7a618 100644 --- a/postfix/src/global/mail_params.h +++ b/postfix/src/global/mail_params.h @@ -3957,6 +3957,7 @@ extern char *var_smtputf8_autoclass; #define VAR_IDNA2003_COMPAT "enable_idna2003_compatibility" #define DEF_IDNA2003_COMPAT "no" +extern int var_idna2003_compat; /* * Workaround for future incompatibility. Our implementation of RFC 2308 diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index a01c77518..2f3fc143e 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 "20161105" +#define MAIL_RELEASE_DATE "20161106" #define MAIL_VERSION_NUMBER "3.2" #ifdef SNAPSHOT diff --git a/postfix/src/postsuper/postsuper.c b/postfix/src/postsuper/postsuper.c index 9dc932143..2abc25306 100644 --- a/postfix/src/postsuper/postsuper.c +++ b/postfix/src/postsuper/postsuper.c @@ -437,7 +437,7 @@ static int postrename(const char *old, const char *new) if ((ret = sane_rename(old, new)) < 0) { if (errno != ENOENT || mail_queue_mkdirs(new) < 0 - || sane_rename(old, new) < 0) + || (ret = sane_rename(old, new)) < 0) if (errno != ENOENT) msg_fatal("rename file %s as %s: %m", old, new); } else { diff --git a/postfix/src/util/midna_domain.c b/postfix/src/util/midna_domain.c index 00e71d616..7f60b59e3 100644 --- a/postfix/src/util/midna_domain.c +++ b/postfix/src/util/midna_domain.c @@ -113,51 +113,19 @@ static VSTRING *midna_domain_buf; /* x.suffix */ static const char *midna_domain_strerror(UErrorCode error, int info_errors) { static LONG_NAME_MASK uidna_errors[] = { -#ifdef UIDNA_ERROR_EMPTY_LABEL "UIDNA_ERROR_EMPTY_LABEL", UIDNA_ERROR_EMPTY_LABEL, -#endif -#ifdef UIDNA_ERROR_LABEL_TOO_LONG "UIDNA_ERROR_LABEL_TOO_LONG", UIDNA_ERROR_LABEL_TOO_LONG, -#endif -#ifdef UIDNA_ERROR_DOMAIN_NAME_TOO_LONG "UIDNA_ERROR_DOMAIN_NAME_TOO_LONG", UIDNA_ERROR_DOMAIN_NAME_TOO_LONG, -#endif -#ifdef UIDNA_ERROR_LEADING_HYPHEN "UIDNA_ERROR_LEADING_HYPHEN", UIDNA_ERROR_LEADING_HYPHEN, -#endif -#ifdef UIDNA_ERROR_TRAILING_HYPHEN "UIDNA_ERROR_TRAILING_HYPHEN", UIDNA_ERROR_TRAILING_HYPHEN, -#endif -#ifdef UIDNA_ERROR_HYPHEN_3_4 "UIDNA_ERROR_HYPHEN_3_4", UIDNA_ERROR_HYPHEN_3_4, -#endif -#ifdef UIDNA_ERROR_LEADING_COMBINING_MARK "UIDNA_ERROR_LEADING_COMBINING_MARK", UIDNA_ERROR_LEADING_COMBINING_MARK, -#endif -#ifdef UIDNA_ERROR_DISALLOWED "UIDNA_ERROR_DISALLOWED", UIDNA_ERROR_DISALLOWED, -#endif -#ifdef UIDNA_ERROR_PUNYCODE "UIDNA_ERROR_PUNYCODE", UIDNA_ERROR_PUNYCODE, -#endif -#ifdef UIDNA_ERROR_LABEL_HAS_DOT "UIDNA_ERROR_LABEL_HAS_DOT", UIDNA_ERROR_LABEL_HAS_DOT, -#endif -#ifdef UIDNA_ERROR_INVALID_ACE_LABEL "UIDNA_ERROR_INVALID_ACE_LABEL", UIDNA_ERROR_INVALID_ACE_LABEL, -#endif -#ifdef UIDNA_ERROR_BIDI "UIDNA_ERROR_BIDI", UIDNA_ERROR_BIDI, -#endif -#ifdef UIDNA_ERROR_CONTEXTJ "UIDNA_ERROR_CONTEXTJ", UIDNA_ERROR_CONTEXTJ, -#endif -#ifdef UIDNA_ERROR_CONTEXTO_PUNCTUATION - "UIDNA_ERROR_CONTEXTO_PUNCTUATION", UIDNA_ERROR_CONTEXTO_PUNCTUATION, -#endif -#ifdef UIDNA_ERROR_CONTEXTO_DIGITS - "UIDNA_ERROR_CONTEXTO_DIGITS", UIDNA_ERROR_CONTEXTO_DIGITS, -#endif 0, };