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");