reshuffling of file locations to make package structure flatter
[org.ibex.mail.git] / src / org / ibex / mail / SMTP.java
similarity index 97%
rename from src/org/ibex/mail/protocol/SMTP.java
rename to src/org/ibex/mail/SMTP.java
index 35855f1..22e1813 100644 (file)
@@ -2,8 +2,7 @@
 // Licensed under the Apache Public Source License 2.0 ("the License").
 // You may not use this file except in compliance with the License.
 
-package org.ibex.mail.protocol;
-import org.ibex.mail.*;
+package org.ibex.mail;
 import org.ibex.mail.target.*;
 import org.ibex.util.*;
 import org.ibex.net.*;
@@ -15,6 +14,10 @@ import java.text.*;
 import javax.naming.*;
 import javax.naming.directory.*;
 
+// Note: we can't actually use status codes for feedback if we accept
+// multiple destination addresses...  a failure on one and success on
+// the other...
+
 // FIXME: logging: current logging sucks
 // FIXME: loop prevention
 // FIXME: probably need some throttling on outbound mail
@@ -185,12 +188,12 @@ public class SMTP {
                         conn.println("250 message accepted");
                         conn.flush();
                         from = null; to = new Vector();
-                    } catch (Reject.RejectException re) {
+                    } catch (MailException.Malformed mfe) {    conn.println("501 " + mfe.toString());
+                    } catch (MailException.MailboxFull mbf) {  conn.println("452 " + mbf);
+                    } catch (Script.Later.LaterException le) { conn.println("453 try again later");
+                    } catch (Script.Reject.RejectException re) {
                        Log.warn(SMTP.class, "rejecting message due to: " + re.reason + "\n   " + re.m.summary());
                        conn.println("501 " + re.reason);
-                    } catch (MailException.Malformed mfe) {   conn.println("501 " + mfe.toString());
-                    } catch (MailException.MailboxFull mbf) { conn.println("452 " + mbf);
-                    } catch (Later.LaterException le) {       conn.println("453 try again later");
                     }
                 } else                    { conn.println("500 unrecognized command"); }                    
             } catch (Message.Malformed e) { conn.println("501 " + e.toString()); }