JAMES-1877 Inspection is not needed to see if 8 bit is supported

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

Branch: refs/heads/master
Commit: 63bb307449633acc0bfb2a0c9a7ac908ccead9e0
Parents: b839f8b
Author: Benoit Tellier <btell...@linagora.com>
Authored: Thu Dec 1 14:11:15 2016 +0700
Committer: Benoit Tellier <btell...@linagora.com>
Committed: Tue Jan 10 15:12:48 2017 +0700

----------------------------------------------------------------------
 .../mailets/remoteDelivery/DeliveryRunnable.java | 19 ++-----------------
 1 file changed, 2 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/63bb3074/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/remoteDelivery/DeliveryRunnable.java
----------------------------------------------------------------------
diff --git 
a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/remoteDelivery/DeliveryRunnable.java
 
b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/remoteDelivery/DeliveryRunnable.java
index cb189d0..ea35f7c 100644
--- 
a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/remoteDelivery/DeliveryRunnable.java
+++ 
b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/remoteDelivery/DeliveryRunnable.java
@@ -59,6 +59,7 @@ import com.sun.mail.smtp.SMTPTransport;
 public class DeliveryRunnable implements Runnable {
 
     public static final boolean PERMANENT_FAILURE = true;
+    public static final String BIT_MIME_8 = "8BITMIME";
     private final MailQueue queue;
     private final RemoteDeliveryConfiguration configuration;
     private final DNSService dnsServer;
@@ -407,7 +408,7 @@ public class DeliveryRunnable implements Runnable {
                         // that conversion, but it is required to be a 
rfc-compliant smtp server.
 
                         // Temporarily disabled. See JAMES-638
-                        if (!isSupports8bitmime(transport)) {
+                        if (!transport.supportsExtension(BIT_MIME_8)) {
                             try {
                                 convertTo7Bit(message);
                             } catch (IOException e) {
@@ -513,22 +514,6 @@ public class DeliveryRunnable implements Runnable {
         return null;
     }
 
-    private boolean isSupports8bitmime(SMTPTransport transport) {
-        boolean supports8bitmime = false;
-        try {
-            Method supportsExtension = 
transport.getClass().getMethod("supportsExtension", new Class[]{String.class});
-            supports8bitmime = (Boolean) supportsExtension.invoke(transport, 
"8BITMIME");
-        } catch (NoSuchMethodException nsme) {
-            // An SMTPAddressFailedException with no
-            // getAddress method.
-        } catch (IllegalAccessException iae) {
-        } catch (IllegalArgumentException iae) {
-        } catch (InvocationTargetException ite) {
-            // Other issues with getAddress invokation.
-        }
-        return supports8bitmime;
-    }
-
     private boolean handleTemporaryResolutionException(Mail mail, String host) 
{
         logger.info("Temporary problem looking up mail server for host: " + 
host);
         // temporary problems


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

Reply via email to