From 631b1b437ce495945e67a027932498e8f7214841 Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Sun, 13 Jan 2013 15:24:44 +0000 Subject: [PATCH] Fix PRDR server call to DATA acl. Tidy testing. This was broken by 6ce1e. --- src/src/receive.c | 4 +--- src/src/verify.c | 2 -- test/confs/5500 | 4 +++- test/log/5500 | 6 ++--- test/log/5510 | 4 ++++ test/mail/5500.userx | 2 +- test/mail/5500.userz | 7 ------ test/rejectlog/5500 | 8 +++++++ test/scripts/5500-PRDR/5500 | 36 +++++++++++++++++++++++++++- test/scripts/5500-PRDR/5510 | 34 ++++++++++++++++++++++++++ test/stdout/5500 | 48 ++++++++++++++++++++++++++++++++++--- test/stdout/5510 | 32 +++++++++++++++++++++++++ 12 files changed, 166 insertions(+), 21 deletions(-) delete mode 100644 test/mail/5500.userz create mode 100644 test/rejectlog/5500 diff --git a/src/src/receive.c b/src/src/receive.c index 6abf7900c..9dfaed0a3 100644 --- a/src/src/receive.c +++ b/src/src/receive.c @@ -3294,7 +3294,7 @@ else break; } } - /* Set up final message */ + /* Set up final message, used if data acl gives OK */ smtp_reply = string_sprintf("%s id=%s message %s", all_fail == FAIL ? US"550" : US"250", message_id, @@ -3304,8 +3304,6 @@ else ? US"accepted" : US"accepted for some recipients"); } - /* Kinda ugly, but turns the next if into an else-if */ - else #endif /* EXPERIMENTAL_PRDR */ /* Check the recipients count again, as the MIME ACL might have changed diff --git a/src/src/verify.c b/src/src/verify.c index f17e36f01..a1b8142a9 100644 --- a/src/src/verify.c +++ b/src/src/verify.c @@ -607,8 +607,6 @@ else ) { uschar buffer2[4096]; -DEBUG(D_transport) - debug_printf("trying tls\n"); if ( !smtps && !(done= smtp_write_command(&outblock, FALSE, "STARTTLS\r\n") >= 0)) goto SEND_FAILED; diff --git a/test/confs/5500 b/test/confs/5500 index 76240b4f0..1bc830ef4 100644 --- a/test/confs/5500 +++ b/test/confs/5500 @@ -32,10 +32,12 @@ acl_smtp_data = data_acl begin acl prdr_acl: - deny local_parts = usery + defer local_parts = usery + deny local_parts = userz accept data_acl: + deny condition = ${if match {$recipients}{userq}} accept # ----- Transports ----- diff --git a/test/log/5500 b/test/log/5500 index 50a822edd..daa1f0715 100644 --- a/test/log/5500 +++ b/test/log/5500 @@ -1,4 +1,4 @@ 1999-03-02 09:44:33 exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on port 1225 -1999-03-02 09:44:33 10HmaX-0005vi-00 => userx R=r0 T=t1 -1999-03-02 09:44:33 10HmaX-0005vi-00 => userz R=r0 T=t1 -1999-03-02 09:44:33 10HmaX-0005vi-00 Completed +1999-03-02 09:44:33 10HmaX-0005vi-00 H=(rhu.barb) [127.0.0.1] F=<> rejected after DATA +1999-03-02 09:44:33 10HmaY-0005vi-00 => userx R=r0 T=t1 +1999-03-02 09:44:33 10HmaY-0005vi-00 Completed diff --git a/test/log/5510 b/test/log/5510 index 4f586c958..795c0b662 100644 --- a/test/log/5510 +++ b/test/log/5510 @@ -14,3 +14,7 @@ 1999-03-02 09:44:33 10HmbA-0005vi-00 ** user4.1@test.ex R=r0 T=t1 H=127.0.0.1 [127.0.0.1]: SMTP error from remote mail server after end of data: host 127.0.0.1 [127.0.0.1]: 550 oops, overall rejection 1999-03-02 09:44:33 10HmbA-0005vi-00 ** user4.2@test.ex R=r0 T=t1 H=127.0.0.1 [127.0.0.1]: SMTP error from remote mail server after end of data: host 127.0.0.1 [127.0.0.1]: 550 oops, overall rejection 1999-03-02 09:44:33 10HmbA-0005vi-00 Frozen (delivery error message) +1999-03-02 09:44:33 10HmbB-0005vi-00 <= <> U=CALLER P=local S=sss +1999-03-02 09:44:33 10HmbB-0005vi-00 == user5.1@test.ex R=r0 T=t1 defer (-46): SMTP error from remote mail server after end of data: host 127.0.0.1 [127.0.0.1]: 450 oops, try again later please +1999-03-02 09:44:33 10HmbB-0005vi-00 == user5.2@test.ex R=r0 T=t1 defer (-46): SMTP error from remote mail server after end of data: host 127.0.0.1 [127.0.0.1]: 450 oops, try again later please +1999-03-02 09:44:33 10HmbB-0005vi-00 == user5.3@test.ex R=r0 T=t1 defer (-46): SMTP error from remote mail server after end of data: host 127.0.0.1 [127.0.0.1]: 450 oops, try again later please diff --git a/test/mail/5500.userx b/test/mail/5500.userx index 723eae8ee..c46897f8d 100644 --- a/test/mail/5500.userx +++ b/test/mail/5500.userx @@ -1,7 +1,7 @@ From MAILER-DAEMON Tue Mar 02 09:44:33 1999 Received: from [127.0.0.1] (helo=rhu.barb) by myhost.test.ex with esmtp (Exim x.yz) - id 10HmaX-0005vi-00; Tue, 2 Mar 1999 09:44:33 +0000 + id 10HmaY-0005vi-00; Tue, 2 Mar 1999 09:44:33 +0000 Sender: sender@some.where diff --git a/test/mail/5500.userz b/test/mail/5500.userz deleted file mode 100644 index 723eae8ee..000000000 --- a/test/mail/5500.userz +++ /dev/null @@ -1,7 +0,0 @@ -From MAILER-DAEMON Tue Mar 02 09:44:33 1999 -Received: from [127.0.0.1] (helo=rhu.barb) - by myhost.test.ex with esmtp (Exim x.yz) - id 10HmaX-0005vi-00; Tue, 2 Mar 1999 09:44:33 +0000 -Sender: sender@some.where - - diff --git a/test/rejectlog/5500 b/test/rejectlog/5500 new file mode 100644 index 000000000..89372dcfd --- /dev/null +++ b/test/rejectlog/5500 @@ -0,0 +1,8 @@ +1999-03-02 09:44:33 10HmaX-0005vi-00 H=(rhu.barb) [127.0.0.1] F=<> rejected after DATA +Envelope-from: <> +Envelope-to: + +P Received: from [127.0.0.1] (helo=rhu.barb) + by myhost.test.ex with esmtp (Exim x.yz) + id 10HmaX-0005vi-00; Tue, 2 Mar 1999 09:44:33 +0000 +S Sender: sender@some.where diff --git a/test/scripts/5500-PRDR/5500 b/test/scripts/5500-PRDR/5500 index c9477a1c6..d52501788 100644 --- a/test/scripts/5500-PRDR/5500 +++ b/test/scripts/5500-PRDR/5500 @@ -1,7 +1,9 @@ # PRDR (Per-Recipient Data Responses) server need_ipv4 +no_msglog_check # -# usery should be rejected, x & z accepted, all after data per PRDR spec +# 1: userx should be accepted, y should be tmp-rejected, +# z rejected, all after data per PRDR spec exim -DSERVER=server -bd -oX PORT_D **** client 127.0.0.1 PORT_D @@ -27,11 +29,43 @@ Sender: sender@some.where . ??? 353 ??? 250 +??? 450 ??? 550 ??? 250 +quit +??? 221 +**** +#sleep 1 +#killdaemon +# +# +# 2: traditional data acl should be called, resulting in an overall reject +client 127.0.0.1 PORT_D +??? 220 +ehlo rhu.barb +??? 250- +??? 250- +??? 250- +??? 250- +??? 250-PRDR ??? 250 +mail from:<> PRDR +??? 250 +rcpt to: +??? 250 +rcpt to: +??? 250 +data +??? 354 +Sender: sender@some.where +. +??? 353 +??? 250 +??? 250 +??? 550 quit ??? 221 **** sleep 1 killdaemon +# diff --git a/test/scripts/5500-PRDR/5510 b/test/scripts/5500-PRDR/5510 index 1885a8a5f..05ae4128e 100644 --- a/test/scripts/5500-PRDR/5510 +++ b/test/scripts/5500-PRDR/5510 @@ -1,5 +1,6 @@ # PRDR client need_ipv4 +no_msglog_check # # 1: Two recipients, accepted server PORT_S @@ -117,3 +118,36 @@ text **** # # +# 5: Temp-reject at final +server PORT_S +220 Server ready +EHLO +250- +250-PRDR +250 OK +MAIL FROM:<> PRDR +250 OK +RCPT TO +250 OK +RCPT TO +250 OK +RCPT TO +250 OK +DATA +300 go ahead +. +353 prdr responses coming up +250 first rcpt does not like you +250 second rcpt has a temporary problem +250 third rcpt is ok +450 oops, try again later please +QUIT +250 OK +**** +exim -odi -f "" user5.1 user5.2 user5.3 +text +**** +# +# +# +# 6 ? diff --git a/test/stdout/5500 b/test/stdout/5500 index c45586301..e3d40ac00 100644 --- a/test/stdout/5500 +++ b/test/stdout/5500 @@ -35,12 +35,54 @@ Connecting to 127.0.0.1 port 1225 ... connected <<< 353 PRDR content analysis beginning ??? 250 <<< 250 OK PRDR accepted for userx@test.ex +??? 450 +<<< 450 usery@test.ex temporarily refuses the content ??? 550 -<<< 550 usery@test.ex refuses the content +<<< 550 userz@test.ex refuses the content ??? 250 -<<< 250 OK PRDR accepted for userz@test.ex +<<< 250 id=10HmaY-0005vi-00 message accepted for some recipients +>>> quit +??? 221 +<<< 221 myhost.test.ex closing connection +End of script +Connecting to 127.0.0.1 port 1225 ... connected +??? 220 +<<< 220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000 +>>> ehlo rhu.barb +??? 250- +<<< 250-myhost.test.ex Hello rhu.barb [127.0.0.1] +??? 250- +<<< 250-SIZE 52428800 +??? 250- +<<< 250-8BITMIME +??? 250- +<<< 250-PIPELINING +??? 250-PRDR +<<< 250-PRDR ??? 250 -<<< 250 id=10HmaX-0005vi-00 message accepted for some recipients +<<< 250 HELP +>>> mail from:<> PRDR +??? 250 +<<< 250 OK, PRDR Requested +>>> rcpt to: +??? 250 +<<< 250 Accepted +>>> rcpt to: +??? 250 +<<< 250 Accepted +>>> data +??? 354 +<<< 354 Enter message, ending with "." on a line by itself +>>> Sender: sender@some.where +>>> . +??? 353 +<<< 353 PRDR content analysis beginning +??? 250 +<<< 250 OK PRDR accepted for userp@test.ex +??? 250 +<<< 250 OK PRDR accepted for userq@test.ex +??? 550 +<<< 550 Administrative prohibition >>> quit ??? 221 <<< 221 myhost.test.ex closing connection diff --git a/test/stdout/5510 b/test/stdout/5510 index d8b53d2d0..310058dfd 100644 --- a/test/stdout/5510 +++ b/test/stdout/5510 @@ -118,3 +118,35 @@ text QUIT 250 OK End of script +Listening on port 1224 ... +Connection request from [127.0.0.1] +220 Server ready +EHLO myhost.test.ex +250- +250-PRDR +250 OK +MAIL FROM:<> PRDR +250 OK +RCPT TO: +250 OK +RCPT TO: +250 OK +RCPT TO: +250 OK +DATA +300 go ahead +Received: from CALLER by myhost.test.ex with local (Exim x.yz) + id 10HmbB-0005vi-00; Tue, 2 Mar 1999 09:44:33 +0000 +Message-Id: +Date: Tue, 2 Mar 1999 09:44:33 +0000 + +text +. +353 prdr responses coming up +250 first rcpt does not like you +250 second rcpt has a temporary problem +250 third rcpt is ok +450 oops, try again later please +QUIT +250 OK +End of script -- 2.25.1