From ff5929e3b91747e2ecb600711d17a7d0e21749ad Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Sun, 4 Sep 2016 14:54:18 +0100 Subject: Cutthrough: option to reflect 4xx errors from target to initiator --- test/confs/5400 | 11 +- test/confs/5405 | 1 + test/log/5405 | 23 ++++ test/rejectlog/5405 | 2 + test/scripts/5400-cutthrough/5405 | 228 +++++++++++++++++++++++++++++++ test/stdout/5405 | 280 ++++++++++++++++++++++++++++++++++++++ 6 files changed, 544 insertions(+), 1 deletion(-) create mode 120000 test/confs/5405 create mode 100644 test/log/5405 create mode 100644 test/rejectlog/5405 create mode 100644 test/scripts/5400-cutthrough/5405 create mode 100644 test/stdout/5405 (limited to 'test') diff --git a/test/confs/5400 b/test/confs/5400 index f87f985fd..9be13fea6 100644 --- a/test/confs/5400 +++ b/test/confs/5400 @@ -1,10 +1,17 @@ # Exim test configuration 5400 +# any options on the cutthrough_delivery contol +CONTROL= + +# optional verify-callout +OPT= + .include DIR/aux-var/std_conf_prefix primary_hostname = myhost.test.ex log_selector = +received_recipients +queue_only # ----- Main settings ----- @@ -18,7 +25,9 @@ acl_smtp_rcpt = ar begin acl ar: - accept control = cutthrough_delivery + accept + control = cutthrough_deliveryCONTROL + OPT logwrite = rcpt for $local_part@$domain # ----- Routers ----- diff --git a/test/confs/5405 b/test/confs/5405 new file mode 120000 index 000000000..8f6811b7e --- /dev/null +++ b/test/confs/5405 @@ -0,0 +1 @@ +5400 \ No newline at end of file diff --git a/test/log/5405 b/test/log/5405 new file mode 100644 index 000000000..ae3ad767d --- /dev/null +++ b/test/log/5405 @@ -0,0 +1,23 @@ +1999-03-02 09:44:33 rcpt for usera@domain.com +1999-03-02 09:44:33 10HmaX-0005vi-00 >> usera@domain.com R=all T=smtp H=127.0.0.1 [127.0.0.1] C="250 OK" +1999-03-02 09:44:33 10HmaX-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local-esmtp S=sss for usera@domain.com +1999-03-02 09:44:33 10HmaX-0005vi-00 Completed +1999-03-02 09:44:33 rcpt for userb@domain.com +1999-03-02 09:44:33 10HmaY-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local-esmtp S=sss for userb@domain.com +1999-03-02 09:44:33 rcpt for userc@domain.com +1999-03-02 09:44:33 10HmaZ-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local-esmtp S=sss for userc@domain.com +1999-03-02 09:44:33 rcpt for userd@domain.com +1999-03-02 09:44:33 U=CALLER F= temporarily rejected RCPT +1999-03-02 09:44:33 rcpt for usere@domain.com +1999-03-02 09:44:33 10HmbA-0005vi-00 U=CALLER usere@domain.com F= tmp-reject from cutthrough after DATA: R=all T=smtp H=127.0.0.1 [127.0.0.1] C="459 content reject" +1999-03-02 09:44:33 10HmbA-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local-esmtp S=sss for usere@domain.com +1999-03-02 09:44:33 rcpt for userf@domain.com +1999-03-02 09:44:33 10HmbB-0005vi-00 U=CALLER userf@domain.com F= tmp-reject from cutthrough after DATA: R=all T=smtp H=127.0.0.1 [127.0.0.1] C="459 content reject" +1999-03-02 09:44:33 10HmbB-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local-esmtp S=sss for userf@domain.com +1999-03-02 09:44:33 rcpt for userg@domain.com +1999-03-02 09:44:33 10HmbC-0005vi-00 U=CALLER userg@domain.com F= tmp-reject from cutthrough after DATA: R=all T=smtp H=127.0.0.1 [127.0.0.1] C="459 content reject" +1999-03-02 09:44:33 rcpt for userh@domain.com +1999-03-02 09:44:33 10HmbD-0005vi-00 >> userh@domain.com R=all T=smtp H=127.0.0.1 [127.0.0.1] C="250 OK" +1999-03-02 09:44:33 10HmbD-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local-esmtp S=sss for userh@domain.com +1999-03-02 09:44:33 10HmbD-0005vi-00 Completed +1999-03-02 09:44:33 U=CALLER F= temporarily rejected RCPT : response to "RCPT TO:" from 127.0.0.1 [127.0.0.1] was: 450 not right now diff --git a/test/rejectlog/5405 b/test/rejectlog/5405 new file mode 100644 index 000000000..7df2e1018 --- /dev/null +++ b/test/rejectlog/5405 @@ -0,0 +1,2 @@ +1999-03-02 09:44:33 U=CALLER F= temporarily rejected RCPT +1999-03-02 09:44:33 U=CALLER F= temporarily rejected RCPT : response to "RCPT TO:" from 127.0.0.1 [127.0.0.1] was: 450 not right now diff --git a/test/scripts/5400-cutthrough/5405 b/test/scripts/5400-cutthrough/5405 new file mode 100644 index 000000000..2e7a33388 --- /dev/null +++ b/test/scripts/5400-cutthrough/5405 @@ -0,0 +1,228 @@ +# cutthrough_delivery tmp-rejects +need_ipv4 +munge loopback +# +# basic operation. Should deliver in cutthrough mode. +server PORT_S +220 ESMTP +EHLO +250 OK +MAIL FROM: +250 Sender OK +RCPT TO: +250 Recipient OK +DATA +354 Send data +. +250 OK +QUIT +250 OK +**** +exim -bs +EHLO myhost.test.ex +MAIL FROM: +RCPT TO: +DATA + +. +QUIT +**** +###################################################### +# RCPT-time +# +# temp-reject (at RCPT), default. Should spool msg. +server PORT_S +220 ESMTP +EHLO +250 OK +MAIL FROM: +250 Sender OK +RCPT TO: +450 not right now +QUIT +250 OK +**** +exim -bs +EHLO myhost.test.ex +MAIL FROM: +RCPT TO: +DATA + +. +QUIT +**** +# +# temp-reject (at RCPT), option "spool". Should spool msg (again). +server PORT_S +220 ESMTP +EHLO +250 OK +MAIL FROM: +250 Sender OK +RCPT TO: +450 not right now +QUIT +250 OK +**** +exim -DCONTROL=/defer=spool -bs +EHLO myhost.test.ex +MAIL FROM: +RCPT TO: +DATA + +. +QUIT +**** +# +# temp-reject (at RCPT), option "pass". Should tmp-rej source, at RCPT. +server PORT_S +220 ESMTP +EHLO +250 OK +MAIL FROM: +250 Sender OK +RCPT TO: +450 not right now +QUIT +250 OK +**** +exim -DCONTROL=/defer=pass -bs +EHLO myhost.test.ex +MAIL FROM: +RCPT TO: +QUIT +**** +######################################################### +# DATA-time +# +# +# temp-reject (at DATA-dot), default. Should spool msg. +server PORT_S +220 ESMTP +EHLO +250 OK +MAIL FROM: +250 Sender OK +RCPT TO: +250 good rcpt +DATA +354 Send data +. +459 content reject +QUIT +250 OK +**** +exim -bs +EHLO myhost.test.ex +MAIL FROM: +RCPT TO: +DATA + +. +QUIT +**** +# +# temp-reject (at DATA-dot), option "spool". Should spool msg (again). +server PORT_S +220 ESMTP +EHLO +250 OK +MAIL FROM: +250 Sender OK +RCPT TO: +250 good rcpt +DATA +354 Send data +. +459 content reject +QUIT +250 OK +**** +exim -DCONTROL=/defer=spool -bs +EHLO myhost.test.ex +MAIL FROM: +RCPT TO: +DATA + +. +QUIT +**** +# +# temp-reject (at DATA-dot), option "pass". Should tmp-rej source, at DATA. +server PORT_S +220 ESMTP +EHLO +250 OK +MAIL FROM: +250 Sender OK +RCPT TO: +250 good rcpt +DATA +354 Send data +. +459 content reject +QUIT +250 OK +**** +exim -DCONTROL=/defer=pass -bs +EHLO myhost.test.ex +MAIL FROM: +RCPT TO: +DATA + +. +QUIT +**** +# +######################################################### +#, Now using a conn opened by a recipient verify +# +# basic operation. Should deliver in cutthrough mode. +server PORT_S +220 ESMTP +EHLO +250 OK +MAIL FROM: +250 Sender OK +RCPT TO: +250 Recipient OK +DATA +354 Send data +. +250 OK +QUIT +250 OK +**** +exim -DOPT=verify=recipient/callout=use_sender -bs +EHLO myhost.test.ex +MAIL FROM: +RCPT TO: +DATA + +. +QUIT +**** +# +# temp-reject (at RCPT), default. Should tmp-rej, due to the r-verify +server PORT_S +220 ESMTP +EHLO +250 OK +MAIL FROM: +250 Sender OK +RCPT TO: +450 not right now +QUIT +250 OK +**** +exim -DOPT=verify=recipient/callout=use_sender -bs +EHLO myhost.test.ex +MAIL FROM: +RCPT TO: +DATA + +. +QUIT +**** +# +no_msglog_check diff --git a/test/stdout/5405 b/test/stdout/5405 new file mode 100644 index 000000000..14bfdabdd --- /dev/null +++ b/test/stdout/5405 @@ -0,0 +1,280 @@ +220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000 +250-myhost.test.ex Hello CALLER at myhost.test.ex +250-SIZE 52428800 +250-8BITMIME +250-PIPELINING +250 HELP +250 OK +250 Accepted +354 Enter message, ending with "." on a line by itself +250 OK id=10HmaX-0005vi-00 +221 myhost.test.ex closing connection +220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000 +250-myhost.test.ex Hello CALLER at myhost.test.ex +250-SIZE 52428800 +250-8BITMIME +250-PIPELINING +250 HELP +250 OK +250 Accepted +354 Enter message, ending with "." on a line by itself +250 OK id=10HmaY-0005vi-00 +221 myhost.test.ex closing connection +220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000 +250-myhost.test.ex Hello CALLER at myhost.test.ex +250-SIZE 52428800 +250-8BITMIME +250-PIPELINING +250 HELP +250 OK +250 Accepted +354 Enter message, ending with "." on a line by itself +250 OK id=10HmaZ-0005vi-00 +221 myhost.test.ex closing connection +220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000 +250-myhost.test.ex Hello CALLER at myhost.test.ex +250-SIZE 52428800 +250-8BITMIME +250-PIPELINING +250 HELP +250 OK +450 not right now +221 myhost.test.ex closing connection +220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000 +250-myhost.test.ex Hello CALLER at myhost.test.ex +250-SIZE 52428800 +250-8BITMIME +250-PIPELINING +250 HELP +250 OK +250 Accepted +354 Enter message, ending with "." on a line by itself +250 OK id=10HmbA-0005vi-00 +221 myhost.test.ex closing connection +220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000 +250-myhost.test.ex Hello CALLER at myhost.test.ex +250-SIZE 52428800 +250-8BITMIME +250-PIPELINING +250 HELP +250 OK +250 Accepted +354 Enter message, ending with "." on a line by itself +250 OK id=10HmbB-0005vi-00 +221 myhost.test.ex closing connection +220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000 +250-myhost.test.ex Hello CALLER at myhost.test.ex +250-SIZE 52428800 +250-8BITMIME +250-PIPELINING +250 HELP +250 OK +250 Accepted +354 Enter message, ending with "." on a line by itself +459 content reject +221 myhost.test.ex closing connection +220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000 +250-myhost.test.ex Hello CALLER at myhost.test.ex +250-SIZE 52428800 +250-8BITMIME +250-PIPELINING +250 HELP +250 OK +250 Accepted +354 Enter message, ending with "." on a line by itself +250 OK id=10HmbD-0005vi-00 +221 myhost.test.ex closing connection +220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000 +250-myhost.test.ex Hello CALLER at myhost.test.ex +250-SIZE 52428800 +250-8BITMIME +250-PIPELINING +250 HELP +250 OK +451 Could not complete recipient verify callout +503-All RCPT commands were rejected with this error: +503-Could not complete recipient verify callout +503 Valid RCPT command must precede DATA +500 unrecognized command +500 unrecognized command +221 myhost.test.ex closing connection + +******** SERVER ******** +Listening on port 1224 ... +Connection request from [ip4.ip4.ip4.ip4] +220 ESMTP +EHLO myhost.test.ex +250 OK +MAIL FROM: +250 Sender OK +RCPT TO: +250 Recipient OK +DATA +354 Send data +Received: from CALLER (helo=myhost.test.ex) + by myhost.test.ex with local-esmtp (Exim x.yz) + (envelope-from ) + id 10HmaX-0005vi-00 + for usera@domain.com; Tue, 2 Mar 1999 09:44:33 +0000 +Message-Id: +From: CALLER_NAME +Date: Tue, 2 Mar 1999 09:44:33 +0000 +X-hdr-rtr-new: +++ + +. +250 OK +QUIT +250 OK +End of script +Listening on port 1224 ... +Connection request from [ip4.ip4.ip4.ip4] +220 ESMTP +EHLO myhost.test.ex +250 OK +MAIL FROM: +250 Sender OK +RCPT TO: +450 not right now +QUIT +250 OK +End of script +Listening on port 1224 ... +Connection request from [ip4.ip4.ip4.ip4] +220 ESMTP +EHLO myhost.test.ex +250 OK +MAIL FROM: +250 Sender OK +RCPT TO: +450 not right now +QUIT +250 OK +End of script +Listening on port 1224 ... +Connection request from [ip4.ip4.ip4.ip4] +220 ESMTP +EHLO myhost.test.ex +250 OK +MAIL FROM: +250 Sender OK +RCPT TO: +450 not right now +QUIT +250 OK +End of script +Listening on port 1224 ... +Connection request from [ip4.ip4.ip4.ip4] +220 ESMTP +EHLO myhost.test.ex +250 OK +MAIL FROM: +250 Sender OK +RCPT TO: +250 good rcpt +DATA +354 Send data +Received: from CALLER (helo=myhost.test.ex) + by myhost.test.ex with local-esmtp (Exim x.yz) + (envelope-from ) + id 10HmbA-0005vi-00 + for usere@domain.com; Tue, 2 Mar 1999 09:44:33 +0000 +Message-Id: +From: CALLER_NAME +Date: Tue, 2 Mar 1999 09:44:33 +0000 +X-hdr-rtr-new: +++ + +. +459 content reject +QUIT +250 OK +End of script +Listening on port 1224 ... +Connection request from [ip4.ip4.ip4.ip4] +220 ESMTP +EHLO myhost.test.ex +250 OK +MAIL FROM: +250 Sender OK +RCPT TO: +250 good rcpt +DATA +354 Send data +Received: from CALLER (helo=myhost.test.ex) + by myhost.test.ex with local-esmtp (Exim x.yz) + (envelope-from ) + id 10HmbB-0005vi-00 + for userf@domain.com; Tue, 2 Mar 1999 09:44:33 +0000 +Message-Id: +From: CALLER_NAME +Date: Tue, 2 Mar 1999 09:44:33 +0000 +X-hdr-rtr-new: +++ + +. +459 content reject +QUIT +250 OK +End of script +Listening on port 1224 ... +Connection request from [ip4.ip4.ip4.ip4] +220 ESMTP +EHLO myhost.test.ex +250 OK +MAIL FROM: +250 Sender OK +RCPT TO: +250 good rcpt +DATA +354 Send data +Received: from CALLER (helo=myhost.test.ex) + by myhost.test.ex with local-esmtp (Exim x.yz) + (envelope-from ) + id 10HmbC-0005vi-00 + for userg@domain.com; Tue, 2 Mar 1999 09:44:33 +0000 +Message-Id: +From: CALLER_NAME +Date: Tue, 2 Mar 1999 09:44:33 +0000 +X-hdr-rtr-new: +++ + +. +459 content reject +QUIT +250 OK +End of script +Listening on port 1224 ... +Connection request from [ip4.ip4.ip4.ip4] +220 ESMTP +EHLO myhost.test.ex +250 OK +MAIL FROM: +250 Sender OK +RCPT TO: +250 Recipient OK +DATA +354 Send data +Received: from CALLER (helo=myhost.test.ex) + by myhost.test.ex with local-esmtp (Exim x.yz) + (envelope-from ) + id 10HmbD-0005vi-00 + for userh@domain.com; Tue, 2 Mar 1999 09:44:33 +0000 +Message-Id: +From: CALLER_NAME +Date: Tue, 2 Mar 1999 09:44:33 +0000 +X-hdr-rtr-new: +++ + +. +250 OK +QUIT +250 OK +End of script +Listening on port 1224 ... +Connection request from [ip4.ip4.ip4.ip4] +220 ESMTP +EHLO myhost.test.ex +250 OK +MAIL FROM: +250 Sender OK +RCPT TO: +450 not right now +QUIT +250 OK +End of script -- cgit v1.2.3