This fixes RemoteDelivery so that an exception code of 5xx is treated as a
permanent exception, instead of a temporary exception, as called for by the
various RFCs.

        --- Noel

             //We should do a better job checking this... if the failure is
a general
             //connect exception, this is less descriptive than more
specific SMTP command
             //failure... have to lookup and see what are the various
Exception
-            //possibilities
+            //possibilities (see RFC 821 appendix E and 2821 4.2.1)

             //Unable to deliver message after numerous tries... fail
accordingly
-            return failMessage(mail, ex, false);
+            return failMessage(mail, ex, ('5' == ex.getMessage().charAt(0))
? true : false);

Anyone who wants to be more sophisticated is welcome to enhance this, but at
least this patch stops treating various permanent errors (e.g., 554) as
temporary.

        --- Noel
Index: src/java/org/apache/james/transport/mailets/RemoteDelivery.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-james/src/java/org/apache/james/transport/mailets/RemoteDelivery.java,v
retrieving revision 1.26
diff -u -r1.26 RemoteDelivery.java
--- src/java/org/apache/james/transport/mailets/RemoteDelivery.java     14 Sep 2002 
09:00:58 -0000      1.26
+++ src/java/org/apache/james/transport/mailets/RemoteDelivery.java     26 Sep 2002 
+22:42:17 -0000
@@ -305,10 +305,10 @@
             //We should do a better job checking this... if the failure is a general
             //connect exception, this is less descriptive than more specific SMTP 
command
             //failure... have to lookup and see what are the various Exception
-            //possibilities
+            //possibilities (see RFC 821 appendix E and 2821 4.2.1)
 
             //Unable to deliver message after numerous tries... fail accordingly
-            return failMessage(mail, ex, false);
+            return failMessage(mail, ex, ('5' == ex.getMessage().charAt(0)) ? true : 
+false);
         }
         return true;
     }

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to