From 2a47f02825993e5ade191f8206cb767b0d9fc44c Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Tue, 25 Dec 2012 22:16:29 +0000 Subject: Restrict lifetime of $router_name and $transport_name. Bug 308. The router name is explicitly nulled after the router exits; the transport name is set only in the subprocess it runs in. --- test/confs/0143 | 3 ++- test/confs/0227 | 8 +------- test/confs/0410 | 2 -- test/log/0227 | 25 +++++++++---------------- test/rejectlog/0227 | 18 +++++++++--------- test/stderr/0143 | 3 ++- test/stderr/0227 | 32 +++++++++----------------------- 7 files changed, 32 insertions(+), 59 deletions(-) (limited to 'test') diff --git a/test/confs/0143 b/test/confs/0143 index 08eb3f66a..ad18789c9 100644 --- a/test/confs/0143 +++ b/test/confs/0143 @@ -24,6 +24,7 @@ my_main_router: route_list = * 127.0.0.1 self = send transport = my_smtp + debug_print = router_name <$router_name> no_more @@ -35,7 +36,7 @@ my_smtp: driver = smtp interface = HOSTIPV4 port = PORT_S - debug_print = transport_name <$transport_name> from router <$router_name> + debug_print = transport_name <$transport_name> # End diff --git a/test/confs/0227 b/test/confs/0227 index 2f2178185..06fae3f56 100644 --- a/test/confs/0227 +++ b/test/confs/0227 @@ -26,25 +26,19 @@ check_recipient: control = no_multiline_responses accept hosts = V4NET.0.0.4 deny hosts = V4NET.0.0.1 - log_message = ($sender_verify_failure) R:$router_name !verify = sender/callout=no_cache deny hosts = V4NET.0.0.3 - log_message = ($recipient_verify_failure) R:$router_name !verify = recipient/callout=no_cache - warn logwrite = verify recipient used R:$router_name deny hosts = V4NET.0.0.5 - log_message = ($sender_verify_failure) R:$router_name !verify = sender/callout=no_cache/check_postmaster require verify = sender - logwrite = verify sender used R:$router_name accept domains = +local_domains deny message = relay not permitted check_data: deny hosts = V4NET.0.0.4 - log_message = header_sender R:$router_name !verify = header_sender/callout=no_cache - accept logwrite = verify header_sender used R:$router_name + accept # ----- Routers ----- diff --git a/test/confs/0410 b/test/confs/0410 index 934d8a1e8..b8da514f4 100644 --- a/test/confs/0410 +++ b/test/confs/0410 @@ -22,9 +22,7 @@ begin ACL rcpt: accept verify = recipient - logwrite = rcpt R:$router_name verify = sender - logwrite = sndr R:$router_name condition = ${if eq {$address_data}{ADDRESS_DATA_STRING}{yes}{no}} condition = ${if eq {$sender_address_data}{SENDER_ADDRESS_DATA_STRING}{yes}{no}} diff --git a/test/log/0227 b/test/log/0227 index 00d940b51..ca551b3c7 100644 --- a/test/log/0227 +++ b/test/log/0227 @@ -1,27 +1,20 @@ -1999-03-02 09:44:33 verify recipient used R:all -1999-03-02 09:44:33 verify sender used R:all -1999-03-02 09:44:33 verify recipient used R: -1999-03-02 09:44:33 verify sender used R:all 1999-03-02 09:44:33 H=[V4NET.0.0.1] U=root sender verify fail for : response to "RCPT TO:" from 127.0.0.1 [127.0.0.1] was: 550 Unknown user -1999-03-02 09:44:33 H=[V4NET.0.0.1] U=root F= rejected RCPT : (recipient) R:all: Sender verify failed +1999-03-02 09:44:33 H=[V4NET.0.0.1] U=root F= rejected RCPT : Sender verify failed 1999-03-02 09:44:33 H=[V4NET.0.0.1] U=root sender verify defer for : response to "RCPT TO:" from 127.0.0.1 [127.0.0.1] was: 450 Temporary error 1999-03-02 09:44:33 H=[V4NET.0.0.1] U=root F= temporarily rejected RCPT : Could not complete sender verify callout 1999-03-02 09:44:33 H=[V4NET.0.0.1] U=root sender verify fail for : response to "MAIL FROM:<>" from 127.0.0.1 [127.0.0.1] was: 550 Error for <> -1999-03-02 09:44:33 H=[V4NET.0.0.1] U=root F= rejected RCPT : (mail) R:localhost1: Sender verify failed +1999-03-02 09:44:33 H=[V4NET.0.0.1] U=root F= rejected RCPT : Sender verify failed 1999-03-02 09:44:33 H=[V4NET.0.0.1] U=root sender verify fail for : response to "MAIL FROM:<>" from 127.0.0.1 [127.0.0.1] was: 550-Multiline error for <>\n550 Here's the second line -1999-03-02 09:44:33 H=[V4NET.0.0.1] U=root F= rejected RCPT : (mail) R:localhost1: Sender verify failed -1999-03-02 09:44:33 H=[V4NET.0.0.3] U=root F= rejected RCPT : (recipient) R:all: response to "RCPT TO:" from 127.0.0.1 [127.0.0.1] was: 550 Recipient not liked -1999-03-02 09:44:33 H=[V4NET.0.0.3] U=root F= rejected RCPT : (recipient) R:all: response to "RCPT TO:" from 127.0.0.1 [127.0.0.1] was: 550-Recipient not liked on two lines\n550 Here's the second +1999-03-02 09:44:33 H=[V4NET.0.0.1] U=root F= rejected RCPT : Sender verify failed +1999-03-02 09:44:33 H=[V4NET.0.0.3] U=root F= rejected RCPT : response to "RCPT TO:" from 127.0.0.1 [127.0.0.1] was: 550 Recipient not liked +1999-03-02 09:44:33 H=[V4NET.0.0.3] U=root F= rejected RCPT : response to "RCPT TO:" from 127.0.0.1 [127.0.0.1] was: 550-Recipient not liked on two lines\n550 Here's the second 1999-03-02 09:44:33 H=[V4NET.0.0.3] U=root F= temporarily rejected RCPT : Could not complete recipient verify callout -1999-03-02 09:44:33 10HmaX-0005vi-00 H=[V4NET.0.0.4] U=root F= rejected after DATA: header_sender R:all: there is no valid sender in any header line -1999-03-02 09:44:33 10HmaY-0005vi-00 H=[V4NET.0.0.4] U=root F= rejected after DATA: header_sender R:all: there is no valid sender in any header line -1999-03-02 09:44:33 verify recipient used R: -1999-03-02 09:44:33 verify sender used R:localhost1 +1999-03-02 09:44:33 10HmaX-0005vi-00 H=[V4NET.0.0.4] U=root F= rejected after DATA: there is no valid sender in any header line +1999-03-02 09:44:33 10HmaY-0005vi-00 H=[V4NET.0.0.4] U=root F= rejected after DATA: there is no valid sender in any header line 1999-03-02 09:44:33 H=[V4NET.0.0.5] U=root F= rejected RCPT : relay not permitted -1999-03-02 09:44:33 verify recipient used R: 1999-03-02 09:44:33 H=[V4NET.0.0.5] U=root sender verify fail for : response to "RCPT TO:" from 127.0.0.1 [127.0.0.1] was: 550 Don't like postmaster -1999-03-02 09:44:33 H=[V4NET.0.0.5] U=root F= rejected RCPT : (postmaster) R:localhost1: Sender verify failed -1999-03-02 09:44:33 H=[V4NET.0.0.3] U=root F= rejected RCPT : (recipient) R:lmtp: response to "RCPT TO:" from 127.0.0.1 [127.0.0.1] was: 550 Recipient not liked +1999-03-02 09:44:33 H=[V4NET.0.0.5] U=root F= rejected RCPT : Sender verify failed +1999-03-02 09:44:33 H=[V4NET.0.0.3] U=root F= rejected RCPT : response to "RCPT TO:" from 127.0.0.1 [127.0.0.1] was: 550 Recipient not liked 1999-03-02 09:44:33 H=[V4NET.0.0.1] U=root sender verify defer for : response to "initial connection" from 127.0.0.1 [127.0.0.1] was: connection dropped 1999-03-02 09:44:33 H=[V4NET.0.0.1] U=root F= temporarily rejected RCPT : Could not complete sender verify callout 1999-03-02 09:44:33 H=[V4NET.0.0.1] U=root sender verify defer for : could not connect to 127.0.0.1 [127.0.0.1]: Connection refused diff --git a/test/rejectlog/0227 b/test/rejectlog/0227 index f62256992..8b2a2a148 100644 --- a/test/rejectlog/0227 +++ b/test/rejectlog/0227 @@ -1,15 +1,15 @@ 1999-03-02 09:44:33 H=[V4NET.0.0.1] U=root sender verify fail for : response to "RCPT TO:" from 127.0.0.1 [127.0.0.1] was: 550 Unknown user -1999-03-02 09:44:33 H=[V4NET.0.0.1] U=root F= rejected RCPT : (recipient) R:all: Sender verify failed +1999-03-02 09:44:33 H=[V4NET.0.0.1] U=root F= rejected RCPT : Sender verify failed 1999-03-02 09:44:33 H=[V4NET.0.0.1] U=root sender verify defer for : response to "RCPT TO:" from 127.0.0.1 [127.0.0.1] was: 450 Temporary error 1999-03-02 09:44:33 H=[V4NET.0.0.1] U=root F= temporarily rejected RCPT : Could not complete sender verify callout 1999-03-02 09:44:33 H=[V4NET.0.0.1] U=root sender verify fail for : response to "MAIL FROM:<>" from 127.0.0.1 [127.0.0.1] was: 550 Error for <> -1999-03-02 09:44:33 H=[V4NET.0.0.1] U=root F= rejected RCPT : (mail) R:localhost1: Sender verify failed +1999-03-02 09:44:33 H=[V4NET.0.0.1] U=root F= rejected RCPT : Sender verify failed 1999-03-02 09:44:33 H=[V4NET.0.0.1] U=root sender verify fail for : response to "MAIL FROM:<>" from 127.0.0.1 [127.0.0.1] was: 550-Multiline error for <>\n550 Here's the second line -1999-03-02 09:44:33 H=[V4NET.0.0.1] U=root F= rejected RCPT : (mail) R:localhost1: Sender verify failed -1999-03-02 09:44:33 H=[V4NET.0.0.3] U=root F= rejected RCPT : (recipient) R:all: response to "RCPT TO:" from 127.0.0.1 [127.0.0.1] was: 550 Recipient not liked -1999-03-02 09:44:33 H=[V4NET.0.0.3] U=root F= rejected RCPT : (recipient) R:all: response to "RCPT TO:" from 127.0.0.1 [127.0.0.1] was: 550-Recipient not liked on two lines\n550 Here's the second +1999-03-02 09:44:33 H=[V4NET.0.0.1] U=root F= rejected RCPT : Sender verify failed +1999-03-02 09:44:33 H=[V4NET.0.0.3] U=root F= rejected RCPT : response to "RCPT TO:" from 127.0.0.1 [127.0.0.1] was: 550 Recipient not liked +1999-03-02 09:44:33 H=[V4NET.0.0.3] U=root F= rejected RCPT : response to "RCPT TO:" from 127.0.0.1 [127.0.0.1] was: 550-Recipient not liked on two lines\n550 Here's the second 1999-03-02 09:44:33 H=[V4NET.0.0.3] U=root F= temporarily rejected RCPT : Could not complete recipient verify callout -1999-03-02 09:44:33 10HmaX-0005vi-00 H=[V4NET.0.0.4] U=root F= rejected after DATA: header_sender R:all: there is no valid sender in any header line +1999-03-02 09:44:33 10HmaX-0005vi-00 H=[V4NET.0.0.4] U=root F= rejected after DATA: there is no valid sender in any header line Envelope-from: Envelope-to: P Received: from [V4NET.0.0.4] (ident=root) @@ -18,7 +18,7 @@ P Received: from [V4NET.0.0.4] (ident=root) id 10HmaX-0005vi-00 for z@remote.domain; Tue, 2 Mar 1999 09:44:33 +0000 F From: abcd@x.y.z -1999-03-02 09:44:33 10HmaY-0005vi-00 H=[V4NET.0.0.4] U=root F= rejected after DATA: header_sender R:all: there is no valid sender in any header line +1999-03-02 09:44:33 10HmaY-0005vi-00 H=[V4NET.0.0.4] U=root F= rejected after DATA: there is no valid sender in any header line Envelope-from: Envelope-to: P Received: from [V4NET.0.0.4] (ident=root) @@ -29,8 +29,8 @@ P Received: from [V4NET.0.0.4] (ident=root) F From: abcd@x.y.z 1999-03-02 09:44:33 H=[V4NET.0.0.5] U=root F= rejected RCPT : relay not permitted 1999-03-02 09:44:33 H=[V4NET.0.0.5] U=root sender verify fail for : response to "RCPT TO:" from 127.0.0.1 [127.0.0.1] was: 550 Don't like postmaster -1999-03-02 09:44:33 H=[V4NET.0.0.5] U=root F= rejected RCPT : (postmaster) R:localhost1: Sender verify failed -1999-03-02 09:44:33 H=[V4NET.0.0.3] U=root F= rejected RCPT : (recipient) R:lmtp: response to "RCPT TO:" from 127.0.0.1 [127.0.0.1] was: 550 Recipient not liked +1999-03-02 09:44:33 H=[V4NET.0.0.5] U=root F= rejected RCPT : Sender verify failed +1999-03-02 09:44:33 H=[V4NET.0.0.3] U=root F= rejected RCPT : response to "RCPT TO:" from 127.0.0.1 [127.0.0.1] was: 550 Recipient not liked 1999-03-02 09:44:33 H=[V4NET.0.0.1] U=root sender verify defer for : response to "initial connection" from 127.0.0.1 [127.0.0.1] was: connection dropped 1999-03-02 09:44:33 H=[V4NET.0.0.1] U=root F= temporarily rejected RCPT : Could not complete sender verify callout 1999-03-02 09:44:33 H=[V4NET.0.0.1] U=root sender verify defer for : could not connect to 127.0.0.1 [127.0.0.1]: Connection refused diff --git a/test/stderr/0143 b/test/stderr/0143 index bcf7ecc82..80d1ed320 100644 --- a/test/stderr/0143 +++ b/test/stderr/0143 @@ -8,9 +8,10 @@ Exim version x.yz .... configuration file is TESTSUITE/test-config trusted user admin user +router_name >>>>>>>>>>>>>>>> Remote deliveries >>>>>>>>>>>>>>>> --------> userx@domain.com <-------- -transport_name from router +transport_name my_smtp transport entered userx@domain.com checking status of 127.0.0.1 diff --git a/test/stderr/0227 b/test/stderr/0227 index 2530d7cd7..7a75ec015 100644 --- a/test/stderr/0227 +++ b/test/stderr/0227 @@ -9,18 +9,10 @@ Connecting to 127.0.0.1 [127.0.0.1]:1224 ... connected SMTP>> RCPT TO: SMTP<< 250 OK SMTP>> QUIT -LOG: MAIN - verify recipient used R:all -LOG: MAIN - verify sender used R:all LOG: smtp_connection MAIN SMTP connection from root closed by QUIT LOG: smtp_connection MAIN SMTP connection from root -LOG: MAIN - verify recipient used R: -LOG: MAIN - verify sender used R:all LOG: smtp_connection MAIN SMTP connection from root closed by QUIT LOG: smtp_connection MAIN @@ -37,7 +29,7 @@ Connecting to 127.0.0.1 [127.0.0.1]:1224 ... connected LOG: MAIN REJECT H=[V4NET.0.0.1] U=root sender verify fail for : response to "RCPT TO:" from 127.0.0.1 [127.0.0.1] was: 550 Unknown user LOG: MAIN REJECT - H=[V4NET.0.0.1] U=root F= rejected RCPT : (recipient) R:all: Sender verify failed + H=[V4NET.0.0.1] U=root F= rejected RCPT : Sender verify failed LOG: smtp_connection MAIN SMTP connection from root closed by QUIT LOG: smtp_connection MAIN @@ -69,7 +61,7 @@ Connecting to 127.0.0.1 [127.0.0.1]:1224 ... connected LOG: MAIN REJECT H=[V4NET.0.0.1] U=root sender verify fail for : response to "MAIL FROM:<>" from 127.0.0.1 [127.0.0.1] was: 550 Error for <> LOG: MAIN REJECT - H=[V4NET.0.0.1] U=root F= rejected RCPT : (mail) R:localhost1: Sender verify failed + H=[V4NET.0.0.1] U=root F= rejected RCPT : Sender verify failed LOG: smtp_connection MAIN SMTP connection from root closed by QUIT LOG: smtp_connection MAIN @@ -85,7 +77,7 @@ Connecting to 127.0.0.1 [127.0.0.1]:1224 ... connected LOG: MAIN REJECT H=[V4NET.0.0.1] U=root sender verify fail for : response to "MAIL FROM:<>" from 127.0.0.1 [127.0.0.1] was: 550-Multiline error for <>\n550 Here's the second line LOG: MAIN REJECT - H=[V4NET.0.0.1] U=root F= rejected RCPT : (mail) R:localhost1: Sender verify failed + H=[V4NET.0.0.1] U=root F= rejected RCPT : Sender verify failed LOG: smtp_connection MAIN SMTP connection from root closed by QUIT LOG: smtp_connection MAIN @@ -100,7 +92,7 @@ Connecting to 127.0.0.1 [127.0.0.1]:1224 ... connected SMTP<< 550 Recipient not liked SMTP>> QUIT LOG: MAIN REJECT - H=[V4NET.0.0.3] U=root F= rejected RCPT : (recipient) R:all: response to "RCPT TO:" from 127.0.0.1 [127.0.0.1] was: 550 Recipient not liked + H=[V4NET.0.0.3] U=root F= rejected RCPT : response to "RCPT TO:" from 127.0.0.1 [127.0.0.1] was: 550 Recipient not liked LOG: smtp_connection MAIN SMTP connection from root closed by QUIT LOG: smtp_connection MAIN @@ -116,7 +108,7 @@ Connecting to 127.0.0.1 [127.0.0.1]:1224 ... connected 550 Here's the second SMTP>> QUIT LOG: MAIN REJECT - H=[V4NET.0.0.3] U=root F= rejected RCPT : (recipient) R:all: response to "RCPT TO:" from 127.0.0.1 [127.0.0.1] was: 550-Recipient not liked on two lines\n550 Here's the second + H=[V4NET.0.0.3] U=root F= rejected RCPT : response to "RCPT TO:" from 127.0.0.1 [127.0.0.1] was: 550-Recipient not liked on two lines\n550 Here's the second LOG: smtp_connection MAIN SMTP connection from root closed by QUIT LOG: smtp_connection MAIN @@ -139,7 +131,7 @@ Connecting to 127.0.0.1 [127.0.0.1]:1224 ... connected SMTP<< 550 Not liked SMTP>> QUIT LOG: MAIN REJECT - H=[V4NET.0.0.4] U=root F= rejected after DATA: header_sender R:all: there is no valid sender in any header line + H=[V4NET.0.0.4] U=root F= rejected after DATA: there is no valid sender in any header line LOG: smtp_connection MAIN SMTP connection from root closed by QUIT LOG: smtp_connection MAIN @@ -154,13 +146,11 @@ Connecting to 127.0.0.1 [127.0.0.1]:1224 ... connected SMTP<< 550 Not liked SMTP>> QUIT LOG: MAIN REJECT - H=[V4NET.0.0.4] U=root F= rejected after DATA: header_sender R:all: there is no valid sender in any header line + H=[V4NET.0.0.4] U=root F= rejected after DATA: there is no valid sender in any header line LOG: smtp_connection MAIN SMTP connection from root closed by QUIT LOG: smtp_connection MAIN SMTP connection from root -LOG: MAIN - verify recipient used R: Connecting to 127.0.0.1 [127.0.0.1]:1224 ... connected SMTP<< 220 Server ready SMTP>> EHLO myhost.test.ex @@ -177,16 +167,12 @@ Cutthrough cancelled by presence of postmaster verify SMTP>> RCPT TO: SMTP<< 250 OK SMTP>> QUIT -LOG: MAIN - verify sender used R:localhost1 LOG: MAIN REJECT H=[V4NET.0.0.5] U=root F= rejected RCPT : relay not permitted LOG: smtp_connection MAIN SMTP connection from root closed by QUIT LOG: smtp_connection MAIN SMTP connection from root -LOG: MAIN - verify recipient used R: Connecting to 127.0.0.1 [127.0.0.1]:1224 ... connected SMTP<< 220 Server ready SMTP>> EHLO myhost.test.ex @@ -206,7 +192,7 @@ Cutthrough cancelled by presence of postmaster verify LOG: MAIN REJECT H=[V4NET.0.0.5] U=root sender verify fail for : response to "RCPT TO:" from 127.0.0.1 [127.0.0.1] was: 550 Don't like postmaster LOG: MAIN REJECT - H=[V4NET.0.0.5] U=root F= rejected RCPT : (postmaster) R:localhost1: Sender verify failed + H=[V4NET.0.0.5] U=root F= rejected RCPT : Sender verify failed LOG: smtp_connection MAIN SMTP connection from root closed by QUIT LOG: smtp_connection MAIN @@ -221,7 +207,7 @@ Connecting to 127.0.0.1 [127.0.0.1]:1224 ... connected SMTP<< 550 Recipient not liked SMTP>> QUIT LOG: MAIN REJECT - H=[V4NET.0.0.3] U=root F= rejected RCPT : (recipient) R:lmtp: response to "RCPT TO:" from 127.0.0.1 [127.0.0.1] was: 550 Recipient not liked + H=[V4NET.0.0.3] U=root F= rejected RCPT : response to "RCPT TO:" from 127.0.0.1 [127.0.0.1] was: 550 Recipient not liked LOG: smtp_connection MAIN SMTP connection from root closed by QUIT LOG: smtp_connection MAIN -- cgit v1.2.3