projects
/
org.ibex.mail.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add allmail to gather copies of all messages passing through the server
[org.ibex.mail.git]
/
src
/
org
/
ibex
/
mail
/
SMTP.java
diff --git
a/src/org/ibex/mail/SMTP.java
b/src/org/ibex/mail/SMTP.java
index
a426987
..
64677a0
100644
(file)
--- 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
// 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
// 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;
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
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);
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 {
}
public static class SMTPException extends MailException {