X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/f9334a281c155709bd269771c11fc5bbf687c17b..b0d68adc8b45e42b425c23e7dbf195b772878b9a:/src/src/acl.c?ds=sidebyside diff --git a/src/src/acl.c b/src/src/acl.c index f17e28488..dd59b4952 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 - 2015 */ +/* Copyright (c) University of Cambridge 1995 - 2016 */ /* See the file NOTICE for conditions of use and distribution. */ /* Code for handling Access Control Lists (ACLs) */ @@ -65,9 +65,6 @@ enum { ACLC_ACL, ACLC_DECODE, #endif ACLC_DELAY, -#ifdef WITH_OLD_DEMIME - ACLC_DEMIME, -#endif #ifndef DISABLE_DKIM ACLC_DKIM_SIGNER, ACLC_DKIM_STATUS, @@ -132,9 +129,6 @@ static uschar *conditions[] = { US"decode", #endif US"delay", -#ifdef WITH_OLD_DEMIME - US"demime", -#endif #ifndef DISABLE_DKIM US"dkim_signers", US"dkim_status", @@ -281,9 +275,6 @@ static uschar cond_expand_at_top[] = { TRUE, /* decode */ #endif TRUE, /* delay */ -#ifdef WITH_OLD_DEMIME - TRUE, /* demime */ -#endif #ifndef DISABLE_DKIM TRUE, /* dkim_signers */ TRUE, /* dkim_status */ @@ -346,9 +337,6 @@ static uschar cond_modifiers[] = { FALSE, /* decode */ #endif TRUE, /* delay */ -#ifdef WITH_OLD_DEMIME - FALSE, /* demime */ -#endif #ifndef DISABLE_DKIM FALSE, /* dkim_signers */ FALSE, /* dkim_status */ @@ -453,15 +441,6 @@ static unsigned int cond_forbids[] = { (1<next)); @@ -2376,17 +2355,13 @@ rate measurement as opposed to rate limiting. */ sender_rate_limit = string_nextinlist(&arg, &sep, NULL, 0); if (sender_rate_limit == NULL) - { - limit = -1.0; - ss = NULL; /* compiler quietening */ - } -else - { - limit = Ustrtod(sender_rate_limit, &ss); - if (tolower(*ss) == 'k') { limit *= 1024.0; ss++; } - else if (tolower(*ss) == 'm') { limit *= 1024.0*1024.0; ss++; } - else if (tolower(*ss) == 'g') { limit *= 1024.0*1024.0*1024.0; ss++; } - } + return ratelimit_error(log_msgptr, "sender rate limit not set"); + +limit = Ustrtod(sender_rate_limit, &ss); +if (tolower(*ss) == 'k') { limit *= 1024.0; ss++; } +else if (tolower(*ss) == 'm') { limit *= 1024.0*1024.0; ss++; } +else if (tolower(*ss) == 'g') { limit *= 1024.0*1024.0*1024.0; ss++; } + if (limit < 0.0 || *ss != '\0') return ratelimit_error(log_msgptr, "\"%s\" is not a positive number", sender_rate_limit); @@ -3001,8 +2976,6 @@ acl_check_condition(int verb, acl_condition_block *cb, int where, { uschar *user_message = NULL; uschar *log_message = NULL; -uschar *debug_tag = NULL; -uschar *debug_opts = NULL; int rc = OK; #ifdef WITH_CONTENT_SCAN int sep = -'/'; @@ -3354,24 +3327,39 @@ for (; cb != NULL; cb = cb->next) break; case CONTROL_DEBUG: - while (*p == '/') { - if (Ustrncmp(p, "/tag=", 5) == 0) - { - const uschar *pp = p + 5; - while (*pp != '\0' && *pp != '/') pp++; - debug_tag = string_copyn(p+5, pp-p-5); - p = pp; - } - else if (Ustrncmp(p, "/opts=", 6) == 0) + uschar * debug_tag = NULL; + uschar * debug_opts = NULL; + BOOL kill = FALSE; + + while (*p == '/') { - const uschar *pp = p + 6; - while (*pp != '\0' && *pp != '/') pp++; - debug_opts = string_copyn(p+6, pp-p-6); + const uschar * pp = p+1; + if (Ustrncmp(pp, "tag=", 4) == 0) + { + for (pp += 4; *pp && *pp != '/';) pp++; + debug_tag = string_copyn(p+5, pp-p-5); + } + else if (Ustrncmp(pp, "opts=", 5) == 0) + { + for (pp += 5; *pp && *pp != '/';) pp++; + debug_opts = string_copyn(p+6, pp-p-6); + } + else if (Ustrncmp(pp, "kill", 4) == 0) + { + for (pp += 4; *pp && *pp != '/';) pp++; + kill = TRUE; + } + else + while (*pp && *pp != '/') pp++; p = pp; } + + if (kill) + debug_logging_stop(); + else + debug_logging_activate(debug_tag, debug_opts); } - debug_logging_activate(debug_tag, debug_opts); break; case CONTROL_SUPPRESS_LOCAL_FIXUPS: @@ -3537,12 +3525,6 @@ for (; cb != NULL; cb = cb->next) } break; - #ifdef WITH_OLD_DEMIME - case ACLC_DEMIME: - rc = demime(&arg); - break; - #endif - #ifndef DISABLE_DKIM case ACLC_DKIM_SIGNER: if (dkim_cur_signer != NULL)