more fixups to MailingList
[org.ibex.mail.git] / src / org / ibex / mail / protocol / SMTP.java
index cbba7ea..af39827 100644 (file)
@@ -30,6 +30,11 @@ public class SMTP {
 
     static { new Thread() { public void run() { Outgoing.runq(); } }.start(); }
 
+    public static void accept(Message m) throws IOException {
+        if (!m.envelopeTo.isLocal()) Outgoing.accept(m);
+        else                         Target.root.accept(m);
+    }
+
     public static class SMTPException extends MailException {
         int code;
         String message;
@@ -108,8 +113,7 @@ public class SMTP {
                         Message m = null;
                         for(int i=0; i<to.size(); i++) {
                            m = Message.newMessage(new Fountain.StringFountain(body), from, (Address)to.elementAt(i));
-                            if (!m.envelopeTo.isLocal()) Outgoing.accept(m);
-                            else                         Target.root.accept(m);
+                            accept(m);
                        }
                         if (m != null) Log.info(SMTP.class, "accepted message: " + m.summary());
                         conn.println("250 message accepted");