-
-
Notifications
You must be signed in to change notification settings - Fork 862
Description
Describe the bug
When I try to fetch messages "client.Inbox.Fetch(startIndex, -1, request, cancel.Token);" I got error
Platform (please complete the following information):
Microsoft.NETCore.App.Ref\7.0.20
Exception
à MailKit.Net.Imap.ImapUtils.ReadStringToken(ImapEngine engine, String format, CancellationToken cancellationToken)
à MailKit.Net.Imap.ImapUtils.ParseContentType(ImapEngine engine, String format, CancellationToken cancellationToken)
à MailKit.Net.Imap.ImapUtils.ParseBody(ImapEngine engine, String format, String path, CancellationToken cancellationToken)
à MailKit.Net.Imap.ImapUtils.ParseBody(ImapEngine engine, String format, String path, CancellationToken cancellationToken)
à MailKit.Net.Imap.ImapUtils.ParseMultipart(ImapEngine engine, String format, String path, CancellationToken cancellationToken)
à MailKit.Net.Imap.ImapFolder.ParseSummaryItems(ImapEngine engine, MessageSummary message, FetchSummaryItemsCompletedCallback completed, CancellationToken cancellationToken)
à MailKit.Net.Imap.ImapFolder.UntaggedFetchSummaryItemsHandler(ImapEngine engine, ImapCommand ic, Int32 index, Boolean doAsync)
à MailKit.Net.Imap.ImapEngine.ProcessUntaggedResponse(CancellationToken cancellationToken)
à MailKit.Net.Imap.ImapCommand.Step()
à MailKit.Net.Imap.ImapEngine.Iterate()
à MailKit.Net.Imap.ImapEngine.Run(ImapCommand ic)
à MailKit.Net.Imap.ImapFolder.Fetch(Int32 min, Int32 max, IFetchRequest request, CancellationToken cancellationToken)
à AlloVoisins.IdleClient.d__26.MoveNext() dans **\IdleClient.cs :ligne 95
To Reproduce
Steps to reproduce the behavior:
IList? fetched = null;
fetched = client.Inbox.Fetch(startIndex, -1, request, cancel.Token);
Expected behavior
Get all messages
client = new ImapClient(new ProtocolLogger(Console.OpenStandardError()));
async Task ReconnectAsync()
{
if (!client.IsConnected)
await client.ConnectAsync(_host, _port, sslOptions, cancel.Token);
if (!client.IsAuthenticated)
{
await client.AuthenticateAsync(_gmailUsername, _gmailPassword, cancel.Token);
await client.Inbox.OpenAsync(FolderAccess.ReadOnly, cancel.Token);
}
}
IList<IMessageSummary>? fetched = null;
fetched = client.Inbox.Fetch(startIndex, -1, request, cancel.Token);