delivery resulted in actual delivery. Cancel cutthrough before DATA
stage.
+JH/45 Fix cutthrough, when connection not opened by verify and target hard-
+ rejects a recipient: pass the reject to the originator.
+
Exim version 4.86
and rcpt acl returned accept,
and first recipient (cancel on any subsequents)
open one now and run it up to RCPT acceptance.
-A failed verify should cancel cutthrough request.
-
+A failed verify should cancel cutthrough request,
+and will pass the fail to the originator.
Initial implementation: dual-write to spool.
Assume the rxd datastream is now being copied byte-for-byte to an open cutthrough connection.
if (host_checking_callout) /* -bhc mode */
cancel_cutthrough_connection("host-checking mode");
else if (rc == OK && cutthrough.delivery && rcpt_count > cutthrough.nrcpt)
- open_cutthrough_connection(addr);
+ rc = open_cutthrough_connection(addr);
break;
case ACL_WHERE_PREDATA:
extern void moan_write_from(FILE *);
extern FILE *modefopen(const uschar *, const char *, mode_t);
-extern void open_cutthrough_connection( address_item * addr );
+extern int open_cutthrough_connection( address_item * addr );
extern uschar *parse_extract_address(uschar *, uschar **, int *, int *, int *,
BOOL);
/* Called after recipient-acl to get a cutthrough connection open when
one was requested and a recipient-verify wasn't subsequently done.
*/
-void
+int
open_cutthrough_connection( address_item * addr )
{
address_item addr2;
+int rc;
/* Use a recipient-verify-callout to set up the cutthrough connection. */
/* We must use a copy of the address for verification, because it might
addr2 = *addr;
HDEBUG(D_acl) debug_printf("----------- %s cutthrough setup ------------\n",
rcpt_count > 1 ? "more" : "start");
-(void) verify_address(&addr2, NULL,
+rc= verify_address(&addr2, NULL,
vopt_is_recipient | vopt_callout_recipsender | vopt_callout_no_cache,
CUTTHROUGH_CMD_TIMEOUT, -1, -1,
NULL, NULL, NULL);
HDEBUG(D_acl) debug_printf("----------- end cutthrough setup ------------\n");
-return;
+return rc;
}
transport = ${if eq {special_tpt}{$local_part} {smtp2}{smtp}}
headers_remove = X-hdr-rtr
headers_add = X-hdr-rtr-new: $h_X-hdr-rtr:+++
+ errors_to = ""
no_more
1999-03-02 09:44:33 10HmbA-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local-esmtp S=sss for userx@domain.com
1999-03-02 09:44:33 10HmbA-0005vi-00 Completed
1999-03-02 09:44:33 rcpt for no@domain.com
+1999-03-02 09:44:33 U=CALLER F=<CALLER@myhost.test.ex> rejected RCPT <no@domain.com>
1999-03-02 09:44:33 rcpt for userx@domain.com
-1999-03-02 09:44:33 10HmbB-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local-esmtp S=sss for no@domain.com userx@domain.com
-1999-03-02 09:44:33 10HmbB-0005vi-00 -> userx@domain.com R=all T=smtp H=127.0.0.1 [127.0.0.1] C="250 OK"
-1999-03-02 09:44:33 10HmbB-0005vi-00 => no@domain.com R=all T=smtp H=127.0.0.1 [127.0.0.1] C="250 OK"
+1999-03-02 09:44:33 10HmbB-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local-esmtp S=sss for userx@domain.com
+1999-03-02 09:44:33 10HmbB-0005vi-00 => userx@domain.com R=all T=smtp H=127.0.0.1 [127.0.0.1] C="250 OK"
1999-03-02 09:44:33 10HmbB-0005vi-00 Completed
1999-03-02 09:44:33 rcpt for userx@domain.com
1999-03-02 09:44:33 rcpt for no@domain.com
-1999-03-02 09:44:33 10HmbC-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local-esmtp S=sss for userx@domain.com no@domain.com
-1999-03-02 09:44:33 10HmbC-0005vi-00 -> no@domain.com R=all T=smtp H=127.0.0.1 [127.0.0.1] C="250 OK"
+1999-03-02 09:44:33 U=CALLER F=<CALLER@myhost.test.ex> rejected RCPT <no@domain.com>
+1999-03-02 09:44:33 10HmbC-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local-esmtp S=sss for userx@domain.com
1999-03-02 09:44:33 10HmbC-0005vi-00 => userx@domain.com R=all T=smtp H=127.0.0.1 [127.0.0.1] C="250 OK"
1999-03-02 09:44:33 10HmbC-0005vi-00 Completed
1999-03-02 09:44:33 rcpt for userx@domain.com
--- /dev/null
+1999-03-02 09:44:33 U=CALLER F=<CALLER@myhost.test.ex> rejected RCPT <no@domain.com>
+1999-03-02 09:44:33 U=CALLER F=<CALLER@myhost.test.ex> rejected RCPT <no@domain.com>
#
# cutthrough for 2 recipients in one domain
# first one denied
-# so we get a 2nd conn with the traditional delivery
-# (for both because it's not a real verify=recipient)
+# so we get a 2nd conn with the traditional delivery for the second
server PORT_S 2
220 ESMTP
EHLO
250 Sender OK
RCPT TO:
250 ok rcpt-1
-RCPT TO:
-250 ok rcpt-2
DATA
354 Send data
.
#
# cutthrough for 2 recipients in one domain
# second one denied
-# so we get a 2nd conn with the traditional delivery
-# (for both because it's not a real verify=recipient)
+# so we get a 2nd conn with the traditional delivery of the 1st
server PORT_S 2
220 ESMTP
EHLO
250 Sender OK
RCPT TO:
250 ok rcpt-1
-RCPT TO:
-250 ok rcpt-2
DATA
354 Send data
.
250-PIPELINING\r
250 HELP\r
250 OK\r
-250 Accepted\r
+550 Administrative prohibition\r
250 Accepted\r
354 Enter message, ending with "." on a line by itself\r
250 OK id=10HmbB-0005vi-00\r
250 HELP\r
250 OK\r
250 Accepted\r
-250 Accepted\r
+550 Administrative prohibition\r
354 Enter message, ending with "." on a line by itself\r
250 OK id=10HmbC-0005vi-00\r
221 myhost.test.ex closing connection\r
220 ESMTP
EHLO myhost.test.ex
250 OK
-MAIL FROM:<CALLER@myhost.test.ex>
+MAIL FROM:<>
250 Sender OK
-RCPT TO:<no@domain.com>
-250 ok rcpt-1
RCPT TO:<userx@domain.com>
-250 ok rcpt-2
+250 ok rcpt-1
DATA
354 Send data
Received: from CALLER (helo=myhost.test.ex)
by myhost.test.ex with local-esmtp (Exim x.yz)
(envelope-from <CALLER@myhost.test.ex>)
- id 10HmbB-0005vi-00; Tue, 2 Mar 1999 09:44:33 +0000
+ id 10HmbB-0005vi-00
+ for userx@domain.com; Tue, 2 Mar 1999 09:44:33 +0000
Message-Id: <E10HmbB-0005vi-00@myhost.test.ex>
From: CALLER_NAME <CALLER@myhost.test.ex>
Date: Tue, 2 Mar 1999 09:44:33 +0000
220 ESMTP
EHLO myhost.test.ex
250 OK
-MAIL FROM:<CALLER@myhost.test.ex>
+MAIL FROM:<>
250 Sender OK
RCPT TO:<userx@domain.com>
250 ok rcpt-1
-RCPT TO:<no@domain.com>
-250 ok rcpt-2
DATA
354 Send data
Received: from CALLER (helo=myhost.test.ex)
by myhost.test.ex with local-esmtp (Exim x.yz)
(envelope-from <CALLER@myhost.test.ex>)
- id 10HmbC-0005vi-00; Tue, 2 Mar 1999 09:44:33 +0000
+ id 10HmbC-0005vi-00
+ for userx@domain.com; Tue, 2 Mar 1999 09:44:33 +0000
Message-Id: <E10HmbC-0005vi-00@myhost.test.ex>
From: CALLER_NAME <CALLER@myhost.test.ex>
Date: Tue, 2 Mar 1999 09:44:33 +0000
220 ESMTP
EHLO myhost.test.ex
250 OK
-MAIL FROM:<CALLER@myhost.test.ex>
+MAIL FROM:<>
250 Sender OK
RCPT TO:<userx@domain.com>
250 ok rcpt-1
220 ESMTP
EHLO myhost.test.ex
250 OK
-MAIL FROM:<CALLER@myhost.test.ex>
+MAIL FROM:<>
250 Sender OK
RCPT TO:<special_tpt@domain.com>
250 ok rcpt-2
220 ESMTP
EHLO myhost.test.ex
250 OK
-MAIL FROM:<CALLER@myhost.test.ex>
+MAIL FROM:<>
250 Sender OK
RCPT TO:<userx@domain.com>
250 ok rcpt-1
220 ESMTP
EHLO myhost.test.ex
250 OK
-MAIL FROM:<CALLER@myhost.test.ex>
+MAIL FROM:<>
250 Sender OK
RCPT TO:<usery@special.com>
250 ok rcpt-2