james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rouaz...@apache.org
Subject [05/10] james-project git commit: MAILET-100 To replace a header, AddSubjectPrefix is supposed to remove previous value
Date Mon, 05 Sep 2016 13:42:04 GMT
MAILET-100 To replace a header, AddSubjectPrefix is supposed to remove previous value


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

Branch: refs/heads/master
Commit: 27fb35de27718aeb41f97f6d38b72bca30a89c08
Parents: 1081d8f
Author: Matthieu Baechler <matthieu.baechler@linagora.com>
Authored: Tue Aug 30 15:34:24 2016 +0200
Committer: Matthieu Baechler <matthieu.baechler@linagora.com>
Committed: Mon Sep 5 14:17:51 2016 +0200

----------------------------------------------------------------------
 .../org/apache/james/transport/mailets/AddSubjectPrefix.java    | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/27fb35de/mailet/standard/src/main/java/org/apache/james/transport/mailets/AddSubjectPrefix.java
----------------------------------------------------------------------
diff --git a/mailet/standard/src/main/java/org/apache/james/transport/mailets/AddSubjectPrefix.java
b/mailet/standard/src/main/java/org/apache/james/transport/mailets/AddSubjectPrefix.java
index d155801..e923aaf 100644
--- a/mailet/standard/src/main/java/org/apache/james/transport/mailets/AddSubjectPrefix.java
+++ b/mailet/standard/src/main/java/org/apache/james/transport/mailets/AddSubjectPrefix.java
@@ -57,6 +57,11 @@ public class AddSubjectPrefix extends GenericMailet {
     public void service(Mail mail) throws MessagingException {
         MimeMessage m = mail.getMessage();
         String newSubject = prefixSubject(m);
+        replaceSubject(m, newSubject);
+    }
+
+    private void replaceSubject(MimeMessage m, String newSubject) throws MessagingException
{
+        m.setSubject(null);
         m.setSubject(newSubject, Charsets.UTF_8.displayName());
     }
 


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