X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/ee8b809061baea861fc87c41bcb72a62d76b0047..06f37c802cbe477b2db358a0e76388d2df84691f:/src/src/transports/smtp.c diff --git a/src/src/transports/smtp.c b/src/src/transports/smtp.c index 576b7c546..96d694fcc 100644 --- a/src/src/transports/smtp.c +++ b/src/src/transports/smtp.c @@ -668,22 +668,22 @@ Returns: nothing static void write_logs(const host_item *host, const uschar *suffix, int basic_errno) { -uschar *message = LOGGING(outgoing_port) - ? string_sprintf("H=%s [%s]:%d", host->name, host->address, +gstring * message = LOGGING(outgoing_port) + ? string_fmt_append(NULL, "H=%s [%s]:%d", host->name, host->address, host->port == PORT_NONE ? 25 : host->port) - : string_sprintf("H=%s [%s]", host->name, host->address); + : string_fmt_append(NULL, "H=%s [%s]", host->name, host->address); if (suffix) { - message = string_sprintf("%s: %s", message, suffix); + message = string_fmt_append(message, ": %s", suffix); if (basic_errno > 0) - message = string_sprintf("%s: %s", message, strerror(basic_errno)); + message = string_fmt_append(message, ": %s", strerror(basic_errno)); } else - message = string_sprintf("%s %s", message, exim_errstr(basic_errno)); + message = string_fmt_append(message, " %s", exim_errstr(basic_errno)); -log_write(0, LOG_MAIN, "%s", message); -deliver_msglog("%s %s\n", tod_stamp(tod_log), message); +log_write(0, LOG_MAIN, "%s", string_from_gstring(message)); +deliver_msglog("%s %s\n", tod_stamp(tod_log), message->s); } static void @@ -1197,8 +1197,13 @@ while (count-- > 0) If not, log this last one in the == line. */ if (sx->conn_args.host->next) - log_write(0, LOG_MAIN, "H=%s [%s]: %s", - sx->conn_args.host->name, sx->conn_args.host->address, addr->message); + if (LOGGING(outgoing_port)) + log_write(0, LOG_MAIN, "H=%s [%s]:%d %s", sx->conn_args.host->name, + sx->conn_args.host->address, + sx->port == PORT_NONE ? 25 : sx->port, addr->message); + else + log_write(0, LOG_MAIN, "H=%s [%s]: %s", sx->conn_args.host->name, + sx->conn_args.host->address, addr->message); #ifndef DISABLE_EVENT else @@ -3449,9 +3454,7 @@ sx.conn_args.interface = interface; sx.helo_data = NULL; sx.conn_args.tblock = tblock; sx.verify = FALSE; -#ifdef EXPERIMENTAL_PIPE_CONNECT sx.sync_addr = sx.first_addr = addrlist; -#endif /* Get the channel set up ready for a message (MAIL FROM being the next SMTP command to send */ @@ -5010,8 +5013,8 @@ retry_non_continued: message_id, host->name, host->address, addrlist->address, addrlist->next ? ", ..." : ""); - set_process_info("delivering %s to %s [%s] (%s%s)", - message_id, host->name, host->address, addrlist->address, + set_process_info("delivering %s to %s [%s]%s (%s%s)", + message_id, host->name, host->address, pistring, addrlist->address, addrlist->next ? ", ..." : ""); /* This is not for real; don't do the delivery. If there are @@ -5151,8 +5154,8 @@ retry_non_continued: : rc == ERROR ? US"ERROR" : US"?"; - set_process_info("delivering %s: just tried %s [%s] for %s%s: result %s", - message_id, host->name, host->address, addrlist->address, + set_process_info("delivering %s: just tried %s [%s]%s for %s%s: result %s", + message_id, host->name, host->address, pistring, addrlist->address, addrlist->next ? " (& others)" : "", rs); /* Release serialization if set up */ @@ -5295,6 +5298,17 @@ retry_non_continued: "hosts_max_try (message older than host's retry time)\n"); } } + + DEBUG(D_transport) + { + if (unexpired_hosts_tried >= ob->hosts_max_try) + debug_printf("reached transport hosts_max_try limit %d\n", + ob->hosts_max_try); + if (total_hosts_tried >= ob->hosts_max_try_hardlimit) + debug_printf("reached transport hosts_max_try_hardlimit limit %d\n", + ob->hosts_max_try_hardlimit); + } + if (f.running_in_test_harness) millisleep(500); /* let server debug out */ } /* End of loop for trying multiple hosts. */