Skip to content

Commit

Permalink
Minor improvement regarding Exchange work-around for issue #945
Browse files Browse the repository at this point in the history
  • Loading branch information
jstedfast committed Dec 29, 2024
1 parent 9103b2f commit 30b32a9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions MailKit/Net/Imap/ImapUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -467,10 +467,10 @@ static string ReadFolderName (ImapEngine engine, char delim, string format, Canc
case ImapTokenType.Atom:
encodedName = (string) token.Value;

// Note: Exchange apparently doesn't quote folder names that contain tabs.
// Note: Exchange (Office365 and potentially 2016/2019/other versions) has a bug where it doesn't quote folder names that contain CTRL characters (including tab).
//
// See https://github.com/jstedfast/MailKit/issues/945 for details.
if (engine.QuirksMode == ImapQuirksMode.Exchange) {
if (token.Type == ImapTokenType.Atom && engine.QuirksMode == ImapQuirksMode.Exchange) {
var line = engine.ReadLine (cancellationToken);

// unget the \r\n sequence
Expand Down Expand Up @@ -502,10 +502,10 @@ static async Task<string> ReadFolderNameAsync (ImapEngine engine, char delim, st
case ImapTokenType.Atom:
encodedName = (string) token.Value;

// Note: Exchange apparently doesn't quote folder names that contain tabs.
// Note: Exchange (Office365 and potentially 2016/2019/other versions) has a bug where it doesn't quote folder names that contain CTRL characters (including tab).
//
// See https://github.com/jstedfast/MailKit/issues/945 for details.
if (engine.QuirksMode == ImapQuirksMode.Exchange) {
if (token.Type == ImapTokenType.Atom && engine.QuirksMode == ImapQuirksMode.Exchange) {
var line = await engine.ReadLineAsync (cancellationToken).ConfigureAwait (false);

// unget the \r\n sequence
Expand Down

0 comments on commit 30b32a9

Please sign in to comment.