From: Wietse Z Venema Date: Sat, 20 Sep 2025 05:00:00 +0000 (-0500) Subject: postfix-3.11-20250920 X-Git-Tag: v3.11.0-RC1~25 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ab20d8495cac0ca75b00a4619b5edf121b2756ba;p=thirdparty%2Fpostfix.git postfix-3.11-20250920 --- diff --git a/postfix/HISTORY b/postfix/HISTORY index c2bc3dca6..bdf2ebc23 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -29618,3 +29618,22 @@ Apologies for any names omitted. Finally, do not cache a connection when SMTPUTF8 is required but the server does not support that feature. Files: smtp/smtp.h, smtp/smtp_key.c, smtp/smtp_proto.c. + +20250919 + + Cleanup: unnecessary header parsing code. Viktor Dukhovni. + File: cleanup/cleanup_message.c. + + Bugfix (defect introduced: Postfix 3.8, date 20220128): the + 'postconf -e' output order for new main.cf entries was no + longer deterministic. Problem reported by Oleksandr Natalenko, + diagnosis by Eray Aslan. File: postconf/postconf_edit.c. + + Add missing meta_directory and shlib_directory settings to + the stock main.cf file. Problem diagnosed by Eray Aslan. + File: conf/main.cf. + +20250920 + + Added back a hunk of patch 20250911 that had somehow gone + missing. File: smtp/smtp.h. diff --git a/postfix/conf/main.cf b/postfix/conf/main.cf index dc20b71dd..f61060ef2 100644 --- a/postfix/conf/main.cf +++ b/postfix/conf/main.cf @@ -682,4 +682,13 @@ sample_directory = # readme_directory: The location of the Postfix README files. # readme_directory = + +# shlib_directory: The location of the Postfix *.so library files and +# database plugins. +shlib_directory = + +# meta_directory: The location of non-executable files that are shared +# between multiple Postfix instances. +meta_directory = /etc/postfix + inet_protocols = ipv4 diff --git a/postfix/src/cleanup/cleanup_message.c b/postfix/src/cleanup/cleanup_message.c index cdff5bf05..7259de188 100644 --- a/postfix/src/cleanup/cleanup_message.c +++ b/postfix/src/cleanup/cleanup_message.c @@ -654,11 +654,7 @@ static void cleanup_header_callback(void *context, int header_class, argv_add(state->auto_hdrs, vstring_str(header_buf), ARGV_END); } if (hdr_opts->type == HDR_TLS_REQUIRED && var_tls_required_enable) { - char *cp = vstring_str(header_buf) + strlen(hdr_opts->name) + 1; - - while (ISSPACE(*cp)) - cp++; - if (strcasecmp(cp, "no") == 0) + if (strcasecmp(hdrval, "no") == 0) state->sendopts |= SOPT_REQUIRETLS_HEADER; else msg_warn("ignoring malformed header: '%.100s'", diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index 14d4e2ad5..a6b120a5f 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 "20250911" +#define MAIL_RELEASE_DATE "20250920" #define MAIL_VERSION_NUMBER "3.11" #ifdef SNAPSHOT diff --git a/postfix/src/postconf/postconf_edit.c b/postfix/src/postconf/postconf_edit.c index 437f2a870..96d1915e2 100644 --- a/postfix/src/postconf/postconf_edit.c +++ b/postfix/src/postconf/postconf_edit.c @@ -148,6 +148,16 @@ static void pcf_gobble_cf_line(VSTRING *full_entry_buf, VSTRING *line_buf, } } +/* pcf_cmp_ht_key - qsort helper for ht_info pointer array */ + +static int pcf_cmp_ht_key(const void *a, const void *b) +{ + HTABLE_INFO **ap = (HTABLE_INFO **) a; + HTABLE_INFO **bp = (HTABLE_INFO **) b; + + return (strcmp(ap[0]->key, bp[0]->key)); +} + /* pcf_edit_main - edit main.cf file */ void pcf_edit_main(int mode, int argc, char **argv) @@ -262,7 +272,9 @@ void pcf_edit_main(int mode, int argc, char **argv) * Generate new entries for parameters that were not found. */ if (mode & PCF_EDIT_CONF) { - for (ht_info = ht = htable_list(table); *ht; ht++) { + ht_info = htable_list(table); + qsort((void *) ht_info, table->used, sizeof(*ht_info), pcf_cmp_ht_key); + for (ht = ht_info; *ht; ht++) { cvalue = (struct cvalue *) ht[0]->value; if (cvalue->found == 0) vstream_fprintf(dst, "%s = %s\n", ht[0]->key, cvalue->value); diff --git a/postfix/src/smtp/smtp.h b/postfix/src/smtp/smtp.h index 5ce798d02..984387a85 100644 --- a/postfix/src/smtp/smtp.h +++ b/postfix/src/smtp/smtp.h @@ -296,7 +296,9 @@ typedef struct SMTP_STATE { #define SMTP_FEATURE_FROM_PROXY (1<<22) /* proxied connection */ /* - * Features that passivate under the endpoint. + * Features that passivate under the endpoint. Be sure to passivate all + * features that are needed in SMTP_KEY_MASK_SCACHE_DEST_LABEL, otherwise a + * reused connection may be stored under the wrong key. */ #define SMTP_FEATURE_ENDPOINT_MASK \ (~(SMTP_FEATURE_BEST_MX | SMTP_FEATURE_RSET_REJECTED \