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 {
}
} 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 {