# HG changeset patch # User Carl Byington # Date 1482196299 28800 # Node ID 89574f8a2f640c08602ec599a1661b71e73692fc # Parent ed04479a8e1205ce0948b7f36a04a24feb2195f9 log regexec error extracting domain from header diff -r ed04479a8e12 -r 89574f8a2f64 src/dnsbl.cpp --- a/src/dnsbl.cpp Mon Dec 19 16:35:49 2016 -0800 +++ b/src/dnsbl.cpp Mon Dec 19 17:11:39 2016 -0800 @@ -1503,7 +1503,8 @@ if ((priv.header_count > 2) && (strcasecmp(headerf, "from"))) { const int nmatch = 2; regmatch_t match[nmatch]; - if (0 == regexec(&from_pattern, msg, nmatch, match, 0)) { + int err = regexec(&from_pattern, msg, nmatch, match, 0); + if (err == 0) { int s1 = match[1].rm_so; // domain int e1 = match[1].rm_eo; if (s1 != -1) { @@ -1511,6 +1512,11 @@ priv.fromaddr = strdup(msg+s1); } } + else { + char buf[maxlen]; + size_t n = regerror(err, &from_pattern, buf, maxlen); + my_syslog(&priv, buf); + } } // headers that avoid autowhitelisting