summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2016-03-01 20:58:00 +0000
committerJeremy Harris <jgh146exb@wizmail.org>2016-03-03 13:25:30 +0000
commitf9334a281c155709bd269771c11fc5bbf687c17b (patch)
tree6fe70438a3c12bf304319cff18d88737eff1e6f9 /src
parentb8a7fa2dd5c9a7fec40925366743255f91fcf846 (diff)
Cutthrough: Reflect 5xx recipient reject from target to originator
When connection not opened by verify and target hard-rejects a RCPT, the reject was not being passed to the originating system (just the cutthrough connection was being dropped). Fix this.
Diffstat (limited to 'src')
-rw-r--r--src/src/acl.c6
-rw-r--r--src/src/functions.h2
-rw-r--r--src/src/verify.c7
3 files changed, 8 insertions, 7 deletions
diff --git a/src/src/acl.c b/src/src/acl.c
index d508a29e7..f17e28488 100644
--- a/src/src/acl.c
+++ b/src/src/acl.c
@@ -4489,8 +4489,8 @@ and WHERE_RCPT and not yet opened conn as result of recipient-verify,
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.
@@ -4512,7 +4512,7 @@ case ACL_WHERE_PRDR:
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:
diff --git a/src/src/functions.h b/src/src/functions.h
index 97af70cee..53ed64345 100644
--- a/src/src/functions.h
+++ b/src/src/functions.h
@@ -280,7 +280,7 @@ extern BOOL moan_to_sender(int, error_block *, header_line *, FILE *, BOOL);
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);
diff --git a/src/src/verify.c b/src/src/verify.c
index ef95394d3..6aa425a54 100644
--- a/src/src/verify.c
+++ b/src/src/verify.c
@@ -1413,10 +1413,11 @@ return yield;
/* 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
@@ -1425,12 +1426,12 @@ get rewritten. */
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;
}