camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From si...@apache.org
Subject camel git commit: CAMEL-10200: Fix failed unit test with workaround for javamail 1.4.7 bug
Date Fri, 29 Jul 2016 11:58:05 GMT
Repository: camel
Updated Branches:
  refs/heads/camel-2.16.x 06de3796e -> 7cdaf192a


CAMEL-10200: Fix failed unit test with workaround for javamail 1.4.7 bug

Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/7cdaf192
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/7cdaf192
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/7cdaf192

Branch: refs/heads/camel-2.16.x
Commit: 7cdaf192add6e45b97a1f49cd9677feb6503b568
Parents: 06de379
Author: Stephan Siano <stephan.siano@sap.com>
Authored: Fri Jul 29 13:56:53 2016 +0200
Committer: Stephan Siano <stephan.siano@sap.com>
Committed: Fri Jul 29 13:56:53 2016 +0200

----------------------------------------------------------------------
 .../main/java/org/apache/camel/component/mail/MailBinding.java    | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/7cdaf192/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailBinding.java
----------------------------------------------------------------------
diff --git a/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailBinding.java
b/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailBinding.java
index 8a2ee0a..8aa7d11 100644
--- a/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailBinding.java
+++ b/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailBinding.java
@@ -471,7 +471,8 @@ public class MailBinding {
                     // Create another body part
                     BodyPart messageBodyPart = new MimeBodyPart();
                     // Set the data handler to the attachment
-                    messageBodyPart.setDataHandler(handler);
+                    // workaround for javamail 1.4.7 bug: don't reuse the DataHandler
+                    messageBodyPart.setDataHandler(new DataHandler(handler.getDataSource()));
 
                     if (attachmentFilename.toLowerCase().startsWith("cid:")) {
                         // add a Content-ID header to the attachment


Mime
View raw message