mirror of
https://github.com/moparisthebest/davmail
synced 2025-01-12 22:18:11 -05:00
IMAP: fix 3023386, support BODY.PEEK[1.MIME] partial fetch
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1123 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
795989445e
commit
c3430975c4
@ -158,7 +158,6 @@ public class EwsExchangeSession extends ExchangeSession {
|
||||
protected Message buildMessage(EWSMethod.Item response) throws URIException {
|
||||
Message message = new Message();
|
||||
|
||||
|
||||
message.size = response.getInt(FIELD_MAP.get("messageSize").getResponseName());
|
||||
message.uid = response.get(FIELD_MAP.get("uid").getResponseName());
|
||||
message.imapUid = response.getLong(FIELD_MAP.get("imapUid").getResponseName());
|
||||
|
@ -649,6 +649,10 @@ public class ImapConnection extends AbstractConnection {
|
||||
MimePart bodyPart = mimeMessage;
|
||||
String[] partIndexStrings = partIndexString.split("\\.");
|
||||
for (String subPartIndexString : partIndexStrings) {
|
||||
// ignore MIME subpart index, will return full part
|
||||
if ("MIME".equals(subPartIndexString)) {
|
||||
break;
|
||||
}
|
||||
int subPartIndex;
|
||||
// try to parse part index
|
||||
try {
|
||||
|
@ -224,6 +224,11 @@ public class TestImap extends AbstractDavMailTestCase {
|
||||
assertEquals(". OK UID FETCH completed",readFullAnswer("."));
|
||||
}
|
||||
|
||||
public void testPartialFetch() throws IOException {
|
||||
writeLine(". UID FETCH "+messageUid+" (BODY.PEEK[1.MIME])");
|
||||
assertEquals(". OK UID FETCH completed",readFullAnswer("."));
|
||||
}
|
||||
|
||||
|
||||
public void testDeleteFolder() throws IOException {
|
||||
writeLine(". DELETE testfolder");
|
||||
|
Loading…
Reference in New Issue
Block a user