handle null-sender
authoradam <adam@megacz.com>
Wed, 11 Aug 2004 01:35:33 +0000 (01:35 +0000)
committeradam <adam@megacz.com>
Wed, 11 Aug 2004 01:35:33 +0000 (01:35 +0000)
darcs-hash:20040811013533-5007d-4f6cb67e879a6f51163332eb712cc5bda2387a47.gz

src/org/ibex/mail/protocol/SMTP.java

index 33ff3a5..8ee0ce3 100644 (file)
@@ -40,9 +40,11 @@ public class SMTP {
                 } else if (c.startsWith("NOOP")) { conn.println("250 OK");
                 } else if (c.startsWith("QUIT")) { conn.println("221 " + conn.vhost + " closing connection"); return;
                 } else if (c.startsWith("MAIL FROM:")) {
-                    conn.println("250 " + (from = new Address(command.substring(10).trim())) + " is syntactically correct");
+                    command = command.substring(10).trim();
+                    from = command.equals("<>") ? null : new Address(command);
+                    conn.println("250 " + from + " is syntactically correct");
                 } else if (c.startsWith("RCPT TO:")) {
-                    if (from == null) { conn.println("503 MAIL FROM must precede RCPT TO"); continue; }
+                    //if (from == null) { conn.println("503 MAIL FROM must precede RCPT TO"); continue; }
                     command = command.substring(8).trim();
                     if(command.indexOf(' ') != -1) command = command.substring(0, command.indexOf(' '));
                     Address addr = new Address(command);