X-Git-Url: https://git.exim.org/users/jgh/exim.git/blobdiff_plain/c8e2fc1e846d1c9bee207d162182fb770b9ae1bd..c393f9312e022187f24bc9536e9d3ea426009ea0:/src/src/expand.c diff --git a/src/src/expand.c b/src/src/expand.c index 786d4279c..1da222563 100644 --- a/src/src/expand.c +++ b/src/src/expand.c @@ -181,6 +181,7 @@ static uschar *op_table_main[] = { US"h", US"hash", US"hex2b64", + US"hexquote", US"l", US"lc", US"length", @@ -216,6 +217,7 @@ enum { EOP_H, EOP_HASH, EOP_HEX2B64, + EOP_HEXQUOTE, EOP_L, EOP_LC, EOP_LENGTH, @@ -458,6 +460,12 @@ static var_entry var_table[] = { { "dkim_signers", vtype_stringptr, &dkim_signers }, { "dkim_verify_reason", vtype_dkim, (void *)DKIM_VERIFY_REASON }, { "dkim_verify_status", vtype_dkim, (void *)DKIM_VERIFY_STATUS}, +#endif +#ifdef EXPERIMENTAL_DMARC + { "dmarc_ar_header", vtype_stringptr, &dmarc_ar_header }, + { "dmarc_status", vtype_stringptr, &dmarc_status }, + { "dmarc_status_text", vtype_stringptr, &dmarc_status_text }, + { "dmarc_used_domain", vtype_stringptr, &dmarc_used_domain }, #endif { "dnslist_domain", vtype_stringptr, &dnslist_domain }, { "dnslist_matched", vtype_stringptr, &dnslist_matched }, @@ -571,6 +579,7 @@ static var_entry var_table[] = { { "reply_address", vtype_reply, NULL }, { "return_path", vtype_stringptr, &return_path }, { "return_size_limit", vtype_int, &bounce_return_size_limit }, + { "router_name", vtype_stringptr, &router_name }, { "runrc", vtype_int, &runrc }, { "self_hostname", vtype_stringptr, &self_hostname }, { "sender_address", vtype_stringptr, &sender_address }, @@ -667,6 +676,7 @@ static var_entry var_table[] = { { "tod_logfile", vtype_todlf, NULL }, { "tod_zone", vtype_todzone, NULL }, { "tod_zulu", vtype_todzulu, NULL }, + { "transport_name", vtype_stringptr, &transport_name }, { "value", vtype_stringptr, &lookup_value }, { "version_number", vtype_stringptr, &version_string }, { "warn_message_delay", vtype_stringptr, &warnmsg_delay }, @@ -1891,7 +1901,7 @@ DEBUG(D_expand) acl_narg>0 ? sub[1] : US"", acl_narg>1 ? " +more" : ""); -ret = acl_eval(acl_where, NULL, sub[0], user_msgp, &tmp); +ret = acl_eval(acl_where, sub[0], user_msgp, &tmp); for (i = 0; i < nsub; i++) acl_arg[i] = sub[i+1]; /* restore old args */ @@ -3389,12 +3399,12 @@ if (*error == NULL) * can just let the other invalid results occur otherwise, as they have * until now. For this one case, we can coerce. */ - if (y == -1 && x == LLONG_MIN && op != '*') + if (y == -1 && x == EXIM_ARITH_MIN && op != '*') { DEBUG(D_expand) debug_printf("Integer exception dodging: " PR_EXIM_ARITH "%c-1 coerced to " PR_EXIM_ARITH "\n", - LLONG_MIN, op, LLONG_MAX); - x = LLONG_MAX; + EXIM_ARITH_MIN, op, EXIM_ARITH_MAX); + x = EXIM_ARITH_MAX; continue; } if (op == '*') @@ -5656,6 +5666,22 @@ while (*s != 0) continue; } + /* Convert octets outside 0x21..0x7E to \xXX form */ + + case EOP_HEXQUOTE: + { + uschar *t = sub - 1; + while (*(++t) != 0) + { + if (*t < 0x21 || 0x7E < *t) + yield = string_cat(yield, &size, &ptr, + string_sprintf("\\x%02x", *t), 4); + else + yield = string_cat(yield, &size, &ptr, t, 1); + } + continue; + } + /* count the number of list elements */ case EOP_LISTCOUNT: @@ -6514,17 +6540,17 @@ else default: break; case 'k': - if (value > LLONG_MAX/1024 || value < LLONG_MIN/1024) errno = ERANGE; + if (value > EXIM_ARITH_MAX/1024 || value < EXIM_ARITH_MIN/1024) errno = ERANGE; else value *= 1024; endptr++; break; case 'm': - if (value > LLONG_MAX/(1024*1024) || value < LLONG_MIN/(1024*1024)) errno = ERANGE; + if (value > EXIM_ARITH_MAX/(1024*1024) || value < EXIM_ARITH_MIN/(1024*1024)) errno = ERANGE; else value *= 1024*1024; endptr++; break; case 'g': - if (value > LLONG_MAX/(1024*1024*1024) || value < LLONG_MIN/(1024*1024*1024)) errno = ERANGE; + if (value > EXIM_ARITH_MAX/(1024*1024*1024) || value < EXIM_ARITH_MIN/(1024*1024*1024)) errno = ERANGE; else value *= 1024*1024*1024; endptr++; break;