You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by no...@apache.org on 2006/11/20 10:27:22 UTC
svn commit: r477121 -
/james/server/trunk/src/java/org/apache/james/transport/mailets/RemoteDelivery.java
Author: norman
Date: Mon Nov 20 01:27:21 2006
New Revision: 477121
URL: http://svn.apache.org/viewvc?view=rev&rev=477121
Log:
Reset the errorMessage to 0 if a NumberFormatException get thrown while trying to parse the retrycount. This should never happen anyway if noone manipulate the mail object. Anyway we should take care
Modified:
james/server/trunk/src/java/org/apache/james/transport/mailets/RemoteDelivery.java
Modified: james/server/trunk/src/java/org/apache/james/transport/mailets/RemoteDelivery.java
URL: http://svn.apache.org/viewvc/james/server/trunk/src/java/org/apache/james/transport/mailets/RemoteDelivery.java?view=diff&rev=477121&r1=477120&r2=477121
==============================================================================
--- james/server/trunk/src/java/org/apache/james/transport/mailets/RemoteDelivery.java (original)
+++ james/server/trunk/src/java/org/apache/james/transport/mailets/RemoteDelivery.java Mon Nov 20 01:27:21 2006
@@ -149,7 +149,14 @@
public boolean accept (String key, String state, long lastUpdated, String errorMessage) {
if (state.equals(Mail.ERROR)) {
//Test the time...
- int retries = Integer.parseInt(errorMessage);
+ int retries = 0;
+
+ try {
+ retries = Integer.parseInt(errorMessage);
+ } catch (NumberFormatException e) {
+ // Something strange was happen with the errorMessage.. Ignore the Exception and try
+ // to deliver it now!
+ }
// If the retries count is 0 we should try to send the mail now!
if (retries == 0) return true;
@@ -804,7 +811,14 @@
mail.setErrorMessage("0");
mail.setLastUpdated(new Date());
}
- int retries = Integer.parseInt(mail.getErrorMessage());
+
+ int retries = 0;
+ try {
+ retries = Integer.parseInt(mail.getErrorMessage());
+ } catch (NumberFormatException e) {
+ // Something strange was happen with the errorMessage..
+ }
+
if (retries < maxRetries) {
logBuffer =
new StringBuffer(128)
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org