You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by si...@apache.org on 2016/07/29 11:58:05 UTC

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

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 <st...@sap.com>
Authored: Fri Jul 29 13:56:53 2016 +0200
Committer: Stephan Siano <st...@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