git://git.exim.org
/
exim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tidying
[exim.git]
/
src
/
src
/
dmarc.c
diff --git
a/src/src/dmarc.c
b/src/src/dmarc.c
index 2fdc9eda3087a9290a9b0386c1ef694ed66f6cd0..6cb5b19fe38617c8491f21024b4ec2cdd19433dd 100644
(file)
--- a/
src/src/dmarc.c
+++ b/
src/src/dmarc.c
@@
-44,6
+44,7
@@
typedef struct dmarc_exim_p {
} dmarc_exim_p;
static dmarc_exim_p dmarc_policy_description[] = {
} dmarc_exim_p;
static dmarc_exim_p dmarc_policy_description[] = {
+ /* name value */
{ US"", DMARC_RECORD_P_UNSPECIFIED },
{ US"none", DMARC_RECORD_P_NONE },
{ US"quarantine", DMARC_RECORD_P_QUARANTINE },
{ US"", DMARC_RECORD_P_UNSPECIFIED },
{ US"none", DMARC_RECORD_P_NONE },
{ US"quarantine", DMARC_RECORD_P_QUARANTINE },
@@
-57,7
+58,7
@@
static dmarc_exim_p dmarc_policy_description[] = {
static error_block *
add_to_eblock(error_block *eblock, uschar *t1, uschar *t2)
{
static error_block *
add_to_eblock(error_block *eblock, uschar *t1, uschar *t2)
{
-error_block *eb = malloc(sizeof(error_block));
+error_block *eb =
store_
malloc(sizeof(error_block));
if (eblock == NULL)
eblock = eb;
else
if (eblock == NULL)
eblock = eb;
else
@@
-78,13
+79,12
@@
return eblock;
messages on the same SMTP connection (that come from the
same host with the same HELO string) */
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;
{
int *netmask = NULL; /* Ignored */
int is_ipv6 = 0;
-char *tld_file = (dmarc_tld_file == NULL) ?
- "/etc/exim/opendmarc.tlds" :
- (char *)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. */
/* Set some sane defaults. Also clears previous results when
* multiple messages in one connection. */
@@
-308,7
+308,7
@@
if (!dmarc_abort && !sender_host_authenticated)
sr == SPF_RESULT_PERMERROR ? ARES_RESULT_PERMERROR :
ARES_RESULT_UNKNOWN;
origin = DMARC_POLICY_SPF_ORIGIN_MAILFROM;
sr == SPF_RESULT_PERMERROR ? ARES_RESULT_PERMERROR :
ARES_RESULT_UNKNOWN;
origin = DMARC_POLICY_SPF_ORIGIN_MAILFROM;
- spf_human_readable =
(uschar *)
spf_response->header_comment;
+ spf_human_readable =
US
spf_response->header_comment;
DEBUG(D_receive)
debug_printf("DMARC using SPF sender domain = %s\n", spf_sender_domain);
}
DEBUG(D_receive)
debug_printf("DMARC using SPF sender domain = %s\n", spf_sender_domain);
}
@@
-336,7
+336,7
@@
if (!dmarc_abort && !sender_host_authenticated)
vs == PDKIM_VERIFY_FAIL ? DMARC_POLICY_DKIM_OUTCOME_FAIL :
vs == PDKIM_VERIFY_INVALID ? DMARC_POLICY_DKIM_OUTCOME_TMPFAIL :
DMARC_POLICY_DKIM_OUTCOME_NONE;
vs == PDKIM_VERIFY_FAIL ? DMARC_POLICY_DKIM_OUTCOME_FAIL :
vs == PDKIM_VERIFY_INVALID ? DMARC_POLICY_DKIM_OUTCOME_TMPFAIL :
DMARC_POLICY_DKIM_OUTCOME_NONE;
- libdm_status = opendmarc_policy_store_dkim(dmarc_pctx,
(uschar *)
sig->domain,
+ libdm_status = opendmarc_policy_store_dkim(dmarc_pctx,
US
sig->domain,
dkim_result, US"");
DEBUG(D_receive)
debug_printf("DMARC adding DKIM sender domain = %s\n", sig->domain);
dkim_result, US"");
DEBUG(D_receive)
debug_printf("DMARC adding DKIM sender domain = %s\n", sig->domain);
@@
-400,7
+400,7
@@
if (!dmarc_abort && !sender_host_authenticated)
/* Can't use exim's string manipulation functions so allocate memory
* for libopendmarc using its max hostname length definition. */
/* Can't use exim's string manipulation functions so allocate memory
* for libopendmarc using its max hostname length definition. */
- uschar *dmarc_domain =
(uschar *)
calloc(DMARC_MAXHOSTNAMELEN, sizeof(uschar));
+ uschar *dmarc_domain =
US
calloc(DMARC_MAXHOSTNAMELEN, sizeof(uschar));
libdm_status = opendmarc_policy_fetch_utilized_domain(dmarc_pctx,
dmarc_domain, DMARC_MAXHOSTNAMELEN-1);
dmarc_used_domain = string_copy(dmarc_domain);
libdm_status = opendmarc_policy_fetch_utilized_domain(dmarc_pctx,
dmarc_domain, DMARC_MAXHOSTNAMELEN-1);
dmarc_used_domain = string_copy(dmarc_domain);
@@
-505,11
+505,11
@@
if (!dmarc_history_file)
history_file_fd = log_create(dmarc_history_file);
if (history_file_fd < 0)
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;
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(
/* Generate the contents of the history file */
history_buffer = string_sprintf(
@@
-575,31
+575,24
@@
else
return DMARC_HIST_OK;
}
return DMARC_HIST_OK;
}
+
uschar *
dmarc_exim_expand_query(int what)
{
if (dmarc_disable_verify || !dmarc_pctx)
return dmarc_exim_expand_defaults(what);
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)
{
}
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 *
}
uschar *