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

Not respecting rfc3501 (imap4rev1) for ABNF syntaxe #375

Closed
PhilipRotz opened this issue Jul 4, 2023 · 2 comments
Closed

Not respecting rfc3501 (imap4rev1) for ABNF syntaxe #375

PhilipRotz opened this issue Jul 4, 2023 · 2 comments
Labels
bug Something isn't working released

Comments

@PhilipRotz
Copy link

Hi ! And first of all, thank you for your work 🚀

I'm using gluon server with a client that only follows IMAP4rev1 RFC, and I got an error while parsing a gluon IMAP response, as it does not follow the ABNF syntaxe everywhere

Here is the steps to reproduce :

>> telnet 127.0.0.1 1143
a0 login [email protected] pass
...
a5 UID SEARCH ALL
* SEARCH 6 7
a5 OK command completed in 337.51µs

As you can see, the server took "337.51µs" to respond... "µs" -> here is the problem, "µ" is not an ASCII char.
As defined in rfc3501 (IMAP4rev1 that Gluon tends to follow), IMAP syntaxe should follow ABNF.
Quote from rfc3501:

resp-cond-state = ("OK" / "NO" / "BAD") SP resp-text
resp-text = ["[" resp-text-code "]" SP] text
text = 1*TEXT-CHAR
TEXT-CHAR = any CHAR except CR and LF

and the ABNF rfc5234 tells that CHAR are only US-ASCII

CHAR = %x01-7F
; any 7-bit US-ASCII character,
; excluding NUL

"µ" char is not in this range (as it is UTF-8)

The problem is located here :

func okMessage(ctx context.Context) string {
if startTime, ok := startTimeFromContext(ctx); ok {
return fmt.Sprintf("command completed in %v", time.Since(startTime))
}
return ""
}

I think this should be fixed to follow rfc3501

Thank you !!

@LBeernaertProton LBeernaertProton added the bug Something isn't working label Jul 4, 2023
@LBeernaertProton
Copy link
Contributor

Hey @PhilipRotz, thanks for the report. That's indeed an oversight on our part. We'll fix this as soon as we have time.

LBeernaertProton added a commit that referenced this issue Jul 7, 2023
This can cause non-ASCII symbols to be printed in the response which is
not supported by the IMAP protocol.

Closes: #375
@github-actions
Copy link

github-actions bot commented Jul 7, 2023

🎉 This issue has been resolved in version 0.17.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

No branches or pull requests

2 participants