advertise ESMTP
[org.ibex.mail.git] / src / org / ibex / mail / SMTP.java
index 22e1813..487d544 100644 (file)
@@ -14,6 +14,11 @@ import java.text.*;
 import javax.naming.*;
 import javax.naming.directory.*;
 
+// RFC's implemented
+// RFC2554: SMTP Service Extension for Authentication
+//     - did not implement section 5, though
+// RFC4616: SASL PLAIN
+
 // Note: we can't actually use status codes for feedback if we accept
 // multiple destination addresses...  a failure on one and success on
 // the other...
@@ -22,6 +27,9 @@ import javax.naming.directory.*;
 // FIXME: loop prevention
 // FIXME: probably need some throttling on outbound mail
 
+// FEATURE: public static boolean validate(Address a)
+// FEATURE: rate-limiting
+
 // FEATURE: infer messageid, date, if not present (?)
 // FEATURE: exponential backoff on retry time?
 // FEATURE: RFC2822, section 4.5.1: special "postmaster" address
@@ -53,8 +61,8 @@ public class SMTP {
             new Outgoing().start();
     }
 
-    public static void accept(Message m) throws IOException {
-        if (!m.envelopeTo.isLocal()) Outgoing.accept(m);
+    public static void enqueue(Message m) throws IOException {
+        if (!m.envelopeTo.isLocal()) Outgoing.enqueue(m);
         else                         Target.root.accept(m);
     }
 
@@ -80,7 +88,7 @@ public class SMTP {
         public void handleRequest(Connection conn) throws IOException {
             conn.setTimeout(5 * 60 * 1000);
             conn.setNewline("\r\n");
-            conn.println("220 " + conn.vhost + " SMTP " + this.getClass().getName());
+            conn.println("220 " + conn.vhost + " ESMTP " + this.getClass().getName());
             Address from = null;
             Vector to = new Vector();
             boolean ehlo = false;