From: adam Date: Sat, 8 May 2004 01:08:35 +0000 (+0000) Subject: it compiles X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=a18d27681a90b7630234b278d2e09a1a1040eb8a;p=org.ibex.mail.git it compiles darcs-hash:20040508010835-5007d-b6e174251f3e09dc090ced44681a1ead84322964.gz --- diff --git a/mail.jar b/mail.jar index e5ad502..418b89d 100644 Binary files a/mail.jar and b/mail.jar differ diff --git a/src/org/ibex/mail/Message.java b/src/org/ibex/mail/Message.java index c593a8a..85ab516 100644 --- a/src/org/ibex/mail/Message.java +++ b/src/org/ibex/mail/Message.java @@ -9,7 +9,7 @@ import java.io.*; // soft line limit (suggested): 78 chars / hard line limit: 998 chars // folded headers: can insert CRLF anywhere that whitespace appears (before the whitespace) -// date/time parsing: see 3.3 +// date/time parsing: see spec, 3.3 // FEATURE: MIME RFC2045, 2046, 2049 // FEATURE: PGP-signature-parsing @@ -37,7 +37,7 @@ public class Message extends JSReflection { public final Address envelopeFrom; public final Address[] envelopeTo; - public final Date arrival = null; // when the message first arrived at this machine + public final Date arrival; // when the message first arrived at this machine public void dump(OutputStream os) throws IOException { Writer w = new OutputStreamWriter(os); @@ -47,6 +47,7 @@ public class Message extends JSReflection { w.flush(); } + /* public static class StoredMessage extends Message { public int uid; public boolean deleted = false; @@ -54,6 +55,7 @@ public class Message extends JSReflection { public boolean answered = false; public StoredMessage(LineReader rs) throws IOException, MailException.Malformed { super(rs); } } + */ public class Trace { final String returnPath; @@ -94,7 +96,7 @@ public class Message extends JSReflection { } public static class Malformed extends MailException.Malformed { public Malformed(String s) { super(s); } } - public Message(Address envelopeFrom, Address envelopeTo, LineReader rs) throws IOException, Malformed { + public Message(Address envelopeFrom, Address[] envelopeTo, LineReader rs) throws IOException, MailException.Malformed { this.envelopeFrom = envelopeFrom; this.envelopeTo = envelopeTo; this.arrival = new Date(); @@ -132,7 +134,7 @@ public class Message extends JSReflection { } } - this.date = headers.get("Date"); + this.date = (Date)headers.get("Date"); this.to = new Address((String)headers.get("To")); this.from = new Address((String)headers.get("From")); this.replyto = new Address((String)headers.get("Reply-To")); @@ -141,14 +143,14 @@ public class Message extends JSReflection { if (headers.get("Cc") != null) { StringTokenizer st = new StringTokenizer((String)headers.get("Cc")); this.cc = new Address[st.countTokens()]; - for(int i=0; i= 100) { - Log.warn("Message with " + m.traces.length + " trace hops; silently dropping\n" + m.summary()); + Log.warn(SMTP.Outgoing.class, + "Message with " + m.traces.length + " trace hops; silently dropping\n" + m.summary()); return; } synchronized(Outgoing.class) { - store.add(m); + FileSystem.root.slash("outgoing").add(m); queue.append(m); Outgoing.class.notify(); } } - private static boolean attempt(Message m) { - InetAddress[] mx = getMailExchangerIPs(m.envelopeTo.host); + // FIXME!!! ignores more than one destination envelope!!!! + private static boolean attempt(Message m) throws IOException { + InetAddress[] mx = getMailExchangerIPs(m.envelopeTo[0].host); if (mx.length == 0) { - Log.warn("could not resolve " + m.envelopeTo.host + "; bouncing it\n" + m.summary()); - send(m.bounce("could not resolve " + m.envelopeTo.host)); + Log.warn(SMTP.Outgoing.class, "could not resolve " + m.envelopeTo[0].host + "; bouncing it\n" + m.summary()); + send(m.bounce("could not resolve " + m.envelopeTo[0].host)); return true; } if (new Date().getTime() - m.arrival.getTime() > 1000 * 60 * 60 * 24 * 5) { - Log.warn("could not send message after 5 days; bouncing it\n" + m.summary()); + Log.warn(SMTP.Outgoing.class, "could not send message after 5 days; bouncing it\n" + m.summary()); send(m.bounce("could not send for 5 days")); return true; } for(int i=0; iserver which accepts requests sent via SMTP */ public class XMLRPC extends Target { }