diff src/dnsbl.cpp @ 293:fbbc341001cc

allow broken SRS0+ rather than the correct SRS0= tag
author Carl Byington <carl@five-ten-sg.com>
date Fri, 18 Jul 2014 15:01:27 -0700
parents 9f0d9fcb58dd
children 05b604c99e06
line wrap: on
line diff
--- a/src/dnsbl.cpp	Sat Jun 28 17:21:14 2014 -0700
+++ b/src/dnsbl.cpp	Fri Jul 18 15:01:27 2014 -0700
@@ -1106,13 +1106,13 @@
     for (int i=0; i<n; i++) key[i] = tolower(key[i]);
     if ((n > 14) && (strncmp(key, "srs", 3) == 0)) {
         // might have srs coding to be removed
-        const int nmatch = 6;
+        const int nmatch = 7;
         regmatch_t match[nmatch];
         if (0 == regexec(&srs_pattern, key, nmatch, match, 0)) {
-            int s4 = match[4].rm_so;    // domain
-            int e4 = match[4].rm_eo;
-            int s5 = match[5].rm_so;    // user
-            int e5 = match[5].rm_eo;
+            int s4 = match[5].rm_so;    // domain
+            int e4 = match[5].rm_eo;
+            int s5 = match[6].rm_so;    // user
+            int e5 = match[6].rm_eo;
             if ((s4 != -1) && (s5 != -1)) {
                 char *newkey = strdup(key);   // large enough
                 key[e4] = '\0';
@@ -1771,7 +1771,7 @@
     extern char *optarg;
 
     // setup srs coding detection
-    if (regcomp(&srs_pattern, "^srs(0|1)=([^=]+)=([^=]+)=([^=]+)=([^@]+)@", REG_ICASE | REG_EXTENDED)) {
+    if (regcomp(&srs_pattern, "^srs(0|1)(=|\+)([^=]+)=([^=]+)=([^=]+)=([^@]+)@", REG_ICASE | REG_EXTENDED)) {
         printf("cannot compile regex pattern to find srs coding in mail addresses\n");
         exit(3);
     }