Hi Guys, During my testing in JAMES beta 5 trunk I've found bug causing an exception loop when processing messages.
To cause the loop throw an uncaught exception in any mailet without onMailetException=ignore attribute. After tracing through the code I think the problems with the handleException method in the ProcessorUtil class : /** * This is a helper method that updates the state of the mail object to * Mail.ERROR as well as recording the exception to the log * * @param me * the exception to be handled * @param mail * the mail being processed when the exception was generated * @param offendersName * the matcher or mailet than generated the exception * @param nextState * the next state to set * * @throws MessagingException * thrown always, rethrowing the passed in exception <--- WHY REMOVE? */ public static void handleException(MessagingException me, Mail mail, String offendersName, String nextState, Logger logger) throws MessagingException { mail.setState(nextState); StringWriter sout = new StringWriter(); PrintWriter out = new PrintWriter(sout, true); StringBuffer exceptionBuffer = new StringBuffer(128).append("Exception calling ").append(offendersName).append(": ").append(me.getMessage()); out.println(exceptionBuffer.toString()); Exception e = me; while (e != null) { e.printStackTrace(out); if (e instanceof MessagingException) { e = ((MessagingException) e).getNextException(); } else { e = null; } } String errorString = sout.toString(); mail.setErrorMessage(errorString); logger.error(errorString); //This line should be removed throw me; <--- REMOVE? } If I remove the last statement re-throwing the MessagingException , the exception is logged then passed to the error processor configured in your mailetcontainer.xml, which to me is the correct behaviour. --------------------------------------------------------------------- To unsubscribe, e-mail: server-user-unsubscr...@james.apache.org For additional commands, e-mail: server-user-h...@james.apache.org