From 021d5641e5e1596a66e3efd223d1006ba8752d3e Mon Sep 17 00:00:00 2001 From: Apoorv Khatreja Date: Sun, 17 Jul 2011 01:40:20 +0530 Subject: [PATCH 01/13] ant astyle --- .../k9/activity/setup/AccountSettings.java | 4 ++-- src/com/fsck/k9/mail/internet/MimeUtility.java | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/com/fsck/k9/activity/setup/AccountSettings.java b/src/com/fsck/k9/activity/setup/AccountSettings.java index 38c9e38e0..1032291f6 100644 --- a/src/com/fsck/k9/activity/setup/AccountSettings.java +++ b/src/com/fsck/k9/activity/setup/AccountSettings.java @@ -884,8 +884,8 @@ public class AccountSettings extends K9PreferenceActivity { } } - allFolderValues = new String[folders.size()+1]; - allFolderLabels = new String[folders.size()+1]; + allFolderValues = new String[folders.size() + 1]; + allFolderLabels = new String[folders.size() + 1]; allFolderValues[0] = K9.FOLDER_NONE; allFolderLabels[0] = K9.FOLDER_NONE; diff --git a/src/com/fsck/k9/mail/internet/MimeUtility.java b/src/com/fsck/k9/mail/internet/MimeUtility.java index 0fd320c0a..54040a364 100644 --- a/src/com/fsck/k9/mail/internet/MimeUtility.java +++ b/src/com/fsck/k9/mail/internet/MimeUtility.java @@ -1076,7 +1076,7 @@ public class MimeUtility { */ if (contentTransferEncoding != null) { contentTransferEncoding = - MimeUtility.getHeaderParameter(contentTransferEncoding, null); + MimeUtility.getHeaderParameter(contentTransferEncoding, null); if ("quoted-printable".equalsIgnoreCase(contentTransferEncoding)) { in = new QuotedPrintableInputStream(in); } else if ("base64".equalsIgnoreCase(contentTransferEncoding)) { @@ -1102,7 +1102,7 @@ public class MimeUtility { * @throws MessagingException */ public static void collectParts(Part part, ArrayList viewables, - ArrayList attachments) throws MessagingException { + ArrayList attachments) throws MessagingException { /* * If the part is Multipart but not alternative it's either mixed or * something we don't know about, which means we treat it as mixed @@ -1326,10 +1326,10 @@ public class MimeUtility { private static String getJisVariantFromAddress(String address) { if (isInDomain(address, "docomo.ne.jp") || isInDomain(address, "dwmail.jp") || - isInDomain(address, "pdx.ne.jp") || isInDomain(address, "willcom.com")) + isInDomain(address, "pdx.ne.jp") || isInDomain(address, "willcom.com")) return "docomo"; else if (isInDomain(address, "softbank.ne.jp") || isInDomain(address, "vodafone.ne.jp") || - isInDomain(address, "disney.ne.jp") || isInDomain(address, "vertuclub.ne.jp")) + isInDomain(address, "disney.ne.jp") || isInDomain(address, "vertuclub.ne.jp")) return "softbank"; else if (isInDomain(address, "ezweb.ne.jp") || isInDomain(address, "ido.ne.jp")) return "kddi"; @@ -1364,14 +1364,14 @@ public class MimeUtility { // iso-2022-jp variants are supported by no versions as of Dec 2010. if (charset.length() > 19 && charset.startsWith("x-") && - charset.endsWith("-iso-2022-jp-2007") && !Charset.isSupported(charset)) { + charset.endsWith("-iso-2022-jp-2007") && !Charset.isSupported(charset)) { in = new Iso2022JpToShiftJisInputStream(in); charset = "x-" + charset.substring(2, charset.length() - 17) + "-shift_jis-2007"; } // shift_jis variants are supported by Eclair and later. if (charset.length() > 17 && charset.startsWith("x-") && - charset.endsWith("-shift_jis-2007") && !Charset.isSupported(charset)) { + charset.endsWith("-shift_jis-2007") && !Charset.isSupported(charset)) { // If the JIS variant is iPhone, map the Unicode private use area in iPhone to the one in Android after // converting the character set from the standard Shift JIS to Unicode. if (charset.substring(2, charset.length() - 15).equals("iphone")) @@ -1392,7 +1392,7 @@ public class MimeUtility { } if (!supported) { Log.e(K9.LOG_TAG, "I don't know how to deal with the charset " + charset + - ". Falling back to US-ASCII"); + ". Falling back to US-ASCII"); charset = "US-ASCII"; } /* @@ -2393,12 +2393,12 @@ public class MimeUtility { public static void setCharset(String charset, Part part) throws MessagingException { part.setHeader(MimeHeader.HEADER_CONTENT_TYPE, - part.getMimeType() + ";\n charset=" + getExternalCharset(charset)); + part.getMimeType() + ";\n charset=" + getExternalCharset(charset)); } public static String getExternalCharset(String charset) { if (charset.length() > 17 && charset.startsWith("x-") && - charset.endsWith("-shift_jis-2007")) + charset.endsWith("-shift_jis-2007")) return "shift_jis"; return charset; From c6a2cb48b178fd4bd3caa48af622b704eda07b30 Mon Sep 17 00:00:00 2001 From: Apoorv Khatreja Date: Sun, 17 Jul 2011 01:41:14 +0530 Subject: [PATCH 02/13] Added method to check for status response. --- src/com/fsck/k9/mail/store/ImapResponseParser.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/com/fsck/k9/mail/store/ImapResponseParser.java b/src/com/fsck/k9/mail/store/ImapResponseParser.java index f71951ddf..f18a04ce1 100644 --- a/src/com/fsck/k9/mail/store/ImapResponseParser.java +++ b/src/com/fsck/k9/mail/store/ImapResponseParser.java @@ -488,6 +488,15 @@ public class ImapResponseParser { } } + + public static boolean isStatusResponse(String symbol) { + return symbol.equalsIgnoreCase("OK") || + symbol.equalsIgnoreCase("NO") || + symbol.equalsIgnoreCase("BAD") || + symbol.equalsIgnoreCase("PREAUTH") || + symbol.equalsIgnoreCase("BYE"); + } + public static boolean equalsIgnoreCase(Object o1, Object o2) { if (o1 != null && o2 != null && o1 instanceof String && o2 instanceof String) { String s1 = (String)o1; From adc7d65d091de0b6e446d940bc87af4896e0ed8d Mon Sep 17 00:00:00 2001 From: Apoorv Khatreja Date: Sun, 17 Jul 2011 01:42:12 +0530 Subject: [PATCH 03/13] Newline :/ --- src/com/fsck/k9/mail/store/ImapResponseParser.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/com/fsck/k9/mail/store/ImapResponseParser.java b/src/com/fsck/k9/mail/store/ImapResponseParser.java index f18a04ce1..02f029f30 100644 --- a/src/com/fsck/k9/mail/store/ImapResponseParser.java +++ b/src/com/fsck/k9/mail/store/ImapResponseParser.java @@ -488,7 +488,6 @@ public class ImapResponseParser { } } - public static boolean isStatusResponse(String symbol) { return symbol.equalsIgnoreCase("OK") || symbol.equalsIgnoreCase("NO") || From 9335dacd463b4452fcc79d6cb1c191821d87ae42 Mon Sep 17 00:00:00 2001 From: Apoorv Khatreja Date: Tue, 2 Aug 2011 02:19:12 +0530 Subject: [PATCH 04/13] Added a separate handler for status responses to parse the resp-text tokens contained in these responses. --- .../k9/mail/store/ImapResponseParser.java | 44 +++++++++++++++++-- 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/src/com/fsck/k9/mail/store/ImapResponseParser.java b/src/com/fsck/k9/mail/store/ImapResponseParser.java index 02f029f30..c4ef06fd4 100644 --- a/src/com/fsck/k9/mail/store/ImapResponseParser.java +++ b/src/com/fsck/k9/mail/store/ImapResponseParser.java @@ -1,5 +1,9 @@ package com.fsck.k9.mail.store; +import android.text.TextUtils; +import android.util.Log; + +import com.fsck.k9.K9; import com.fsck.k9.mail.MessagingException; import com.fsck.k9.mail.filter.FixedLengthInputStream; import com.fsck.k9.mail.filter.PeekableInputStream; @@ -68,9 +72,21 @@ public class ImapResponseParser { private void readTokens(ImapResponse response) throws IOException { response.clear(); Object token; - while ((token = readToken(response)) != null) { - if (!(token instanceof ImapList)) { - response.add(token); + String firstString = parseAtom(); + + response.add(firstString); + + if (mIn.peek() == ' ') { + mIn.read(); //Skip space if parseAtom() didn't do it. + } + + if (isStatusResponse(firstString)) { + parseStatusResponse(response); + } else { + while ((token = readToken(response)) != null) { + if (!(token instanceof ImapList)) { + response.add(token); + } } /* @@ -85,6 +101,26 @@ public class ImapResponseParser { response.mCompleted = true; } + void parseStatusResponse(ImapResponse parent) throws IOException { + + int next = mIn.peek(); + if (next == '[') { + parseSequence(parent); + if (mIn.peek() == ' ') { // Skip following space + mIn.read(); + } + } + + String rest = readStringUntil('\r'); + expect('\n'); + + if (!TextUtils.isEmpty(rest)) { + // The rest is free-form text. + parent.add(rest); + } + + } + /** * Reads the next token of the response. The token can be one of: String - * for NIL, QUOTED, NUMBER, ATOM. Object - for LITERAL. @@ -488,7 +524,7 @@ public class ImapResponseParser { } } - public static boolean isStatusResponse(String symbol) { + public boolean isStatusResponse(String symbol) { return symbol.equalsIgnoreCase("OK") || symbol.equalsIgnoreCase("NO") || symbol.equalsIgnoreCase("BAD") || From 47bedec4106af7f4047c762dba536aa166718494 Mon Sep 17 00:00:00 2001 From: Apoorv Khatreja Date: Thu, 4 Aug 2011 23:30:27 +0530 Subject: [PATCH 05/13] Fixed an issue which caused space characters to throw exceptions when being parsed. Some cosmetic changes, and context sensitivity for EXISTS, RECENT and EXPUNGE responses which have empty token lists. --- .../k9/mail/store/ImapResponseParser.java | 38 ++++++++++--------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/src/com/fsck/k9/mail/store/ImapResponseParser.java b/src/com/fsck/k9/mail/store/ImapResponseParser.java index c4ef06fd4..d72dddd0f 100644 --- a/src/com/fsck/k9/mail/store/ImapResponseParser.java +++ b/src/com/fsck/k9/mail/store/ImapResponseParser.java @@ -72,31 +72,23 @@ public class ImapResponseParser { private void readTokens(ImapResponse response) throws IOException { response.clear(); Object token; - String firstString = parseAtom(); + String firstToken = (String) readToken(response); - response.add(firstString); + response.add(firstToken); - if (mIn.peek() == ' ') { - mIn.read(); //Skip space if parseAtom() didn't do it. - } + skipIfSpace(); - if (isStatusResponse(firstString)) { + if (isStatusResponse(firstToken)) { parseStatusResponse(response); } else { while ((token = readToken(response)) != null) { if (!(token instanceof ImapList)) { response.add(token); + if (isSizeOrExpungeResponse((String) token)) { + break; + } } } - - /* - * TODO: Check for responses ("OK", "PREAUTH", "BYE", "NO", "BAD") - * that can contain resp-text tokens. If found, hand over to a special - * method that parses a resp-text token. There's no need to use - * readToken()/parseToken() on that data. - * - * See RFC 3501, Section 9 Formal Syntax (resp-text) - */ } response.mCompleted = true; } @@ -106,9 +98,7 @@ public class ImapResponseParser { int next = mIn.peek(); if (next == '[') { parseSequence(parent); - if (mIn.peek() == ' ') { // Skip following space - mIn.read(); - } + skipIfSpace(); } String rest = readStringUntil('\r'); @@ -121,6 +111,12 @@ public class ImapResponseParser { } + void skipIfSpace() throws IOException { + if (mIn.peek() == ' ') { + expect(' '); + } + } + /** * Reads the next token of the response. The token can be one of: String - * for NIL, QUOTED, NUMBER, ATOM. Object - for LITERAL. @@ -532,6 +528,12 @@ public class ImapResponseParser { symbol.equalsIgnoreCase("BYE"); } + public boolean isSizeOrExpungeResponse(String symbol) { + return symbol.equalsIgnoreCase("EXISTS") || + symbol.equalsIgnoreCase("RECENT") || + symbol.equalsIgnoreCase("EXPUNGE"); + } + public static boolean equalsIgnoreCase(Object o1, Object o2) { if (o1 != null && o2 != null && o1 instanceof String && o2 instanceof String) { String s1 = (String)o1; From 688db057ac9c797021550e10c177273a611c3a79 Mon Sep 17 00:00:00 2001 From: cketti Date: Wed, 16 Nov 2011 02:51:46 +0100 Subject: [PATCH 06/13] Removed unused imports --- src/com/fsck/k9/mail/store/ImapResponseParser.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/com/fsck/k9/mail/store/ImapResponseParser.java b/src/com/fsck/k9/mail/store/ImapResponseParser.java index d72dddd0f..874230a64 100644 --- a/src/com/fsck/k9/mail/store/ImapResponseParser.java +++ b/src/com/fsck/k9/mail/store/ImapResponseParser.java @@ -1,9 +1,6 @@ package com.fsck.k9.mail.store; import android.text.TextUtils; -import android.util.Log; - -import com.fsck.k9.K9; import com.fsck.k9.mail.MessagingException; import com.fsck.k9.mail.filter.FixedLengthInputStream; import com.fsck.k9.mail.filter.PeekableInputStream; From 727c8564ec6d5eaae5dd67f210d2e78dd50c3677 Mon Sep 17 00:00:00 2001 From: cketti Date: Wed, 16 Nov 2011 03:10:26 +0100 Subject: [PATCH 07/13] Cleaned up readTokens() --- src/com/fsck/k9/mail/store/ImapResponseParser.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/com/fsck/k9/mail/store/ImapResponseParser.java b/src/com/fsck/k9/mail/store/ImapResponseParser.java index 874230a64..2f6a3d10b 100644 --- a/src/com/fsck/k9/mail/store/ImapResponseParser.java +++ b/src/com/fsck/k9/mail/store/ImapResponseParser.java @@ -68,16 +68,14 @@ public class ImapResponseParser { private void readTokens(ImapResponse response) throws IOException { response.clear(); - Object token; + String firstToken = (String) readToken(response); - response.add(firstToken); - skipIfSpace(); - if (isStatusResponse(firstToken)) { parseStatusResponse(response); } else { + Object token; while ((token = readToken(response)) != null) { if (!(token instanceof ImapList)) { response.add(token); @@ -92,6 +90,8 @@ public class ImapResponseParser { void parseStatusResponse(ImapResponse parent) throws IOException { + skipIfSpace(); + int next = mIn.peek(); if (next == '[') { parseSequence(parent); From 43f5cbb3612cca6af34b626f327188d644be19b4 Mon Sep 17 00:00:00 2001 From: cketti Date: Wed, 16 Nov 2011 03:11:35 +0100 Subject: [PATCH 08/13] Renamed parseStatusResponse() to parseResponseText() --- src/com/fsck/k9/mail/store/ImapResponseParser.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/fsck/k9/mail/store/ImapResponseParser.java b/src/com/fsck/k9/mail/store/ImapResponseParser.java index 2f6a3d10b..97072a657 100644 --- a/src/com/fsck/k9/mail/store/ImapResponseParser.java +++ b/src/com/fsck/k9/mail/store/ImapResponseParser.java @@ -73,7 +73,7 @@ public class ImapResponseParser { response.add(firstToken); if (isStatusResponse(firstToken)) { - parseStatusResponse(response); + parseResponseText(response); } else { Object token; while ((token = readToken(response)) != null) { @@ -88,7 +88,7 @@ public class ImapResponseParser { response.mCompleted = true; } - void parseStatusResponse(ImapResponse parent) throws IOException { + void parseResponseText(ImapResponse parent) throws IOException { skipIfSpace(); From f8779095d9c6860dcf17d4abccedd5390476200c Mon Sep 17 00:00:00 2001 From: cketti Date: Wed, 16 Nov 2011 03:17:36 +0100 Subject: [PATCH 09/13] Parse resp-text on command continuation requests --- src/com/fsck/k9/mail/store/ImapResponseParser.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/com/fsck/k9/mail/store/ImapResponseParser.java b/src/com/fsck/k9/mail/store/ImapResponseParser.java index 97072a657..328b3762c 100644 --- a/src/com/fsck/k9/mail/store/ImapResponseParser.java +++ b/src/com/fsck/k9/mail/store/ImapResponseParser.java @@ -47,8 +47,7 @@ public class ImapResponseParser { } else if (ch == '+') { response.mCommandContinuationRequested = parseCommandContinuationRequest(); - //TODO: Add special "resp-text" parsing - readTokens(response); + parseResponseText(response); } else { response.mTag = parseTaggedResponse(); readTokens(response); From e9b0f82c1126368fb4b8653e7b85a9f63eb9ad2a Mon Sep 17 00:00:00 2001 From: cketti Date: Wed, 16 Nov 2011 03:23:59 +0100 Subject: [PATCH 10/13] Minor code cleanup --- src/com/fsck/k9/mail/store/ImapResponseParser.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/com/fsck/k9/mail/store/ImapResponseParser.java b/src/com/fsck/k9/mail/store/ImapResponseParser.java index 328b3762c..1def9ec76 100644 --- a/src/com/fsck/k9/mail/store/ImapResponseParser.java +++ b/src/com/fsck/k9/mail/store/ImapResponseParser.java @@ -45,8 +45,7 @@ public class ImapResponseParser { parseUntaggedResponse(); readTokens(response); } else if (ch == '+') { - response.mCommandContinuationRequested = - parseCommandContinuationRequest(); + response.mCommandContinuationRequested = parseCommandContinuationRequest(); parseResponseText(response); } else { response.mTag = parseTaggedResponse(); @@ -87,8 +86,7 @@ public class ImapResponseParser { response.mCompleted = true; } - void parseResponseText(ImapResponse parent) throws IOException { - + private void parseResponseText(ImapResponse parent) throws IOException { skipIfSpace(); int next = mIn.peek(); @@ -104,10 +102,9 @@ public class ImapResponseParser { // The rest is free-form text. parent.add(rest); } - } - void skipIfSpace() throws IOException { + private void skipIfSpace() throws IOException { if (mIn.peek() == ' ') { expect(' '); } From 8cdd283bb8c31ebff18b6a7fa66f7103cb5ca1db Mon Sep 17 00:00:00 2001 From: cketti Date: Wed, 16 Nov 2011 03:59:27 +0100 Subject: [PATCH 11/13] Added Javadoc comment --- .../k9/mail/store/ImapResponseParser.java | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/com/fsck/k9/mail/store/ImapResponseParser.java b/src/com/fsck/k9/mail/store/ImapResponseParser.java index 1def9ec76..b38f779cf 100644 --- a/src/com/fsck/k9/mail/store/ImapResponseParser.java +++ b/src/com/fsck/k9/mail/store/ImapResponseParser.java @@ -86,6 +86,31 @@ public class ImapResponseParser { response.mCompleted = true; } + /** + * Parse {@code resp-text} tokens + * + *

+ * Responses "OK", "PREAUTH", "BYE", "NO", "BAD", and continuation request responses can + * contain {@code resp-text} tokens. We parse the {@code resp-text-code} part as tokens and + * read the rest as sequence of characters to avoid the parser interpreting things like + * "{123}" as start of a literal. + *

+ *

Example:

+ *

+ * {@code * OK [UIDVALIDITY 3857529045] UIDs valid} + *

+ *

+ * See RFC 3501, Section 9 Formal Syntax (resp-text) + *

+ * + * @param parent + * The {@link ImapResponse} instance that holds the parsed tokens of the response. + * + * @throws IOException + * If there's a network error. + * + * @see #isStatusResponse(String) + */ private void parseResponseText(ImapResponse parent) throws IOException { skipIfSpace(); From 1ab75f11f19f771f121a9c8eedf28f7c9db3704d Mon Sep 17 00:00:00 2001 From: cketti Date: Wed, 16 Nov 2011 04:34:38 +0100 Subject: [PATCH 12/13] Added simple unit tests for ImapResponseParser --- .../k9/mail/store/ImapResponseParserTest.java | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 tests/src/com/fsck/k9/mail/store/ImapResponseParserTest.java diff --git a/tests/src/com/fsck/k9/mail/store/ImapResponseParserTest.java b/tests/src/com/fsck/k9/mail/store/ImapResponseParserTest.java new file mode 100644 index 000000000..7353e23e7 --- /dev/null +++ b/tests/src/com/fsck/k9/mail/store/ImapResponseParserTest.java @@ -0,0 +1,67 @@ +package com.fsck.k9.mail.store; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import com.fsck.k9.mail.filter.PeekableInputStream; +import com.fsck.k9.mail.store.ImapResponseParser.ImapList; +import com.fsck.k9.mail.store.ImapResponseParser.ImapResponse; +import junit.framework.TestCase; + +public class ImapResponseParserTest extends TestCase { + + public void testSimpleOkResponse() throws IOException { + ImapResponseParser parser = createParser("* OK\r\n"); + ImapResponse response = parser.readResponse(); + + assertNotNull(response); + assertEquals(1, response.size()); + assertEquals("OK", response.get(0)); + } + + public void testOkResponseWithText() throws IOException { + ImapResponseParser parser = createParser("* OK Some text here\r\n"); + ImapResponse response = parser.readResponse(); + + assertNotNull(response); + assertEquals(2, response.size()); + assertEquals("OK", response.get(0)); + assertEquals("Some text here", response.get(1)); + } + + public void testOkResponseWithRespTextCode() throws IOException { + ImapResponseParser parser = createParser("* OK [UIDVALIDITY 3857529045]\r\n"); + ImapResponse response = parser.readResponse(); + + assertNotNull(response); + assertEquals(2, response.size()); + assertEquals("OK", response.get(0)); + assertTrue(response.get(1) instanceof ImapList); + + ImapList respTextCode = (ImapList) response.get(1); + assertEquals(2, respTextCode.size()); + assertEquals("UIDVALIDITY", respTextCode.get(0)); + assertEquals("3857529045", respTextCode.get(1)); + } + + public void testOkResponseWithRespTextCodeAndText() throws IOException { + ImapResponseParser parser = createParser("* OK [token1 token2] {x} test [...]\r\n"); + ImapResponse response = parser.readResponse(); + + assertNotNull(response); + assertEquals(3, response.size()); + assertEquals("OK", response.get(0)); + assertTrue(response.get(1) instanceof ImapList); + assertEquals("{x} test [...]", response.get(2)); + + ImapList respTextCode = (ImapList) response.get(1); + assertEquals(2, respTextCode.size()); + assertEquals("token1", respTextCode.get(0)); + assertEquals("token2", respTextCode.get(1)); + } + + private ImapResponseParser createParser(String response) { + ByteArrayInputStream in = new ByteArrayInputStream(response.getBytes()); + PeekableInputStream pin = new PeekableInputStream(in); + return new ImapResponseParser(pin); + } +} From 99163dc9b949a303a76de9cc438ceab5b368fbca Mon Sep 17 00:00:00 2001 From: cketti Date: Wed, 16 Nov 2011 04:48:50 +0100 Subject: [PATCH 13/13] Removed isSizeOrExpungeResponse() I don't understand what the purpose of this code was. It stopped parsing before the end of the line was reached, thus causing problems with parsing subsequent lines of the response. --- src/com/fsck/k9/mail/store/ImapResponseParser.java | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/com/fsck/k9/mail/store/ImapResponseParser.java b/src/com/fsck/k9/mail/store/ImapResponseParser.java index b38f779cf..e0853522e 100644 --- a/src/com/fsck/k9/mail/store/ImapResponseParser.java +++ b/src/com/fsck/k9/mail/store/ImapResponseParser.java @@ -77,9 +77,6 @@ public class ImapResponseParser { while ((token = readToken(response)) != null) { if (!(token instanceof ImapList)) { response.add(token); - if (isSizeOrExpungeResponse((String) token)) { - break; - } } } } @@ -546,12 +543,6 @@ public class ImapResponseParser { symbol.equalsIgnoreCase("BYE"); } - public boolean isSizeOrExpungeResponse(String symbol) { - return symbol.equalsIgnoreCase("EXISTS") || - symbol.equalsIgnoreCase("RECENT") || - symbol.equalsIgnoreCase("EXPUNGE"); - } - public static boolean equalsIgnoreCase(Object o1, Object o2) { if (o1 != null && o2 != null && o1 instanceof String && o2 instanceof String) { String s1 = (String)o1;