comparison src/dnsbl.cpp @ 356:90d433d1382e

when extracting header fields, need to preserve the header value since that will be used by subsequent (dcc,spamd,etc) milters
author Carl Byington <carl@five-ten-sg.com>
date Sun, 08 Jan 2017 21:13:01 -0800
parents 2fd904f2efc2
children ef7479b2d64f
comparison
equal deleted inserted replaced
355:90fdc4afba26 356:90d433d1382e
1512 regmatch_t match[nmatch]; 1512 regmatch_t match[nmatch];
1513 if (0 == regexec(&dkim_s_pattern, value, nmatch, match, 0)) { 1513 if (0 == regexec(&dkim_s_pattern, value, nmatch, match, 0)) {
1514 int s1 = match[1].rm_so; // domain 1514 int s1 = match[1].rm_so; // domain
1515 int e1 = match[1].rm_eo; 1515 int e1 = match[1].rm_eo;
1516 if (s1 != -1) { 1516 if (s1 != -1) {
1517 char save = value[e1];
1517 value[e1] = '\0'; 1518 value[e1] = '\0';
1518 priv.dkim_signers.insert(strdup(value+s1)); 1519 priv.dkim_signers.insert(strdup(value+s1));
1520 value[e1] = save;
1519 } 1521 }
1520 } 1522 }
1521 } 1523 }
1522 else priv.dkim_ok = false; 1524 else priv.dkim_ok = false;
1523 } 1525 }
1529 regmatch_t match[nmatch]; 1531 regmatch_t match[nmatch];
1530 if (0 == regexec(&from_pattern, value, nmatch, match, 0)) { 1532 if (0 == regexec(&from_pattern, value, nmatch, match, 0)) {
1531 int s1 = match[1].rm_so; // domain 1533 int s1 = match[1].rm_so; // domain
1532 int e1 = match[1].rm_eo; 1534 int e1 = match[1].rm_eo;
1533 if (s1 != -1) { 1535 if (s1 != -1) {
1536 char save = value[e1];
1534 value[e1] = '\0'; 1537 value[e1] = '\0';
1535 priv.fromaddr = to_lower_string(value+s1, false); 1538 priv.fromaddr = to_lower_string(value+s1, false);
1539 value[e1] = save;
1536 } 1540 }
1537 } 1541 }
1538 } 1542 }
1539 1543
1540 // headers that avoid autowhitelisting 1544 // headers that avoid autowhitelisting