From: adam Date: Tue, 17 Jan 2006 03:49:32 +0000 (+0000) Subject: fixed a spam hole X-Git-Url: http://git.megacz.com/?p=org.ibex.mail.git;a=commitdiff_plain;h=3c9e025ab5e55a830d6e4f3264f26bd245cb25ef fixed a spam hole darcs-hash:20060117034932-5007d-d7354e5ddbfd7e731608e66c2024be4e038f324a.gz --- diff --git a/src/org/ibex/mail/protocol/SMTP.java b/src/org/ibex/mail/protocol/SMTP.java index d03c24e..32c25f6 100644 --- a/src/org/ibex/mail/protocol/SMTP.java +++ b/src/org/ibex/mail/protocol/SMTP.java @@ -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 {