mirror of
https://github.com/moparisthebest/davmail
synced 2025-01-08 04:08:12 -05:00
IMAP: fix missing headers with Outlook
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@2141 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
0f65595a7f
commit
7a371723ee
@ -1964,7 +1964,12 @@ public abstract class ExchangeSession {
|
||||
public Enumeration getMatchingHeaderLines(String[] headerNames) throws MessagingException, IOException {
|
||||
Enumeration result = getMatchingHeaderLinesFromHeaders(headerNames);
|
||||
if (result == null) {
|
||||
result = getMimeMessage().getMatchingHeaderLines(headerNames);
|
||||
if (headerNames == null) {
|
||||
result = getMimeMessage().getAllHeaderLines();
|
||||
} else {
|
||||
result = getMimeMessage().getMatchingHeaderLines(headerNames);
|
||||
}
|
||||
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@ -515,4 +515,30 @@ public class TestImap extends AbstractImapTestCase {
|
||||
assertEquals(". OK UID FETCH completed", readFullAnswer("."));
|
||||
}
|
||||
|
||||
public void testDoubleHeaderBodyFetch() throws IOException {
|
||||
writeLine(". SELECT INBOX");
|
||||
assertEquals(". OK [READ-WRITE] SELECT completed", readFullAnswer("."));
|
||||
writeLine(". UID FETCH 51241 BODY.PEEK[TEXT]");
|
||||
String line = socketReader.readLine();
|
||||
int size = 0;
|
||||
while (!line.startsWith(".")) {
|
||||
line = socketReader.readLine();
|
||||
size += line.length()+2;
|
||||
}
|
||||
System.out.println("actual size "+size);
|
||||
}
|
||||
|
||||
public void testBodyHeaderFetch() throws IOException {
|
||||
writeLine(". SELECT INBOX");
|
||||
assertEquals(". OK [READ-WRITE] SELECT completed", readFullAnswer("."));
|
||||
writeLine(". UID FETCH 1:* BODY[HEADER]");
|
||||
assertEquals(". OK UID FETCH completed", readFullAnswer("."));
|
||||
}
|
||||
|
||||
public void testOutlookHeaderFetch() throws IOException {
|
||||
writeLine(". SELECT INBOX");
|
||||
assertEquals(". OK [READ-WRITE] SELECT completed", readFullAnswer("."));
|
||||
writeLine(". UID FETCH 1:* (UID FLAGS RFC822.SIZE BODY.PEEK[HEADER] INTERNALDATE)");
|
||||
assertEquals(". OK UID FETCH completed", readFullAnswer("."));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user