From 9fb264ca328cc32d1e1d31c2487ca704e7447836 Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Sat, 19 Jan 2013 20:50:30 +0000 Subject: [PATCH] Fix logging for all PRDR defer/deny. --- src/src/receive.c | 5 +++ test/log/5500 | 4 ++ test/scripts/5500-PRDR/5500 | 58 +++++++++++++++++++++++++ test/stdout/5500 | 84 +++++++++++++++++++++++++++++++++++++ 4 files changed, 151 insertions(+) diff --git a/src/src/receive.c b/src/src/receive.c index 4f259923c..7b0a22f5c 100644 --- a/src/src/receive.c +++ b/src/src/receive.c @@ -3288,6 +3288,11 @@ else : all_pass == OK ? US"accepted" : US"accepted for some recipients"); + if (recipients_count == 0) + { + message_id[0] = 0; /* Indicate no message accepted */ + goto TIDYUP; + } } else prdr_requested = FALSE; diff --git a/test/log/5500 b/test/log/5500 index 7d128c06f..ef5372cd1 100644 --- a/test/log/5500 +++ b/test/log/5500 @@ -11,3 +11,7 @@ 1999-03-02 09:44:33 10HmaZ-0005vi-00 <= <> H=(rhu.barb) [127.0.0.1] P=esmtp S=sss 1999-03-02 09:44:33 10HmaZ-0005vi-00 => user1 R=r0 T=t1 1999-03-02 09:44:33 10HmaZ-0005vi-00 Completed +1999-03-02 09:44:33 10HmbA-0005vi-00 PRDR R= temporary refusal +1999-03-02 09:44:33 10HmbA-0005vi-00 PRDR R= temporary refusal +1999-03-02 09:44:33 10HmbB-0005vi-00 PRDR R= refusal +1999-03-02 09:44:33 10HmbB-0005vi-00 PRDR R= refusal diff --git a/test/scripts/5500-PRDR/5500 b/test/scripts/5500-PRDR/5500 index 3090fa5ed..567b00085 100644 --- a/test/scripts/5500-PRDR/5500 +++ b/test/scripts/5500-PRDR/5500 @@ -93,5 +93,63 @@ quit **** sleep 1 # +# 4: double temp-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 +??? 450 +??? 450 +??? 250 +quit +??? 221 +**** +sleep 1 +# +# 5: double 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 +??? 550 +??? 550 +??? 550 +quit +??? 221 +**** +sleep 1 +# killdaemon # diff --git a/test/stdout/5500 b/test/stdout/5500 index 7732787ef..d5efef741 100644 --- a/test/stdout/5500 +++ b/test/stdout/5500 @@ -120,3 +120,87 @@ Connecting to 127.0.0.1 port 1225 ... connected ??? 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 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 +??? 450 +<<< 450 PRDR R= temporary refusal +??? 450 +<<< 450 PRDR R= temporary refusal +??? 250 +<<< 250 id=10HmbA-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 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 +??? 550 +<<< 550 PRDR R= refusal +??? 550 +<<< 550 PRDR R= refusal +??? 550 +<<< 550 id=10HmbB-0005vi-00 message rejected for all recipients +>>> quit +??? 221 +<<< 221 myhost.test.ex closing connection +End of script -- 2.25.1