[Bug 1549388] Re: In some rare cases Postfix connect to a wrong MX server

Andreas Hasenack andreas at canonical.com
Tue Jun 19 14:16:36 UTC 2018


http://linorg.usp.br/postfix/release/official/postfix-2.11-patch01.gz is
the upstream patch for 2.11.1, and this appears to be the chunk for the
fix:

--- a/postfix/src/smtp/smtp.h
+++ b/postfix/src/smtp/smtp.h
@@ -195,7 +195,7 @@ typedef struct SMTP_STATE {
        STR((state)->iterator->request_nexthop)[0] = 0; \
     }
 
-#define HAVE_NEXTHOP_STATE(state) (STR((state)->iterator->request_nexthop) != 0)
+#define HAVE_NEXTHOP_STATE(state) (STR((state)->iterator->request_nexthop)[0] != 0)
 
 
  /*
diff --git a/postfix/src/smtp/smtp_connect.c b/postfix/src/smtp/smtp_connect.c
index ff278c1f..2e7fc87c 100644
--- a/postfix/src/smtp/smtp_connect.c
+++ b/postfix/src/smtp/smtp_connect.c
@@ -666,6 +666,7 @@ static int smtp_reuse_session(SMTP_STATE *state, DNS_RR **addr_list,
 #endif
     SMTP_ITER_SAVE_DEST(state->iterator);
     if (*addr_list && SMTP_RCPT_LEFT(state) > 0
+       && HAVE_NEXTHOP_STATE(state)
        && (session = smtp_reuse_nexthop(state, SMTP_KEY_MASK_SCACHE_DEST_LABEL)) != 0) {
        session_count = 1;
        smtp_update_addr_list(addr_list, STR(iter->addr), session_count);

Completely untested. It's probably better to go with 2.11.1 directly, or
even the last 2.11.x on the series.

-- 
You received this bug notification because you are a member of Ubuntu
Server, which is subscribed to the bug report.
https://bugs.launchpad.net/bugs/1549388

Title:
  In some rare cases Postfix connect to a wrong MX server

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/postfix/+bug/1549388/+subscriptions



More information about the Ubuntu-server-bugs mailing list