1
0
mirror of https://github.com/moparisthebest/davmail synced 2024-12-13 11:12:22 -05:00

IMAP: fix 3106803, IMAP client stuck scanning Inbox, fix header and body fetch in same request

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1541 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2010-11-10 21:21:41 +00:00
parent e8a7e0b750
commit f4ad37ee6f
2 changed files with 6 additions and 1 deletions

View File

@ -678,7 +678,7 @@ public class ImapConnection extends AbstractConnection {
// get full param
if (param.indexOf('[') >= 0) {
StringBuilder paramBuffer = new StringBuilder(param);
while (paramTokens.hasMoreTokens() && param.indexOf(']') < 0) {
while (paramTokens.hasMoreTokens() && paramBuffer.indexOf("]") < 0) {
paramBuffer.append(' ').append(paramTokens.nextToken());
}
param = paramBuffer.toString();

View File

@ -289,6 +289,11 @@ public class TestImap extends AbstractDavMailTestCase {
assertEquals(". OK UID FETCH completed", readFullAnswer("."));
}
public void testHeaderBodyFetch() throws IOException {
writeLine(". UID FETCH " + messageUid + " (UID BODY.PEEK[HEADER.FIELDS (Content-Type Content-Transfer-Encoding)] BODY.PEEK[TEXT]<0.2048>)");
assertEquals(". OK UID FETCH completed", readFullAnswer("."));
}
public void testFetchInternalDate() throws IOException {
writeLine(". UID FETCH " + messageUid + " (INTERNALDATE)");
assertEquals(". OK UID FETCH completed", readFullAnswer("."));