BOOL
receive_check_fs(int msg_size)
{
-int_eximarith_t space;
int inodes;
if (check_spool_space > 0 || msg_size > 0 || check_spool_inodes > 0)
{
- space = receive_statvfs(TRUE, &inodes);
+ int_eximarith_t space = receive_statvfs(TRUE, &inodes);
DEBUG(D_receive)
debug_printf("spool directory space = " PR_EXIM_ARITH "K inodes = %d "
if (check_log_space > 0 || check_log_inodes > 0)
{
- space = receive_statvfs(FALSE, &inodes);
+ int_eximarith_t space = receive_statvfs(FALSE, &inodes);
DEBUG(D_receive)
debug_printf("log directory space = " PR_EXIM_ARITH "K inodes = %d "
/* Working header pointers */
rmark reset_point;
-header_line *next;
+header_line * next;
/* Flags for noting the existence of certain headers (only one left) */
/* Pointers to receive the addresses of headers whose contents we need. */
-header_line *from_header = NULL;
-header_line *subject_header = NULL;
-header_line *msgid_header = NULL;
-header_line *received_header;
+header_line * from_header = NULL;
+#ifdef SUPPORT_DMARC
+header_line * dmarc_from_header = NULL;
+#endif
+header_line * subject_header = NULL, * msgid_header = NULL, * received_header;
BOOL msgid_header_newly_created = FALSE;
/* Variables for use when building the Received: header. */
-uschar *timestamp;
+uschar * timestamp;
int tslen;
/* Time of creation of message_id */
if (isspace(*p)) break;
while (mac_isgraph(*p) && *p != ':') p++;
- while (isspace(*p)) p++;
- if (*p != ':')
+ if (Uskip_whitespace(&p) != ':')
{
body_zerocount = had_zero;
break;
case htype_from:
h->type = htype_from;
+#ifdef SUPPORT_DMARC
+ if (!is_resent) dmarc_from_header = h;
+#endif
if (!resents_exist || is_resent)
{
from_header = h;
if (!smtp_input)
{
int len;
- uschar *s = Ustrchr(h->text, ':') + 1;
- while (isspace(*s)) s++;
+ uschar * s = Ustrchr(h->text, ':') + 1;
+
+ Uskip_whitespace(&s);
len = h->slen - (s - h->text) - 1;
if (Ustrlen(originator_login) == len &&
strncmpic(s, originator_login, len) == 0)
{
- uschar *name = is_resent? US"Resent-From" : US"From";
+ uschar * name = is_resent ? US"Resent-From" : US"From";
header_add(htype_from, "%s: %s <%s@%s>\n", name, originator_name,
originator_login, qualify_domain_sender);
from_header = header_last;
if (filter_test != FTEST_NONE)
{
- uschar *start = h->text + 12;
- uschar *end = start + Ustrlen(start);
- while (isspace(*start)) start++;
+ uschar * start = h->text + 12;
+ uschar * end = start + Ustrlen(start);
+
+ Uskip_whitespace(&start);
while (end > start && isspace(end[-1])) end--;
if (*start == '<' && end[-1] == '>')
- {
- start++;
- end--;
- }
+ { start++; end--; }
return_path = string_copyn(start, end - start);
printf("Return-path taken from \"Return-path:\" header line\n");
}
(!contains_resent_headers || strncmpic(h->text, US"resent-", 7) == 0))
{
uschar * s = Ustrchr(h->text, ':') + 1;
- while (isspace(*s)) s++;
+ Uskip_whitespace(&s);
f.parse_allow_group = TRUE; /* Allow address group syntax */
/* Move on past this address */
s = ss + (*ss ? 1 : 0);
- while (isspace(*s)) s++;
+ Uskip_whitespace(&s);
} /* Next address */
f.parse_allow_group = FALSE; /* Reset group syntax flags */
#ifndef DISABLE_DKIM
if (!f.dkim_disable_verify)
{
- /* Finish verification */
+ /* Finish off the body hashes, calculate sigs and do compares */
dkim_exim_verify_finish();
/* Check if we must run the DKIM ACL */
{
uschar * dkim_verify_signers_expanded =
expand_string(dkim_verify_signers);
- gstring * results = NULL;
- int signer_sep = 0;
+ gstring * results = NULL, * seen_items = NULL;
+ int signer_sep = 0, old_pool = store_pool;
const uschar * ptr;
uschar * item;
- gstring * seen_items = NULL;
- int old_pool = store_pool;
store_pool = POOL_PERM; /* Allow created variables to live to data ACL */
"expansion of dkim_verify_signers option failed: %s",
expand_string_message);
- /* Default to OK when no items are present */
+ /* Loop over signers we want to verify, calling ACL. Default to OK
+ when no signers are present. Each call from here expands to a n ACL
+ call per matching sig in the message. */
+
rc = OK;
while ((item = string_nextinlist(&ptr, &signer_sep, NULL, 0)))
{
cancel_cutthrough_connection(TRUE, US"dkim acl not ok");
break;
}
+ else
+ if (dkim_verify_minimal && Ustrcmp(dkim_verify_status, "pass") == 0)
+ break;
}
dkim_verify_status = string_from_gstring(results);
store_pool = old_pool;
goto NOT_ACCEPTED; /* Skip to end of function */
}
}
- else
+ else /* No acl or no wanted signers */
dkim_exim_verify_log_all();
}
#endif /* DISABLE_DKIM */
#endif /* WITH_CONTENT_SCAN */
#ifdef SUPPORT_DMARC
- dmarc_store_data(from_header);
+ dmarc_store_data(dmarc_from_header);
#endif
#ifndef DISABLE_PRDR
}
/* End of receive.c */
+/* vi: se aw ai sw=2
+*/