james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject [1/5] james-project git commit: JAMES-2253 addFooter mailet doesn't work for multipart mail
Date Thu, 04 Jan 2018 02:24:48 GMT
Repository: james-project
Updated Branches:
  refs/heads/master ab8ea00cd -> 7875cc08f


JAMES-2253 addFooter mailet doesn't work for multipart mail


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

Branch: refs/heads/master
Commit: 71284f56e30688df726aefc804176e357263052a
Parents: 214fc52
Author: apptaro <apptaro@gmail.com>
Authored: Mon Dec 18 15:20:18 2017 +0900
Committer: benwa <btellier@linagora.com>
Committed: Thu Jan 4 09:21:13 2018 +0700

----------------------------------------------------------------------
 .../org/apache/james/transport/mailets/AddFooter.java   | 12 ++++++++++--
 .../apache/james/transport/mailets/AddFooterTest.java   |  2 --
 2 files changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/71284f56/mailet/standard/src/main/java/org/apache/james/transport/mailets/AddFooter.java
----------------------------------------------------------------------
diff --git a/mailet/standard/src/main/java/org/apache/james/transport/mailets/AddFooter.java
b/mailet/standard/src/main/java/org/apache/james/transport/mailets/AddFooter.java
index 2161fbb..a1e20fa 100644
--- a/mailet/standard/src/main/java/org/apache/james/transport/mailets/AddFooter.java
+++ b/mailet/standard/src/main/java/org/apache/james/transport/mailets/AddFooter.java
@@ -93,11 +93,19 @@ public class AddFooter extends GenericMailet {
         if (part.isMimeType("multipart/mixed")
                 || part.isMimeType("multipart/related")) {
             MimeMultipart multipart = (MimeMultipart) part.getContent();
-            return attachFooterToFirstPart(multipart);
+            boolean added = attachFooterToFirstPart(multipart);
+            if (added) {
+            	part.setContent(multipart);
+            }
+            return added;
 
         } else if (part.isMimeType("multipart/alternative")) {
             MimeMultipart multipart = (MimeMultipart) part.getContent();
-            return attachFooterToAllSubparts(multipart);
+            boolean added = attachFooterToAllSubparts(multipart);
+            if (added) {
+            	part.setContent(multipart);
+            }
+            return added;
         }
         //Give up... we won't attach the footer to this MimePart
         return false;

http://git-wip-us.apache.org/repos/asf/james-project/blob/71284f56/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/AddFooterTest.java
----------------------------------------------------------------------
diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/AddFooterTest.java
b/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/AddFooterTest.java
index 9f8e512..5c43c22 100644
--- a/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/AddFooterTest.java
+++ b/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/AddFooterTest.java
@@ -42,7 +42,6 @@ import org.apache.mailet.base.test.FakeMail;
 import org.apache.mailet.base.test.MimeMessageBuilder;
 import org.junit.After;
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.TemporaryFolder;
@@ -138,7 +137,6 @@ public class AddFooterTest {
         }
     }
 
-    @Ignore("See JAMES-2253")
     @Test
     public void shouldAddFooterWhenMultipartMessage() throws Exception {
         MimeMessage message = MimeMessageBuilder.mimeMessageBuilder()


---------------------------------------------------------------------
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