serge 2003/01/12 12:44:10 Modified: src/java/org/apache/james/transport/mailets RemoteDelivery.java Log: Split a heavy line into first declaring a boolean, and documenting what the boolean means. Revision Changes Path 1.38 +15 -8 jakarta-james/src/java/org/apache/james/transport/mailets/RemoteDelivery.java Index: RemoteDelivery.java =================================================================== RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/transport/mailets/RemoteDelivery.java,v retrieving revision 1.37 retrieving revision 1.38 diff -u -r1.37 -r1.38 --- RemoteDelivery.java 7 Jan 2003 12:02:13 -0000 1.37 +++ RemoteDelivery.java 12 Jan 2003 20:44:09 -0000 1.38 @@ -55,11 +55,11 @@ * You really want to read the JavaMail documentation if you are * working in here, and you will want to view the list of JavaMail * attributes, which are documented here: - * + * * http://java.sun.com/products/javamail/1.3/docs/javadocs/com/sun/mail/smtp/package-summary.html * * as well as other places. - * + * * @author Serge Knystautas <[EMAIL PROTECTED]> * @author Federico Barbieri <[EMAIL PROTECTED]> * @@ -258,7 +258,7 @@ log(exceptionBuffer.toString()); //Assume it is a permanent exception, or prove ourselves otherwise boolean permanent = true; - if ((me.getNextException() != null) && + if ((me.getNextException() != null) && (me.getNextException() instanceof java.io.IOException)) { //This is more than likely a temporary failure @@ -309,7 +309,14 @@ // possibilities //Unable to deliver message after numerous tries... fail accordingly - return failMessage(mail, ex, (('5' == ex.getMessage().charAt(0)) ? true : false)); + + //We check whether this is a 5xx error message, which indicates a permanent + // failure (like account doesn't exist or mailbox is full or domain is + // setup wrong). + boolean error5xx = ('5' == ex.getMessage().charAt(0)); + + //We fail permanently if this was a 5xx error + return failMessage(mail, ex, error5xx); } return true; } @@ -352,7 +359,7 @@ .append(mail.getName()) .append(" into outgoing after ") .append(retries) - .append(" retries"); + .append(" retries"); log(logBuffer.toString()); ++retries; mail.setErrorMessage(retries + ""); @@ -365,7 +372,7 @@ .append(mail.getName()) .append(" after ") .append(retries) - .append(" retries"); + .append(" retries"); log(logBuffer.toString()); } } @@ -569,7 +576,7 @@ String key = outgoing.accept(delayTime); try { if (isDebug) { - StringBuffer logMessageBuffer = + StringBuffer logMessageBuffer = new StringBuffer(128) .append(Thread.currentThread().getName()) .append(" will process mail ")
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>