fixed a spam hole
authoradam <adam@megacz.com>
Tue, 17 Jan 2006 03:49:32 +0000 (03:49 +0000)
committeradam <adam@megacz.com>
Tue, 17 Jan 2006 03:49:32 +0000 (03:49 +0000)
darcs-hash:20060117034932-5007d-d7354e5ddbfd7e731608e66c2024be4e038f324a.gz

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

index d03c24e..32c25f6 100644 (file)
@@ -93,7 +93,8 @@ public class SMTP {
                     if (addr.isLocal()) {
                         // FEATURE: should check the address further and give 550 if undeliverable
                         conn.println("250 " + addr + " is on this machine; I will deliver it");
-                    } else if (conn.getRemoteAddress().isLoopbackAddress())
+                        to.addElement(addr);
+                    } else if (conn.getRemoteAddress().isLoopbackAddress()) {
                         conn.println("250 you are connected locally, so I will let you send");
                         to.addElement(addr);
                     } else {
@@ -101,7 +102,7 @@ public class SMTP {
                     }
                 } else if (c.startsWith("DATA")) {
                     //if (from == null) { conn.println("503 MAIL FROM command must precede DATA"); continue; }
-                    if (to == null) { conn.println("503 RCPT TO command must precede DATA"); continue; }
+                    if (to == null || to.size()==0) { conn.println("503 RCPT TO command must precede DATA"); continue; }
                     conn.println("354 Enter message, ending with \".\" on a line by itself");
                     conn.flush();
                     try {