diff src/dnsbl.cpp @ 230:ad38575e98ca

Prevent auto whitelisting due to outgoing multipart/report delivery notifications.
author Carl Byington <carl@five-ten-sg.com>
date Fri, 08 May 2009 12:55:30 -0700
parents 3fee608becbc
children 4d6bd04d93fa
line wrap: on
line diff
--- a/src/dnsbl.cpp	Sat Feb 07 11:31:59 2009 -0800
+++ b/src/dnsbl.cpp	Fri May 08 12:55:30 2009 -0700
@@ -271,7 +271,7 @@
     want_spamassassin   = false;
     want_dccgrey        = false;
     want_dccbulk        = false;
-    is_bulk_precedence  = false;
+    allow_autowhitelisting  = true;
     content_context     = NULL;
     memory              = NULL;
     scanner             = NULL;
@@ -323,7 +323,7 @@
         want_spamassassin   = false;
         want_dccgrey        = false;
         want_dccbulk        = false;
-        is_bulk_precedence  = false;
+        allow_autowhitelisting  = true;
         content_context     = NULL;
         memory              = NULL;
         scanner             = NULL;
@@ -1177,8 +1177,11 @@
 {
     mlfiPriv &priv = *MLFIPRIV;
     // detect precedence:bulk for avoiding autowhitelisting
-    if ((strcasecmp(headerf, "precedence") == 0) &&
-        (strcasecmp(headerv, "bulk") == 0)) priv.is_bulk_precedence = true;
+    if (((strcasecmp(headerf, "precedence") == 0)   && (strcasecmp(headerv, "bulk") == 0)) ||
+        ((strcasecmp(headerf, "content-type") == 0) && (strncasecmp(headerv, "multipart/report", 16) == 0))) {
+        priv.allow_autowhitelisting = false;
+    }
+
     // other headers are only needed for content filtering
     if (priv.authenticated)     return SMFIS_CONTINUE;
     if (priv.only_whites)       return SMFIS_CONTINUE;
@@ -1193,7 +1196,7 @@
     // delayed autowhitelisting
     while (!priv.delayer.empty()) {
         DELAYWHITEP dwp = priv.delayer.front();
-        if (!priv.is_bulk_precedence) {
+        if (priv.allow_autowhitelisting) {
             const char   *loto = dwp->get_loto();
             WHITELISTERP w     = dwp->get_w();
             CONTEXTP     con2  = dwp->get_con();