X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/d5b80e59458182b2d557a929a18cb8c70cd56b68..0ae2cff689a193dcab8f6b9fb73d7de1f847ad1b:/src/src/dmarc.c diff --git a/src/src/dmarc.c b/src/src/dmarc.c index 704b0c88d..0032afe87 100644 --- a/src/src/dmarc.c +++ b/src/src/dmarc.c @@ -12,7 +12,7 @@ #include "exim.h" #ifdef EXPERIMENTAL_DMARC -# if !defined EXPERIMENTAL_SPF +# if !defined SUPPORT_SPF # error SPF must also be enabled for DMARC # elif defined DISABLE_DKIM # error DKIM must also be enabled for DMARC @@ -79,12 +79,12 @@ return eblock; messages on the same SMTP connection (that come from the same host with the same HELO string) */ -int dmarc_init() +int +dmarc_init() { int *netmask = NULL; /* Ignored */ int is_ipv6 = 0; -char *tld_file = (dmarc_tld_file == NULL) ? - DMARC_TLD_FILE : CS dmarc_tld_file; +char *tld_file = dmarc_tld_file ? CS dmarc_tld_file : DMARC_TLD_FILE; /* Set some sane defaults. Also clears previous results when * multiple messages in one connection. */ @@ -330,7 +330,7 @@ if (!dmarc_abort && !sender_host_authenticated) while (sig) { int dkim_result, dkim_ares_result, vs, ves; - vs = sig->verify_status; + vs = sig->verify_status & ~PDKIM_VERIFY_POLICY; ves = sig->verify_ext_status; dkim_result = vs == PDKIM_VERIFY_PASS ? DMARC_POLICY_DKIM_OUTCOME_PASS : vs == PDKIM_VERIFY_FAIL ? DMARC_POLICY_DKIM_OUTCOME_FAIL : @@ -505,11 +505,11 @@ if (!dmarc_history_file) history_file_fd = log_create(dmarc_history_file); if (history_file_fd < 0) -{ + { log_write(0, LOG_MAIN|LOG_PANIC, "failure to create DMARC history file: %s", dmarc_history_file); return DMARC_HIST_FILE_ERR; -} + } /* Generate the contents of the history file */ history_buffer = string_sprintf( @@ -575,31 +575,24 @@ else return DMARC_HIST_OK; } + uschar * dmarc_exim_expand_query(int what) { if (dmarc_disable_verify || !dmarc_pctx) return dmarc_exim_expand_defaults(what); -switch(what) - { - case DMARC_VERIFY_STATUS: - return(dmarc_status); - default: - return US""; - } +if (what == DMARC_VERIFY_STATUS) + return dmarc_status; +return US""; } uschar * dmarc_exim_expand_defaults(int what) { -switch(what) - { - case DMARC_VERIFY_STATUS: - return dmarc_disable_verify ? US"off" : US"none"; - default: - return US""; - } +if (what == DMARC_VERIFY_STATUS) + return dmarc_disable_verify ? US"off" : US"none"; +return US""; } uschar * @@ -639,7 +632,7 @@ if (header_from_sender) return hdr_tmp; } -# endif /* EXPERIMENTAL_SPF */ +# endif /* SUPPORT_SPF */ #endif /* EXPERIMENTAL_DMARC */ /* vi: aw ai sw=2 */