From 4311097ecf0db28101920522340c59469582529e Mon Sep 17 00:00:00 2001 From: Philip Hazel Date: Thu, 8 Feb 2007 15:16:19 +0000 Subject: [PATCH] Fix bad outgoing_port in log line for delivery of a re-used connection. --- doc/doc-txt/ChangeLog | 6 +++++- src/src/transports/smtp.c | 6 ++++-- test/confs/0033 | 1 - test/confs/0179 | 1 + test/log/0179 | 4 ++-- test/runtest | 6 +++--- 6 files changed, 15 insertions(+), 9 deletions(-) diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog index e7e25828f..deee9b35d 100644 --- a/doc/doc-txt/ChangeLog +++ b/doc/doc-txt/ChangeLog @@ -1,4 +1,4 @@ -$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.476 2007/02/07 14:41:13 ph10 Exp $ +$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.477 2007/02/08 15:16:19 ph10 Exp $ Change log file for Exim from version 4.21 ------------------------------------------- @@ -97,6 +97,10 @@ PH/22 Applied Jori Hamalainen's speed-up changes and typo fixes to exigrep, PH/23 Applied sieve patches from the maintainer "tracking the latest notify draft, changing the syntax and factoring some duplicate code". +PH/24 When the log selector "outgoing_port" was set, the port was shown as -1 + for deliveries of the second and subsequent messages over the same SMTP + connection. + Exim version 4.66 ----------------- diff --git a/src/src/transports/smtp.c b/src/src/transports/smtp.c index 509ff1949..2fce7bab2 100644 --- a/src/src/transports/smtp.c +++ b/src/src/transports/smtp.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/transports/smtp.c,v 1.35 2007/02/06 14:49:13 ph10 Exp $ */ +/* $Cambridge: exim/src/src/transports/smtp.c,v 1.36 2007/02/08 15:16:19 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -917,7 +917,8 @@ if (continue_hostname == NULL) { inblock.sock = outblock.sock = smtp_connect(host, host_af, port, interface, ob->connect_timeout, - ob->keepalive); + ob->keepalive); /* This puts port into host->port */ + if (inblock.sock < 0) { set_errno(addrlist, (errno == ETIMEDOUT)? ERRNO_CONNECTTIMEOUT : errno, @@ -1041,6 +1042,7 @@ else { inblock.sock = outblock.sock = fileno(stdin); smtp_command = big_buffer; + host->port = port; /* Record the port that was used */ } /* If TLS is available on this connection, whether continued or not, attempt to diff --git a/test/confs/0033 b/test/confs/0033 index e8e995044..6b455fa8a 100644 --- a/test/confs/0033 +++ b/test/confs/0033 @@ -13,7 +13,6 @@ gecos_name = CALLER_NAME domainlist local_domains = test.ex : *.test.ex - # ----- Routers ----- begin routers diff --git a/test/confs/0179 b/test/confs/0179 index 1d46531c3..0aee0c056 100644 --- a/test/confs/0179 +++ b/test/confs/0179 @@ -12,6 +12,7 @@ gecos_name = CALLER_NAME # ----- Main settings ----- queue_run_in_order +log_selector = +outgoing_port # ----- Routers ----- diff --git a/test/log/0179 b/test/log/0179 index 164a8febd..c4d302a4a 100644 --- a/test/log/0179 +++ b/test/log/0179 @@ -1,8 +1,8 @@ 1999-03-02 09:44:33 10HmaX-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss 1999-03-02 09:44:33 10HmaY-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss 1999-03-02 09:44:33 Start queue run: pid=pppp -qqf -1999-03-02 09:44:33 10HmaX-0005vi-00 => userx@domain.com R=all T=smtp H=127.0.0.1 [127.0.0.1] +1999-03-02 09:44:33 10HmaX-0005vi-00 => userx@domain.com R=all T=smtp H=127.0.0.1 [127.0.0.1]:1224 1999-03-02 09:44:33 10HmaX-0005vi-00 Completed -1999-03-02 09:44:33 10HmaY-0005vi-00 => abcd@domain.com R=all T=smtp H=127.0.0.1 [127.0.0.1]* +1999-03-02 09:44:33 10HmaY-0005vi-00 => abcd@domain.com R=all T=smtp H=127.0.0.1 [127.0.0.1]:1224* 1999-03-02 09:44:33 10HmaY-0005vi-00 Completed 1999-03-02 09:44:33 End queue run: pid=pppp -qqf diff --git a/test/runtest b/test/runtest index 328b89958..4e511dc36 100755 --- a/test/runtest +++ b/test/runtest @@ -1,6 +1,6 @@ #! /usr/bin/perl -w -# $Cambridge: exim/test/runtest,v 1.23 2007/01/31 16:52:12 ph10 Exp $ +# $Cambridge: exim/test/runtest,v 1.24 2007/02/08 15:16:19 ph10 Exp $ ############################################################################### # This is the controlling script for the "new" test suite for Exim. It should # @@ -521,8 +521,8 @@ while() s/\(port=(\d+)/"(port=" . new_value($1, "%s", \$next_port)/e; # This handles "connection from" and the like, when the port is given - if (!/listening for SMTP on/ && !/Connecting to/ && !/=>/ && !/\*>/ && - !/Connection refused/) + if (!/listening for SMTP on/ && !/Connecting to/ && !/=>/ && !/->/ + && !/\*>/ && !/Connection refused/) { s/\[([a-z\d:]+|\d+(?:\.\d+){3})\]:(\d+)/"[".$1."]:".new_value($2,"%s",\$next_port)/ie; } -- 2.30.2