do not challenge messages with no envelope-to or with an auto-submitted
authoradam <adam@megacz.com>
Sun, 21 Jan 2007 23:09:51 +0000 (23:09 +0000)
committeradam <adam@megacz.com>
Sun, 21 Jan 2007 23:09:51 +0000 (23:09 +0000)
darcs-hash:20070121230951-5007d-5aa27e1fcd99278d2ded1a4c681fa4c44b2d80e9.gz

src/org/ibex/mail/Whitelist.java

index c8f54ea..06724fe 100644 (file)
@@ -119,8 +119,16 @@ public class Whitelist {
             if (to==null) to = m.from;
             if (to==null) to = m.envelopeFrom;
 
-            // FIXME
-            //if (to==null) return ibex.mail.drop("message is missing a to/replyto/envelopeto header; cannot accept");
+            if (m.envelopeTo==null || m.envelopeTo.equals("null") || m.envelopeTo.equals("")) {
+                Log.warn(this, "message is missing a to/replyto/envelopeto header; cannot accept");
+                return;
+            }
+            if (m.headers.get("Auto-Submitted") != null &&
+                m.headers.get("Auto-Submitted").toLowerCase().indexOf("auto-replied")!=-1) {
+                Log.warn(this, "refusing to send a challenge to a message "+
+                         "with Auto-Submitted=\""+m.headers.get("Auto-Submitted")+"\"");
+                return;
+            }
 
             Address from = Address.parse("adam@megacz.com");