Logging: avoid claiming a host was used for an addr, when conn refused under TFO
[exim.git] / src / src / transports / smtp.c
index aed80cae9ca49de05d36dea7f19de8d9681b2eed..6ce4c9ded56fbda4efaa6830e36d50626a90d4a1 100644 (file)
@@ -590,6 +590,10 @@ switch(*errno_value)
        transport_count);
     return FALSE;
 
+  case ECONNREFUSED:           /* First-read error on a TFO conn */
+    if (verify_mode) *message = US strerror(*errno_value);
+    return FALSE;              /* nonverify, do not set message */
+
   case ERRNO_SMTPFORMAT:       /* Handle malformed SMTP response */
     s = string_printing(buffer);
     while (isspace(*s)) s++;
@@ -2897,7 +2901,8 @@ FAILED:
                        || errno == ERRNO_UTF8_FWD
 #endif
            ? FAIL : DEFER,
-           pass_message, sx->conn_args.host
+           pass_message,
+           errno == ECONNREFUSED ? NULL : sx->conn_args.host
 #ifdef EXPERIMENTAL_DSN_INFO
            , sx->smtp_greeting, sx->helo_response
 #endif