From 851c38287e9874500c8268439fa411af27897e52 Mon Sep 17 00:00:00 2001 From: adam Date: Sat, 1 Mar 2008 06:01:05 +0000 Subject: [PATCH] add allmail to gather copies of all messages passing through the server darcs-hash:20080301060105-5007d-c6d94c9062465ed68c7e72e84a4a1eeffbcc1a69.gz --- src/org/ibex/mail/SMTP.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/org/ibex/mail/SMTP.java b/src/org/ibex/mail/SMTP.java index 9ca85c8..64677a0 100644 --- a/src/org/ibex/mail/SMTP.java +++ b/src/org/ibex/mail/SMTP.java @@ -46,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 @@ -73,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 { -- 1.7.10.4