From: adam Date: Sun, 21 Jan 2007 23:09:51 +0000 (+0000) Subject: do not challenge messages with no envelope-to or with an auto-submitted X-Git-Url: http://git.megacz.com/?p=org.ibex.mail.git;a=commitdiff_plain;h=d551e8ab37c017805f39ee0d089e073eb2f18e0c do not challenge messages with no envelope-to or with an auto-submitted darcs-hash:20070121230951-5007d-5aa27e1fcd99278d2ded1a4c681fa4c44b2d80e9.gz --- diff --git a/src/org/ibex/mail/Whitelist.java b/src/org/ibex/mail/Whitelist.java index c8f54ea..06724fe 100644 --- a/src/org/ibex/mail/Whitelist.java +++ b/src/org/ibex/mail/Whitelist.java @@ -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");