X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/b808677c8f0d6a1cf93ff75f4ad5b1199bd85311..dfbcb5ac660065b097b0ad0cb2c26357899f0c64:/src/src/expand.c diff --git a/src/src/expand.c b/src/src/expand.c index c7ebf9870..44e8e1ba0 100644 --- a/src/src/expand.c +++ b/src/src/expand.c @@ -103,6 +103,7 @@ alphabetical order. */ static uschar *item_table[] = { US"acl", + US"authresults", US"certextract", US"dlfunc", US"env", @@ -133,6 +134,7 @@ static uschar *item_table[] = { enum { EITEM_ACL, + EITEM_AUTHRESULTS, EITEM_CERTEXTRACT, EITEM_DLFUNC, EITEM_ENV, @@ -1656,6 +1658,24 @@ return yield; +/* Append an "iprev" element to an Autherntication-Results: header +if we have attempted to get the calling host's name. +*/ + +static gstring * +authres_iprev(gstring * g) +{ +if (sender_host_name) + return string_append(g, 3, US";\\n\\tiprev=pass (", sender_host_name, US")"); +if (host_lookup_deferred) + return string_catn(g, US";\\n\\tiprev=temperror", 21); +if (host_lookup_failed) + return string_catn(g, US";\\n\\tiprev=fail", 15); +return g; +} + + + /************************************************* * Return list of recipients * *************************************************/ @@ -4100,6 +4120,34 @@ while (*s != 0) } } + case EITEM_AUTHRESULTS: + /* ${authresults {mysystemname}} */ + { + uschar *sub_arg[1]; + + switch(read_subs(sub_arg, nelem(sub_arg), 1, &s, skipping, TRUE, name, + &resetok)) + { + case 1: goto EXPAND_FAILED_CURLY; + case 2: + case 3: goto EXPAND_FAILED; + } + + yield = string_append(yield, 3, + US"Authentication-Results: ", sub_arg[0], US"; none"); + yield->ptr -= 6; + + yield = authres_iprev(yield); + yield = authres_smtpauth(yield); +#ifdef SUPPORT_SPF + yield = authres_spf(yield); +#endif +#ifndef DISABLE_DKIM + yield = authres_dkim(yield); +#endif + continue; + } + /* Handle conditionals - preserve the values of the numerical expansion variables in case they get changed by a regular expression match in the condition. If not, they retain their external settings. At the end