IMAP: new header fix, do not rely on messageheaders attribute on full headers request, load message

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@2152 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2013-06-20 20:55:41 +00:00
parent 2fe8bf6ce7
commit d8aceb0edb
1 changed files with 5 additions and 1 deletions

View File

@ -861,6 +861,10 @@ public class ImapConnection extends AbstractConnection {
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()) {
@ -927,7 +931,7 @@ public class ImapConnection extends AbstractConnection {
buffer.append(" {").append(baos.size()).append('}');
sendClient(buffer.toString());
// log content if less than 2K
if (LOGGER.isDebugEnabled() /*&& baos.size() < 2048*/) {
if (LOGGER.isDebugEnabled() && baos.size() < 2048) {
LOGGER.debug(new String(baos.toByteArray(), "UTF-8"));
}
os.write(baos.toByteArray());