Skip to content

Commit 7fd6e96

Browse files
authored
Use case-insensitive comparison for a few IMAP keywords (#2013)
Most were already case-insensitive, but a few weren't. This change brings those into line. This fixes s1t5/mail-archiver#511
1 parent 0d66c84 commit 7fd6e96

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

MailKit/Net/Imap/ImapFolderSearch.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ static void ParseESearchResults (ImapEngine engine, ImapCommand ic, SearchResult
479479

480480
atom = (string) token.Value;
481481

482-
if (atom == "TAG") {
482+
if (atom.Equals ("TAG", StringComparison.OrdinalIgnoreCase)) {
483483
token = engine.ReadToken (ic.CancellationToken);
484484

485485
ImapEngine.AssertToken (token, ImapTokenType.Atom, ImapTokenType.QString, ImapEngine.GenericUntaggedResponseSyntaxErrorFormat, "ESEARCH", token);
@@ -494,7 +494,7 @@ static void ParseESearchResults (ImapEngine engine, ImapCommand ic, SearchResult
494494
token = engine.ReadToken (ic.CancellationToken);
495495
}
496496

497-
if (token.Type == ImapTokenType.Atom && ((string) token.Value) == "UID") {
497+
if (token.Type == ImapTokenType.Atom && ((string) token.Value).Equals ("UID", StringComparison.OrdinalIgnoreCase)) {
498498
token = engine.ReadToken (ic.CancellationToken);
499499
//uid = true;
500500
}
@@ -632,7 +632,7 @@ static async Task ParseESearchResultsAsync (ImapEngine engine, ImapCommand ic, S
632632

633633
atom = (string) token.Value;
634634

635-
if (atom == "TAG") {
635+
if (atom.Equals ("TAG", StringComparison.OrdinalIgnoreCase)) {
636636
token = await engine.ReadTokenAsync (ic.CancellationToken).ConfigureAwait (false);
637637

638638
ImapEngine.AssertToken (token, ImapTokenType.Atom, ImapTokenType.QString, ImapEngine.GenericUntaggedResponseSyntaxErrorFormat, "ESEARCH", token);
@@ -647,7 +647,7 @@ static async Task ParseESearchResultsAsync (ImapEngine engine, ImapCommand ic, S
647647
token = await engine.ReadTokenAsync (ic.CancellationToken).ConfigureAwait (false);
648648
}
649649

650-
if (token.Type == ImapTokenType.Atom && ((string) token.Value) == "UID") {
650+
if (token.Type == ImapTokenType.Atom && ((string) token.Value).Equals ("UID", StringComparison.OrdinalIgnoreCase)) {
651651
token = await engine.ReadTokenAsync (ic.CancellationToken).ConfigureAwait (false);
652652
//uid = true;
653653
}

0 commit comments

Comments
 (0)