]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-3.8.2 v3.8.2
authorWietse Venema <wietse@porcupine.org>
Fri, 1 Sep 2023 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <ietf-dane@dukhovni.org>
Thu, 21 Sep 2023 02:35:32 +0000 (22:35 -0400)
postfix/HISTORY
postfix/src/dns/dns_lookup.c
postfix/src/global/mail_version.h
postfix/src/smtp/smtp.h
postfix/src/util/valid_hostname.c
postfix/src/util/valid_hostname.h

index cd8102a0ee7875bd12283d55f72de516d3a92521..959d9afc9b45ca0b83ce00afd1bbcade925c21b9 100644 (file)
@@ -27159,3 +27159,28 @@ Apologies for any names omitted.
        (default: no) to disconnect remote SMTP clients that violate
        RFC 2920 (or 5321) command pipelining constraints. Files:
        global/mail_params.h, smtpd/smtpd.c, proto/postconf.proto.
+
+20230815
+
+       Bugfix (bug introduced: 20140218): when opportunistic TLS fails
+       during or after the handshake, don't require that a probe
+       message spent a minimum time-in-queue before falling back to
+       plaintext. Problem reported by Serg. File: smtp/smtp.h.
+
+20230819
+
+       Bugfix (defect introduced: 19980207): the valid_hostname()
+       check in the Postfix DNS client library was blocking unusual
+       but legitimate wildcard names (*.name) in some DNS lookup
+       results and lookup requests. Examples:
+
+            name          class/type value
+            *.one.example   IN CNAME *.other.example
+            *.other.example IN A     10.0.0.1
+            *.other.example IN TLSA  ..certificate info...
+
+       Such syntax is blesed in RFC 1034 section 4.3.3.
+
+       This problem was reported first in the context of TLSA
+       record lookups. Files: util/valid_hostname.[hc],
+       dns/dns_lookup.c.
index d44cae7ee18a282fb995ea0437e17b96330af64f..06028c804f78befed2f3fb27037b217bd49a3020 100644 (file)
@@ -710,7 +710,7 @@ static int valid_rr_name(const char *name, const char *location,
     if (valid_hostaddr(name, DONT_GRIPE)) {
        result = PASS_NAME;
        gripe = "numeric domain name";
-    } else if (!valid_hostname(name, DO_GRIPE)) {
+    } else if (!valid_hostname(name, DO_GRIPE | DO_WILDCARD)) {
        result = REJECT_NAME;
        gripe = "malformed domain name";
     } else {
@@ -1045,7 +1045,7 @@ int     dns_lookup_x(const char *name, unsigned type, unsigned flags,
     /*
      * The Linux resolver misbehaves when given an invalid domain name.
      */
-    if (strcmp(name, ".") && !valid_hostname(name, DONT_GRIPE)) {
+    if (strcmp(name, ".") && !valid_hostname(name, DONT_GRIPE | DO_WILDCARD)) {
        if (why)
            vstring_sprintf(why,
                   "Name service error for %s: invalid host or domain name",
index b3838f76f37f0e1a06a83930a57ea4ae44d81742..5045613f1c6d1ac2ef69fc384daab2136eff7bfe 100644 (file)
@@ -20,8 +20,8 @@
   * Patches change both the patchlevel and the release date. Snapshots have no
   * patchlevel; they change the release date only.
   */
-#define MAIL_RELEASE_DATE      "20230605"
-#define MAIL_VERSION_NUMBER    "3.8.1"
+#define MAIL_RELEASE_DATE      "20230901"
+#define MAIL_VERSION_NUMBER    "3.8.2"
 
 #ifdef SNAPSHOT
 #define MAIL_VERSION_DATE      "-" MAIL_RELEASE_DATE
index 35d97da2ac96393a0adff0f542699438c0be5c28..f8c8f588b307b962fcf0d221e0886244014b461e 100644 (file)
@@ -504,17 +504,19 @@ extern HBC_CALL_BACKS smtp_hbc_callbacks[];
        (session->state->request->msg_stats.active_arrival.tv_sec - \
         session->state->request->msg_stats.incoming_arrival.tv_sec)
 
+#define TRACE_REQ_ONLY (DEL_REQ_TRACE_ONLY(state->request->flags))
+
 #define PLAINTEXT_FALLBACK_OK_AFTER_STARTTLS_FAILURE \
        (session->tls_context == 0 \
            && state->tls->level == TLS_LEV_MAY \
-           && PREACTIVE_DELAY >= var_min_backoff_time \
+           && (TRACE_REQ_ONLY || PREACTIVE_DELAY >= var_min_backoff_time) \
            && !HAVE_SASL_CREDENTIALS)
 
 #define PLAINTEXT_FALLBACK_OK_AFTER_TLS_SESSION_FAILURE \
        (session->tls_context != 0 \
            && SMTP_RCPT_LEFT(state) > SMTP_RCPT_MARK_COUNT(state) \
            && state->tls->level == TLS_LEV_MAY \
-           && PREACTIVE_DELAY >= var_min_backoff_time \
+           && (TRACE_REQ_ONLY || PREACTIVE_DELAY >= var_min_backoff_time) \
            && !HAVE_SASL_CREDENTIALS)
 
  /*
index 07c9eca681aa02f504063c9bdb3ff5977abb6210..8b234c4dc9228478b28ec9a0e4703c8cd7511356 100644 (file)
@@ -83,7 +83,7 @@
 
 /* valid_hostname - screen out bad hostnames */
 
-int     valid_hostname(const char *name, int gripe)
+int     valid_hostname(const char *name, int flags)
 {
     const char *myname = "valid_hostname";
     const char *cp;
@@ -91,6 +91,7 @@ int     valid_hostname(const char *name, int gripe)
     int     label_count = 0;
     int     non_numeric = 0;
     int     ch;
+    int     gripe = flags & DO_GRIPE;
 
     /*
      * Trivial cases first.
@@ -116,6 +117,15 @@ int     valid_hostname(const char *name, int gripe)
            }
            if (!ISDIGIT(ch))
                non_numeric = 1;
+       } else if ((flags & DO_WILDCARD) && ch == '*') {
+           if (label_length || label_count || (cp[1] && cp[1] != '.')) {
+               if (gripe)
+                   msg_warn("%s: '*' can be the first label only: %.100s", myname, name);
+               return (0);
+           }
+           label_count++;
+           label_length++;
+           non_numeric = 1;
        } else if (ch == '.') {
            if (label_length == 0 || cp[1] == 0) {
                if (gripe)
index b06fc175861d03fb91c03672d33812033c250949..463bc6ef88dad0da060ce7e520dd625a55b28017 100644 (file)
@@ -18,6 +18,8 @@
 
 #define DONT_GRIPE             0
 #define DO_GRIPE               1
+#define DONT_WILDCARD          0
+#define DO_WILDCARD            (1<<1)
 
 extern int valid_hostname(const char *, int);
 extern int valid_hostaddr(const char *, int);