Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Syntax error in BODYSTRUCTURE. Unexpected atom token: 3.45027e+06 #469

Open
f242 opened this issue Nov 6, 2024 · 9 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@f242
Copy link

f242 commented Nov 6, 2024

Have an error popup while program tries to sync mail
v1.9.30.0 & win 10 x64 22h2

2024-11-06 03:44:41.450 +03:00 [INF] Internal synchronization started for Моя почта
2024-11-06 03:44:41.489 +03:00 [INF] Options: Type: Full, Folders: None
2024-11-06 03:44:51.525 +03:00 [ERR] Synchronization failed for Моя почта
MailKit.Net.Imap.ImapProtocolException: Syntax error in BODYSTRUCTURE. Unexpected atom token: 3.45027e+06
   at MailKit.Net.Imap.ImapEngine.ParseNumber(ImapToken token, Boolean nonZero, String format, Object[] args)
   at MailKit.Net.Imap.ImapUtils.ParseNumberToken(ImapToken token, String format)
   at MailKit.Net.Imap.ImapUtils.ReadNumberAsync(ImapEngine engine, String format, CancellationToken cancellationToken)
   at MailKit.Net.Imap.ImapUtils.ParseBodyAsync(ImapEngine engine, String format, String path, CancellationToken cancellationToken)
   at MailKit.Net.Imap.ImapUtils.ParseMultipartAsync(ImapEngine engine, String format, String path, CancellationToken cancellationToken)
   at MailKit.Net.Imap.ImapUtils.ParseBodyAsync(ImapEngine engine, String format, String path, CancellationToken cancellationToken)
   at MailKit.Net.Imap.ImapFolder.ParseSummaryItemsAsync(ImapEngine engine, MessageSummary message, FetchSummaryItemsCompletedCallback completed, CancellationToken cancellationToken)
   at MailKit.Net.Imap.ImapEngine.ProcessUntaggedResponseAsync(CancellationToken cancellationToken)
   at MailKit.Net.Imap.ImapCommand.StepAsync()
   at MailKit.Net.Imap.ImapEngine.IterateAsync()
   at MailKit.Net.Imap.ImapEngine.RunAsync(ImapCommand ic)
   at MailKit.Net.Imap.ImapFolder.FetchAsync(IList`1 uids, IFetchRequest request, CancellationToken cancellationToken)
   at Wino.Core.Synchronizers.ImapSynchronizer.SynchronizeFolderInternalAsync(MailItemFolder folder, CancellationToken cancellationToken)
   at Wino.Core.Synchronizers.ImapSynchronizer.SynchronizeFolderInternalAsync(MailItemFolder folder, CancellationToken cancellationToken)
   at Wino.Core.Synchronizers.ImapSynchronizer.SynchronizeInternalAsync(SynchronizationOptions options, CancellationToken cancellationToken)
   at Wino.Core.Synchronizers.BaseSynchronizer`2.SynchronizeAsync(SynchronizationOptions options, CancellationToken cancellationToken)

@f242 f242 added the bug Something isn't working label Nov 6, 2024
@jstedfast
Copy link

This is a bug in mail.ru's IMAP implementation that is decimal numbers with exponents instead of integer values for body part sizes

@f242
Copy link
Author

f242 commented Nov 6, 2024

This is a bug in mail.ru's IMAP implementation that is decimal numbers with exponents instead of integer values for body part sizes

Despite this, Thunderbird and Outlook as well as Mail and Calendar work correctly🤔

@bkaankose
Copy link
Owner

This is a bug in mail.ru's IMAP implementation that is decimal numbers with exponents instead of integer values for body part sizes

Is there anything possible to interfere with this behavior in Mailkit?

@chenseanxy
Copy link
Contributor

chenseanxy commented Nov 11, 2024

Doesn't seem so, and probably there won't be a fix from MailKit's side

This feels like a recent issue, maybe ask mail.ru's customer support? Very clearly a regression from their part

Edit: Did not realize the Mailkit guy was here lmao

@jstedfast
Copy link

jstedfast commented Nov 11, 2024

I would prefer to see mail.ru fix the issue, but I would consider a workaround if not.

And yes, I'm here. Randomly saw this project was using MailKit and am pretty excited that someone is using it to create an email client 😁

Very cool.

@bkaankose
Copy link
Owner

I would prefer to see mail.ru fix the issue, but I would consider a workaround if not.

And yes, I'm here. Randomly saw this project was using MailKit and am pretty excited that someone is using it to create an email client 😁

Very cool.

Super exited that Wino got your attention! All synchronizers leverage MimeKit and specially ImapSynchronizer uses MailKit extensively. I'm pretty sure the current implementation of Wino's imap synchronizer is not the best, and probably I did some parts very weird. If you have suggestions or tips/tricks to make the imap synchronization better you can always reach out to me. I will gladly make the required changes in the code along with your expertise.

Mailkit synchronization call for imap happens here:

private async Task<IEnumerable<string>> SynchronizeFolderInternalAsync(MailItemFolder folder, CancellationToken cancellationToken = default)

@jstedfast
Copy link

Forgot to comment that I added a work-around for this: jstedfast/MailKit#1838

Will be in the v4.9.0 release when I push it out. Currently blocking on some new S/MIME functionality in MimeKit that needs confirmation that it works before I can merge & make a release.

Will update you when I push it.

@jstedfast
Copy link

Looks like I forgot to notify you guys that 4.9.0 was released.

@bkaankose
Copy link
Owner

Looks like I forgot to notify you guys that 4.9.0 was released.

Thanks! I have already upgraded the package, new release is pending in Store until I finalize couple more important fixes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants