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

Syntax error in BODYSTRUCTURE. Unexpected atom token: 9.3736e+06 #1838

Closed
IChayka opened this issue Nov 2, 2024 · 3 comments
Closed

Syntax error in BODYSTRUCTURE. Unexpected atom token: 9.3736e+06 #1838

IChayka opened this issue Nov 2, 2024 · 3 comments
Labels
compatibility Compatibility with existing software server-bug The bug appears to be in the server

Comments

@IChayka
Copy link

IChayka commented Nov 2, 2024

Describe the bug
A clear and concise description of what the bug is.

Platform (please complete the following information):

  • OS: Windows
  • .NET Framework: 4.7.1
  • MailKit Version: 4.8.0

Exception

MailKit.Net.Imap.ImapProtocolException: Syntax error in BODYSTRUCTURE. Unexpected atom token: 9.3736e+06
   в MailKit.Net.Imap.ImapEngine.ParseNumber(ImapToken token, Boolean nonZero, String format, Object[] args)
   в MailKit.Net.Imap.ImapUtils.<ReadNumberAsync>d__25.MoveNext()

To Reproduce
Exception occures when trying to fetch all messages.

Code Snippets

            var messages = this.client.Inbox.Fetch(0, -1,
                MessageSummaryItems.Envelope | MessageSummaryItems.UniqueId | MessageSummaryItems.Flags | MessageSummaryItems.BodyStructure,
                headers).ToArray();
@jstedfast jstedfast added the server-bug The bug appears to be in the server label Nov 2, 2024
@jstedfast
Copy link
Owner

jstedfast commented Nov 2, 2024

The problem is that your IMAP server responded to a query that should have sent a numeric integer value, but instead sent 9.3736e+06. In other words, your IMAP server is buggy.

IChayka pushed a commit to IChayka/MailKit that referenced this issue Nov 2, 2024
fix for decimal point parsing with exponent
@jstedfast jstedfast closed this as not planned Won't fix, can't repro, duplicate, stale Nov 2, 2024
@jstedfast
Copy link
Owner

@IChayka are you also connecting to mail.ru?

@jstedfast jstedfast changed the title Syntax error in BODYSTRUCTURE Syntax error in BODYSTRUCTURE. Unexpected atom token: 9.3736e+06 Nov 3, 2024
@jstedfast
Copy link
Owner

jstedfast commented Nov 3, 2024

I'm not going to support mail.ru because it appears to be a garbage IMAP server. (see #1234 for an example of an unfixable mail.ru issue)

The number of work-arounds I have already had to implement for mail.ru + the fact that it does not support any SEARCH criteria just goes to show it's not worth the effort to support it at all.

See also: https://ru.stackoverflow.com/questions/289544/mail-ru-imap-unsupported-search-criterion

jstedfast added a commit that referenced this issue Nov 17, 2024
mail.ru sometimes formats integers as decimals with exponents.

Fixes issue #1838
@jstedfast jstedfast added the compatibility Compatibility with existing software label Dec 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility Compatibility with existing software server-bug The bug appears to be in the server
Projects
None yet
Development

No branches or pull requests

2 participants