X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fibex%2Fmail%2FMailingList.java;h=54fed952408c2fd083377211918b68f138cff08d;hb=4b76a31e8f86bc8de673899bbb45252c01e9a0f6;hp=0a2baa6e9c4ade5519e2415efaf61cef554ad2f6;hpb=5d04327679cf286064528beb2d3e9031695679c9;p=org.ibex.mail.git diff --git a/src/org/ibex/mail/MailingList.java b/src/org/ibex/mail/MailingList.java index 0a2baa6..54fed95 100644 --- a/src/org/ibex/mail/MailingList.java +++ b/src/org/ibex/mail/MailingList.java @@ -13,6 +13,10 @@ import java.net.*; import javax.servlet.*; import javax.servlet.http.*; +// TODO: RFC 2369 +// TODO: RFC 2919 + +// FEATURE: store interesting/important stuff in sqlite public class MailingList extends Mailbox.MailboxWrapper { // FIXME @@ -188,9 +192,11 @@ public class MailingList extends Mailbox.MailboxWrapper { try { StringBuffer buf = new StringBuffer(); m.getBody().getStream().transcribe(buf); - Headers head = new Headers.Original(m.headers.getStream()); - head = head.set("List-Id", one_line_description + "<"+address+">"); - head = head.set("Subject", properties.get("prefix") + " " + head.get("Subject")); + Headers head = new Headers(m.headers, + new String[] { + "List-Id", one_line_description + "<"+address+">", + "Subject", properties.get("prefix") + " " + m.headers.get("Subject") + }); m = Message.newMessage(Fountain.Util.concat(new Fountain[] { head, Fountain.Util.create("\r\n"), @@ -200,7 +206,7 @@ public class MailingList extends Mailbox.MailboxWrapper { for(Subscriber s : subscribers()) try { Log.warn(MailingList.class, " trying " + s.address); - SMTP.enqueue(Message.newMessage(m, m.envelopeFrom, s.address)); + SMTP.enqueue(m.withEnvelope(m.envelopeFrom, s.address)); Log.warn("[list]", "successfully sent to " + s); } catch (Exception e2) { Log.error("[list]", e2); } } catch (Exception e) { throw new RuntimeException(e); }