X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fibex%2Fmail%2FSMTP.java;h=64677a0da11aaadefee509f2b6e36c8cd77b8e49;hb=851c38287e9874500c8268439fa411af27897e52;hp=a426987a7deee5c0f6dbd9876e8e06cf4500d1d0;hpb=36e19d8a6c5c04fc1d48c166ca7d951b763093a1;p=org.ibex.mail.git diff --git a/src/org/ibex/mail/SMTP.java b/src/org/ibex/mail/SMTP.java index a426987..64677a0 100644 --- a/src/org/ibex/mail/SMTP.java +++ b/src/org/ibex/mail/SMTP.java @@ -16,6 +16,9 @@ import javax.naming.directory.*; // FIXME: inbound throttling/ratelimiting +// "Address enumeration detection" -- notice when it looks like somebody +// is trying a raft of addresses. + // RFC's implemented // RFC2554: SMTP Service Extension for Authentication // - did not implement section 5, though @@ -43,6 +46,10 @@ public class SMTP { public static final SimpleDateFormat dateFormat = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss Z"); public static final int numOutgoingThreads = 5; + private static final SqliteMailbox allmail = + (SqliteMailbox)FileBasedMailbox + .getFileBasedMailbox("/afs/megacz.com/mail/user/megacz/allmail", false); + public static final int GRAYLIST_MINWAIT = 1000 * 60 * 60; // one hour public static final int GRAYLIST_MAXWAIT = 1000 * 60 * 60 * 24 * 5; // five days @@ -70,7 +77,16 @@ public class SMTP { public static void enqueue(Message m) throws IOException { if (!m.envelopeTo.isLocal()) Outgoing.enqueue(m); - else Target.root.accept(m); + else { + try { + allmail.accept(m); + } catch (Exception e) { + // FIXME incredibly gross hack + if (e.toString().indexOf("attempt to insert two messages with identical messageid")==-1) + Log.error(SMTP.class, e); + } + Target.root.accept(m); + } } public static class SMTPException extends MailException {