james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rouaz...@apache.org
Subject [43/50] [abbrv] james-project git commit: JAMES-1877 Correct DNS error handling
Date Tue, 10 Jan 2017 14:18:58 GMT
JAMES-1877 Correct DNS error handling


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/d004e6ec
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/d004e6ec
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/d004e6ec

Branch: refs/heads/master
Commit: d004e6ec653156da13742248ed2e6c36786b650e
Parents: 9898e18
Author: Benoit Tellier <btellier@linagora.com>
Authored: Wed Dec 7 10:54:10 2016 +0700
Committer: Benoit Tellier <btellier@linagora.com>
Committed: Tue Jan 10 18:14:27 2017 +0700

----------------------------------------------------------------------
 .../james/transport/mailets/remoteDelivery/MailDelivrer.java      | 2 +-
 .../james/transport/mailets/remoteDelivery/MailDelivrerTest.java  | 3 ---
 2 files changed, 1 insertion(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/d004e6ec/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/remoteDelivery/MailDelivrer.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/remoteDelivery/MailDelivrer.java
b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/remoteDelivery/MailDelivrer.java
index 27f66aa..1dfc81b 100644
--- a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/remoteDelivery/MailDelivrer.java
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/remoteDelivery/MailDelivrer.java
@@ -263,7 +263,7 @@ public class MailDelivrer {
         MessagingException messagingException = new MessagingException("There are no DNS
entries for the hostname " + host + ".  I cannot determine where to send this message.");
         int retry = DeliveryRetriesHelper.retrieveRetries(mail);
         System.out.println("retyry " + retry);
-        if (retry == 0 || retry > configuration.getDnsProblemRetry()) {
+        if (retry >= configuration.getDnsProblemRetry()) {
             return logAndReturn(mail, ExecutionResult.permanentFailure(messagingException));
         } else {
             return logAndReturn(mail, ExecutionResult.temporaryFailure(messagingException));

http://git-wip-us.apache.org/repos/asf/james-project/blob/d004e6ec/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/remoteDelivery/MailDelivrerTest.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/remoteDelivery/MailDelivrerTest.java
b/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/remoteDelivery/MailDelivrerTest.java
index 27de817..3f7b726 100644
--- a/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/remoteDelivery/MailDelivrerTest.java
+++ b/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/remoteDelivery/MailDelivrerTest.java
@@ -37,7 +37,6 @@ import org.apache.mailet.base.MailAddressFixture;
 import org.apache.mailet.base.test.FakeMail;
 import org.apache.mailet.base.test.FakeMailetConfig;
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -223,7 +222,6 @@ public class MailDelivrerTest {
 
     @SuppressWarnings("deprecation")
     @Test
-    @Ignore("Fails if first delivery attempt")
     public void deliverShouldReturnTemporaryErrorWhenFirstDNSProblem() throws Exception {
         Mail mail = FakeMail.builder().recipients(MailAddressFixture.ANY_AT_JAMES, MailAddressFixture.OTHER_AT_JAMES).build();
         FakeMailetConfig mailetConfig = FakeMailetConfig.builder()
@@ -261,7 +259,6 @@ public class MailDelivrerTest {
 
     @SuppressWarnings("deprecation")
     @Test
-    @Ignore("One more failure is tolerated than specified by the configuration")
     public void deliverShouldReturnPermanentErrorWhenLimitDNSProblemReached() throws Exception
{
         Mail mail = FakeMail.builder().recipients(MailAddressFixture.ANY_AT_JAMES, MailAddressFixture.OTHER_AT_JAMES).build();
         FakeMailetConfig mailetConfig = FakeMailetConfig.builder()


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message