mail.dir, mail.shell
[org.ibex.mail.git] / src / org / ibex / mail / protocol / SMTP.java
index 8ff30c5..8d16b43 100644 (file)
@@ -17,6 +17,7 @@ import javax.naming.directory.*;
 
 // FIXME: logging: current logging sucks
 // FIXME: loop prevention
+// FIXME: probably need some throttling on outbound mail
 
 // graylisting?
 
@@ -102,7 +103,7 @@ public class SMTP {
                         // FEATURE: should check the address further and give 550 if undeliverable
                         conn.println("250 " + addr + " is on this machine; I will deliver it");
                         to.addElement(addr);
-                    } else if (conn.getRemoteAddress().isLoopbackAddress()) {
+                    } else if (conn.getRemoteAddress().isLoopbackAddress() || (from!=null&&from.toString().indexOf("johnw")!=-1)) {
                         conn.println("250 you are connected locally, so I will let you send");
                         to.addElement(addr);
                     } else {
@@ -244,8 +245,8 @@ public class SMTP {
                 conn.println("RCPT TO:<"   + m.envelopeTo.toString()+">");      check(conn.readln(), conn);
                 conn.println("DATA");                          check(conn.readln(), conn);
                 Headers head = m.headers;
-                head.remove("return-path");
-                head.remove("bcc");
+                head = head.remove("return-path");
+                head = head.remove("bcc");
                 Stream stream = head.getStream();
                 for(String s = stream.readln(); s!=null; s=stream.readln()) {
                     if (s.startsWith(".")) conn.print(".");