changeset 334:a4f2fda72422

missing ==0 testing for from header, we were scanning all the non-from headers
author Carl Byington <carl@five-ten-sg.com>
date Tue, 20 Dec 2016 09:20:15 -0800
parents 89574f8a2f64
children 354b15b8b263
files dnsbl.conf src/dnsbl.cpp
diffstat 2 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/dnsbl.conf	Mon Dec 19 17:11:39 2016 -0800
+++ b/dnsbl.conf	Tue Dec 20 09:20:15 2016 -0800
@@ -68,7 +68,12 @@
             some.spammer                require_signed  some.spammer    // reject if not signed
 
             adp.com                     require_signed  adp.com;
+            amazon.com                  require_signed  amazon.com;
             billpay.bankofamerica.com   require_signed  billpay.bankofamerica.com;
+            craigslist.org              require_signed  craigslist.org;
+            dhl.com                     require_signed  dhl.com;
+            dropbox.com                 require_signed  dropbox.com;
+            dvd.com                     require_signed  dvd.com
             e.statefarm.com             require_signed  e.statefarm.com;
             ealerts.bankofamerica.com   require_signed  ealerts.bankofamerica.com;
             ebay.com                    require_signed  ebay.com;
@@ -82,6 +87,7 @@
             linkedin.com                require_signed  linkedin.com;
             monster.com                 require_signed  monster.com;
             paypal.com                  require_signed  paypal.com;
+            paychex.com                 require_signed  paychex.com;
             r.groupon.com               require_signed  r.groupon.com;
             service.capitalone.com      require_signed  capitalone.com;
             support.facebook.com        require_signed  support.facebook.com;
--- a/src/dnsbl.cpp	Mon Dec 19 17:11:39 2016 -0800
+++ b/src/dnsbl.cpp	Tue Dec 20 09:20:15 2016 -0800
@@ -1500,7 +1500,8 @@
         }
     }
 
-    if ((priv.header_count > 2) && (strcasecmp(headerf, "from"))) {
+    // only look at the first from header
+    if ((priv.header_count > 2) && (!priv.fromaddr) && (strcasecmp(headerf, "from") == 0)) {
         const int nmatch = 2;
         regmatch_t match[nmatch];
         int err = regexec(&from_pattern, msg, nmatch, match, 0);
@@ -1512,11 +1513,6 @@
                 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