X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/e3a69b62f532a5ac4990d529e015683108155a98..e34f8ca2022e340d3c0e36260a0232fab306dfcc:/src/src/acl.c diff --git a/src/src/acl.c b/src/src/acl.c index f01f5cf3c..fb8b75bc7 100644 --- a/src/src/acl.c +++ b/src/src/acl.c @@ -2,7 +2,7 @@ * Exim - an Internet mail transport agent * *************************************************/ -/* Copyright (c) University of Cambridge 1995 - 2017 */ +/* Copyright (c) University of Cambridge 1995 - 2018 */ /* See the file NOTICE for conditions of use and distribution. */ /* Code for handling Access Control Lists (ACLs) */ @@ -523,7 +523,8 @@ static control_def controls_list[] = { }, #ifdef SUPPORT_I18N [CONTROL_UTF8_DOWNCONVERT] = - { US"utf8_downconvert", TRUE, 0 } + { US"utf8_downconvert", TRUE, (unsigned) ~(ACL_BIT_RCPT | ACL_BIT_VRFY) + } #endif }; @@ -3251,6 +3252,8 @@ for (; cb != NULL; cb = cb->next) break; case CONTROL_CUTTHROUGH_DELIVERY: + { + uschar * ignored = NULL; #ifndef DISABLE_PRDR if (prdr_requested) #else @@ -3259,20 +3262,20 @@ for (; cb != NULL; cb = cb->next) /* Too hard to think about for now. We might in future cutthrough the case where both sides handle prdr and this-node prdr acl is "accept" */ - *log_msgptr = string_sprintf("PRDR on %s reception\n", arg); + ignored = US"PRDR active"; else { if (deliver_freeze) - *log_msgptr = US"frozen"; + ignored = US"frozen"; else if (queue_only_policy) - *log_msgptr = US"queue-only"; + ignored = US"queue-only"; else if (fake_response == FAIL) - *log_msgptr = US"fakereject"; + ignored = US"fakereject"; else { if (rcpt_count == 1) { - cutthrough.delivery = TRUE; + cutthrough.delivery = TRUE; /* control accepted */ while (*p == '/') { const uschar * pp = p+1; @@ -3287,12 +3290,14 @@ for (; cb != NULL; cb = cb->next) p = pp; } } - break; + else + ignored = US"nonfirst rcpt"; } - *log_msgptr = string_sprintf("\"control=%s\" on %s item", - arg, *log_msgptr); } - return ERROR; + DEBUG(D_acl) if (ignored) + debug_printf(" cutthrough request ignored on %s item\n", ignored); + } + break; #ifdef SUPPORT_I18N case CONTROL_UTF8_DOWNCONVERT: @@ -4417,22 +4422,29 @@ switch (where) else if ( rc == OK && cutthrough.delivery && rcpt_count > cutthrough.nrcpt - && (rc = open_cutthrough_connection(addr)) == DEFER ) - if (cutthrough.defer_pass) - { - uschar * s = addr->message; - /* Horrid kludge to recover target's SMTP message */ - while (*s) s++; - do --s; while (!isdigit(*s)); - if (*--s && isdigit(*s) && *--s && isdigit(*s)) *user_msgptr = s; - acl_temp_details = TRUE; - } - else - { - HDEBUG(D_acl) debug_printf_indent("cutthrough defer; will spool\n"); - rc = OK; - } + { + if ((rc = open_cutthrough_connection(addr)) == DEFER) + if (cutthrough.defer_pass) + { + uschar * s = addr->message; + /* Horrid kludge to recover target's SMTP message */ + while (*s) s++; + do --s; while (!isdigit(*s)); + if (*--s && isdigit(*s) && *--s && isdigit(*s)) *user_msgptr = s; + acl_temp_details = TRUE; + } + else + { + HDEBUG(D_acl) debug_printf_indent("cutthrough defer; will spool\n"); + rc = OK; + } + } + else HDEBUG(D_acl) if (cutthrough.delivery) + if (rcpt_count <= cutthrough.nrcpt) + debug_printf_indent("ignore cutthrough request; nonfirst message\n"); + else if (rc != OK) + debug_printf_indent("ignore cutthrough request; ACL did not accept\n"); break; case ACL_WHERE_PREDATA: