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-jsieve git commit: JSIEVE-107 Always do unfold headers to fix long header test match
Date Tue, 14 Mar 2017 06:23:14 GMT
Repository: james-jsieve
Updated Branches:
  refs/heads/JSIEVE-107 [created] 6c38b0683


JSIEVE-107 Always do unfold headers to fix long header test match


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

Branch: refs/heads/JSIEVE-107
Commit: da2d09edc0f5e5ca8435814152ba2c4fbc0349b2
Parents: aa74af6
Author: Daniele Depetrini <daniele.depetrini@infocert.it>
Authored: Tue Mar 29 18:31:46 2016 +0200
Committer: Laura Royet <lroyet@linagora.com>
Committed: Thu Jan 12 09:20:50 2017 +0100

----------------------------------------------------------------------
 .../org/apache/jsieve/util/check/ScriptCheckMailAdapter.java   | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-jsieve/blob/da2d09ed/util/src/main/java/org/apache/jsieve/util/check/ScriptCheckMailAdapter.java
----------------------------------------------------------------------
diff --git a/util/src/main/java/org/apache/jsieve/util/check/ScriptCheckMailAdapter.java b/util/src/main/java/org/apache/jsieve/util/check/ScriptCheckMailAdapter.java
index 58d089e..1f81402 100644
--- a/util/src/main/java/org/apache/jsieve/util/check/ScriptCheckMailAdapter.java
+++ b/util/src/main/java/org/apache/jsieve/util/check/ScriptCheckMailAdapter.java
@@ -33,6 +33,7 @@ import javax.mail.Message;
 import javax.mail.MessagingException;
 import java.io.IOException;
 import java.util.*;
+import javax.mail.internet.MimeUtility;
 
 /**
  * Checks script execution for an email. The wrapped email is set by called
@@ -137,7 +138,10 @@ public class ScriptCheckMailAdapter implements MailAdapter {
             try {
                 String[] values = mail.getHeader(name);
                 if (values != null) {
-                    result = Arrays.asList(values);
+                    //We need to do unfold headers here
+                    result = new LinkedList<String>();
+                    for (String value: values)
+                        result.add(MimeUtility.unfold(value));
                 }
             } catch (MessagingException e) {
                 throw new SieveMailException(e);


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