# HG changeset patch # User Carl Byington # Date 1482110390 28800 # Node ID 51846836ec921a79a7d034170b1dc19b4e33e478 # Parent 5e4b5540c8cc9de6502a4ee05a806d97be34d0a4 allow multiple dkim signers in authentication results diff -r 5e4b5540c8cc -r 51846836ec92 src/dnsbl.cpp --- a/src/dnsbl.cpp Sun Dec 18 16:51:33 2016 -0800 +++ b/src/dnsbl.cpp Sun Dec 18 17:19:50 2016 -0800 @@ -1472,14 +1472,19 @@ if (priv.dkim_ok) { const int nmatch = 2; regmatch_t match[nmatch]; + int offset = 0; while (true) { - if (0 == regexec(&dkim_pattern, msg, nmatch, match, 0)) { + if (0 == regexec(&dkim_pattern, msg+offset, nmatch, match, 0)) { int s1 = match[1].rm_so; // domain int e1 = match[1].rm_eo; if (s1 != -1) { - msg[e1] = '\0'; - priv.dkim_signers.insert(strdup(msg+s1)); + char save = msg[offset+e1]; + msg[offset+e1] = '\0'; + priv.dkim_signers.insert(strdup(msg+offset+s1)); + msg[offset+e1] = save; + offset += e1 + 1; } + else break; } else break; } @@ -1860,7 +1865,7 @@ } // setup dkim signature detection - if (regcomp(&dkim_pattern, " dkim=pass .* header.d=([^ ]+) ", REG_ICASE | REG_EXTENDED)) { + if (regcomp(&dkim_pattern, " dkim=pass .[0-9]*-bit key. header.d=([^ ]+) ", REG_ICASE | REG_EXTENDED)) { printf("cannot compile regex pattern to find dkim signatures\n"); exit(3); }