[davmail] 01/01: fix IMAP FETCH missing headers because of the use of gnumail instead of javamail

Alexandre Rossi alexandre.rossi at gmail.com
Wed Nov 6 17:58:10 UTC 2013


This is an automated email from the git hooks/post-receive script.

niol-guest pushed a commit to branch master
in repository davmail.

commit a322fe6757f8de3268abb1ccef3f82280a07323a
Author: Alexandre Rossi <alexandre.rossi at gmail.com>
Date:   Wed Nov 6 18:57:27 2013 +0100

    fix IMAP FETCH missing headers because of the use of gnumail instead of javamail
---
 debian/patches/gnumail-fix |   39 +++++++++++++++++++++++++++++++++++++++
 debian/patches/series      |    1 +
 2 files changed, 40 insertions(+)

diff --git a/debian/patches/gnumail-fix b/debian/patches/gnumail-fix
new file mode 100644
index 0000000..be0f7ce
--- /dev/null
+++ b/debian/patches/gnumail-fix
@@ -0,0 +1,39 @@
+Description: Handle gnumail differences with javamail.
+Forwarded: not-needed
+Author: Alexandre Rossi <alexandre.rossi at gmail.com>
+
+Index: davmail.git/src/java/davmail/imap/ImapConnection.java
+===================================================================
+--- davmail.git.orig/src/java/davmail/imap/ImapConnection.java	2013-11-06 18:40:32.580149759 +0100
++++ davmail.git/src/java/davmail/imap/ImapConnection.java	2013-11-06 18:53:50.860188393 +0100
+@@ -846,6 +846,12 @@
+                     String partIndexString = StringUtil.getToken(param, "[", "]");
+                     if (("".equals(partIndexString) || partIndexString == null) && !"RFC822.HEADER".equals(param)) {
+                         // write message with headers
++                        Enumeration headerEnumeration = messageWrapper.getMatchingHeaderLines(null);
++                        while (headerEnumeration.hasMoreElements()) {
++                            baos.write(((String) headerEnumeration.nextElement()).getBytes("UTF-8"));
++                            baos.write(13);
++                            baos.write(10);
++                        }
+                         partOutputStream = new PartialOutputStream(baos, startIndex, maxSize);
+                         partInputStream = messageWrapper.getRawInputStream();
+                     } else if ("TEXT".equals(partIndexString)) {
+@@ -861,10 +867,6 @@
+                             baos.write(message.contentClass.getBytes("UTF-8"));
+                             baos.write(13);
+                             baos.write(10);
+-                        } else if (requestedHeaders == null) {
+-                            // load message and write all headers
+-                            partOutputStream = new PartOutputStream(baos, true, false, startIndex, maxSize);
+-                            partInputStream = messageWrapper.getRawInputStream();
+                         } else {
+                             Enumeration headerEnumeration = messageWrapper.getMatchingHeaderLines(requestedHeaders);
+                             while (headerEnumeration.hasMoreElements()) {
+@@ -1945,4 +1947,4 @@
+         }
+     }
+ 
+-}
+\ No newline at end of file
++}
diff --git a/debian/patches/series b/debian/patches/series
index 0568d89..271803d 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@
 0003-base64-enc-dec.patch
 0004-Set-classpath-add-target-davmail-lib.patch
 0005-Remove-Encoding-line-from-desktop-file-to-make-linti.patch
+gnumail-fix

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/davmail.git



More information about the pkg-java-commits mailing list