diff options
author | Todd Lyons <tlyons@exim.org> | 2014-05-28 05:12:00 -0700 |
---|---|---|
committer | Todd Lyons <tlyons@exim.org> | 2014-05-28 05:12:00 -0700 |
commit | d502442ac32f8964f6cf86469869cecb035d12c0 (patch) | |
tree | 02c71fa4ec000db2ad83d44306680920ca746cf0 | |
parent | 27520a688253e1f73c6f59b32312cdf2755aed2c (diff) | |
parent | 5b7a7c051c9ab9ee7c924a611f90ef2be03e0ad0 (diff) |
Merge tag 'exim-4_82_1'exim-4_83_RC1
Fix Conflicts:
src/src/dmarc.c
-rw-r--r-- | src/src/dmarc.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/src/src/dmarc.c b/src/src/dmarc.c index b2336b388..ca1c29bbb 100644 --- a/src/src/dmarc.c +++ b/src/src/dmarc.c @@ -181,20 +181,24 @@ int dmarc_process() { dmarc_abort = TRUE; else { - /* I strongly encourage anybody who can make this better to contact me directly! - * <cannonball> Is this an insane way to extract the email address from the From: header? - * <jgh_hm> it's sure a horrid layer-crossing.... - * <cannonball> I'm not denying that :-/ - * <jgh_hm> there may well be no better though - */ - header_from_sender = expand_string( - string_sprintf("${domain:${extract{1}{:}{${addresses:\\N%s\\N}}}}", - from_header->text) ); + uschar * errormsg; + int dummy, domain; + uschar * p; + uschar saveend; + + parse_allow_group = TRUE; + p = parse_find_address_end(from_header->text, FALSE); + saveend = *p; *p = '\0'; + if ((header_from_sender = parse_extract_address(from_header->text, &errormsg, + &dummy, &dummy, &domain, FALSE))) + header_from_sender += domain; + *p = saveend; + /* The opendmarc library extracts the domain from the email address, but * only try to store it if it's not empty. Otherwise, skip out of DMARC. */ - if ((header_from_sender == NULL) || (strcmp( CCS header_from_sender, "") == 0)) + if (!header_from_sender || (strcmp( CCS header_from_sender, "") == 0)) dmarc_abort = TRUE; - libdm_status = (dmarc_abort == TRUE) ? + libdm_status = dmarc_abort ? DMARC_PARSE_OKAY : opendmarc_policy_store_from_domain(dmarc_pctx, header_from_sender); if (libdm_status != DMARC_PARSE_OKAY) |