summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2018-12-01 16:55:26 +0000
committerJeremy Harris <jgh146exb@wizmail.org>2018-12-02 00:15:42 +0000
commit67ea939cf0873497e9b8aaa8e21163621cc869df (patch)
tree2b9d691a92d23f513ed2b7c48bddfeff1a9e9b7f
parentb72f857fb5b9bfe800daf6d08da85f4bff81ce1d (diff)
Logging: outgoing_port on temporary errors for non-last hosts
Also show nonstandard ports in process info for exiwhat
-rw-r--r--src/src/transports/smtp.c17
-rwxr-xr-xtest/runtest4
-rw-r--r--test/stderr/03888
-rw-r--r--test/stderr/04768
4 files changed, 23 insertions, 14 deletions
diff --git a/src/src/transports/smtp.c b/src/src/transports/smtp.c
index 1e4cd2cc9..eb596dfe6 100644
--- a/src/src/transports/smtp.c
+++ b/src/src/transports/smtp.c
@@ -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
@@ -5008,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
@@ -5149,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 */
diff --git a/test/runtest b/test/runtest
index 2392752e4..71f002cf5 100755
--- a/test/runtest
+++ b/test/runtest
@@ -479,6 +479,10 @@ RESET_AFTER_EXTRA_LINE_READ:
# port numbers in dumpdb output
s/T:([a-z.]+(:[0-9.]+)?):$parm_port_n /T:$1:PORT_N /;
+ # port numbers in stderr
+ s/^set_process_info: .*\]:\K$parm_port_d /PORT_D /;
+ s/^set_process_info: .*\]:\K$parm_port_s /PORT_S /;
+
# ======== Dates and times ========
diff --git a/test/stderr/0388 b/test/stderr/0388
index f15cab20c..cab89cedf 100644
--- a/test/stderr/0388
+++ b/test/stderr/0388
@@ -80,7 +80,7 @@ checking status of 127.0.0.1
failed to open DB file TESTSUITE/spool/db/retry: No such file or directory
no retry data available
127.0.0.1 in serialize_hosts? no (option unset)
-set_process_info: pppp delivering 10HmaX-0005vi-00 to 127.0.0.1 [127.0.0.1] (x@y)
+set_process_info: pppp delivering 10HmaX-0005vi-00 to 127.0.0.1 [127.0.0.1]:PORT_S (x@y)
Connecting to 127.0.0.1 [127.0.0.1]:1224 ... connected
SMTP<< 220 Server ready
127.0.0.1 in hosts_avoid_esmtp? no (option unset)
@@ -100,7 +100,7 @@ added retry item for R:x@y: errno=-44 more_errno=dd,A flags=0
SMTP>> QUIT
cmd buf flush ddd bytes
SMTP(close)>>
-set_process_info: pppp delivering 10HmaX-0005vi-00: just tried 127.0.0.1 [127.0.0.1] for x@y: result OK
+set_process_info: pppp delivering 10HmaX-0005vi-00: just tried 127.0.0.1 [127.0.0.1]:PORT_S for x@y: result OK
address match test: subject=*@127.0.0.1 pattern=*
127.0.0.1 in "*"? yes (matched "*")
*@127.0.0.1 in "*"? yes (matched "*")
@@ -113,11 +113,11 @@ checking status of V4NET.0.0.0
failed to open DB file TESTSUITE/spool/db/retry: No such file or directory
no retry data available
V4NET.0.0.0 in serialize_hosts? no (option unset)
-set_process_info: pppp delivering 10HmaX-0005vi-00 to V4NET.0.0.0 [V4NET.0.0.0] (x@y)
+set_process_info: pppp delivering 10HmaX-0005vi-00 to V4NET.0.0.0 [V4NET.0.0.0]:PORT_S (x@y)
Connecting to V4NET.0.0.0 [V4NET.0.0.0]:1224 ... failed: Network Error
LOG: MAIN
H=V4NET.0.0.0 [V4NET.0.0.0] Network Error
-set_process_info: pppp delivering 10HmaX-0005vi-00: just tried V4NET.0.0.0 [V4NET.0.0.0] for x@y: result DEFER
+set_process_info: pppp delivering 10HmaX-0005vi-00: just tried V4NET.0.0.0 [V4NET.0.0.0]:PORT_S for x@y: result DEFER
added retry item for T:V4NET.0.0.0:V4NET.0.0.0:1224: errno=dd more_errno=dd,A flags=2
set_process_info: pppp delivering 10HmaX-0005vi-00 (just run smtp for x@y in subprocess)
search_tidyup called
diff --git a/test/stderr/0476 b/test/stderr/0476
index 5565bbd7e..5ebfd1081 100644
--- a/test/stderr/0476
+++ b/test/stderr/0476
@@ -17,7 +17,7 @@ hostlist:
checking status of 127.0.0.1
127.0.0.1 [127.0.0.1]:1111 retry-status = usable
delivering 10HmaX-0005vi-00 to 127.0.0.1 [127.0.0.1] (userx@test.ex)
-set_process_info: pppp delivering 10HmaX-0005vi-00 to 127.0.0.1 [127.0.0.1] (userx@test.ex)
+set_process_info: pppp delivering 10HmaX-0005vi-00 to 127.0.0.1 [127.0.0.1]:PORT_S (userx@test.ex)
Connecting to 127.0.0.1 [127.0.0.1]:1224 ... connected
SMTP<< 220 Server ready
SMTP>> EHLO the.local.host.name
@@ -47,7 +47,7 @@ cmd buf flush ddd bytes
SMTP(closed)<<
H=127.0.0.1 [127.0.0.1] Remote host closed connection in response to RSET
SMTP(close)>>
-set_process_info: pppp delivering 10HmaX-0005vi-00: just tried 127.0.0.1 [127.0.0.1] for userx@test.ex: result OK
+set_process_info: pppp delivering 10HmaX-0005vi-00: just tried 127.0.0.1 [127.0.0.1]:PORT_S for userx@test.ex: result OK
Leaving t1 transport
set_process_info: pppp delivering 10HmaX-0005vi-00 (just run t1 for userx@test.ex in subprocess)
set_process_info: pppp delivering 10HmaX-0005vi-00: waiting for a remote delivery subprocess to finish
@@ -80,11 +80,11 @@ hostlist:
checking status of 127.0.0.1
127.0.0.1 [127.0.0.1]:1111 retry-status = usable
delivering 10HmaZ-0005vi-00 to 127.0.0.1 [127.0.0.1] (CALLER@the.local.host.name)
-set_process_info: pppp delivering 10HmaZ-0005vi-00 to 127.0.0.1 [127.0.0.1] (CALLER@the.local.host.name)
+set_process_info: pppp delivering 10HmaZ-0005vi-00 to 127.0.0.1 [127.0.0.1]:PORT_S (CALLER@the.local.host.name)
Connecting to 127.0.0.1 [127.0.0.1]:1224 ... failed: Connection refused
LOG: MAIN
H=127.0.0.1 [127.0.0.1] Connection refused
-set_process_info: pppp delivering 10HmaZ-0005vi-00: just tried 127.0.0.1 [127.0.0.1] for CALLER@the.local.host.name: result DEFER
+set_process_info: pppp delivering 10HmaZ-0005vi-00: just tried 127.0.0.1 [127.0.0.1]:PORT_S for CALLER@the.local.host.name: result DEFER
added retry item for T:127.0.0.1:127.0.0.1:1224: errno=dd more_errno=dd,A flags=2
set_process_info: pppp delivering 10HmaZ-0005vi-00: waiting for a remote delivery subprocess to finish
all IP addresses skipped or deferred at least one address