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]: Folder names in Polish #948

Closed
1 task done
BonGoo opened this issue Nov 22, 2024 · 9 comments
Closed
1 task done

[bug]: Folder names in Polish #948

BonGoo opened this issue Nov 22, 2024 · 9 comments
Labels
bug Something isn't working

Comments

@BonGoo
Copy link

BonGoo commented Nov 22, 2024

What happened?

After install and configure fresh install of stalwart. I saw that when i create account in Outlook. My folder "Junk Mail" which in polish means "Wiadomości Śmieci" is look like on the picture:
image

I can create a folder with polish UTF-8 letters like (ą,ż,ź,ć,ę,ó,ł) but it automaticly chage it to something like this:
image
(This folder was name: "Bączek")

How can we reproduce the problem?

I can reproduce the problem by doing the following steps:

Version

v0.10.x

What database are you using?

RocksDB

What blob storage are you using?

None

Where is your directory located?

None

What operating system are you using?

Linux

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@BonGoo BonGoo added the bug Something isn't working label Nov 22, 2024
@mdecimus
Copy link
Member

Unfortunately we do not have any Windows licenses to test this.
Please set the log level to trace and provide the records when the folders is created and accessed.

@kamilst96
Copy link

kamilst96 commented Nov 24, 2024

@mdecimus same issue in SnappyMail, so it doesn't seem to be Outlook-specific.

Folder creation dialog:
image

Resultant folder:
image

Worth noting that SnappyMail does not consider folder creation a success. Second sentence is suddenly not translated, so it might be a direct response from IMAP server.
image

IMAP transaction for reference: openssl s_client -connect server:993

A1 CREATE Test-ą-Test
A1 OK [MAILBOXID (laaaaaal)] Mailbox created.

A1 LIST ""
* LIST () "/" "Test-&AMQAhQ--Test"

A1 CREATE Test-ą-Test
A1 NO Mailbox 'Test-Ä
-Test' already exists. // Yes, it broke a line, so there was a control character.

A1 CREATE Test-&AMQAhQ--Test
A1 NO Mailbox 'Test-Ä
-Test' already exists.

Relevant trace (moved to file due to GH converting weird chars):
trace.txt

@mdecimus
Copy link
Member

According to the logs you provided, the folder is being created using a non Unicode character set. Folder names need to be either encoded or provided in UTF-8.
Can you confirm which character set is SnappyMail using for the folder name?

@kamilst96
Copy link

SnappyMail is sending this command after authenticating, so at least on the surface it uses the UTF8 extension properly:
TAG2 ENABLE UTF8=ACCEPT\r\n

Command:
image

Create with UTF8 enabled:
image
Disabled after creating:
image

Create with UTF8 disabled:
image
Enabled after creating:
image

I'll do some more testing with Evolution and Thunderbird.

@kamilst96
Copy link

Alright, traced folder creations for both:

Non-UTF8:

Raw IMAP input received
contents = "TAG3 CREATE "Test-&AQUBGQEH--Test"\r\n"

IMAP CREATE mailbox command
mailboxName = "Test-ąęć-Test"

UTF8

Raw IMAP input received
contents = "TAG4 CREATE "Test-ąęć-Test"\r\n"

IMAP CREATE mailbox command
mailboxName = "Test-���-Test"

@mdecimus
Copy link
Member

So the issue occurs when using UTF8?

@kamilst96
Copy link

kamilst96 commented Nov 24, 2024

Yes. Seems like SnappyMail is aware how to use both modes. In first mode it encapsulates chars in some notation UTF7 that Stalwart parses properly*, while in the latter it properly sends UTF8 string (as seen in Raw IMAP input), which is bastardized somewhere after receiving it. I'll note that neither case is deemed a success by SnappyMail, but that one might be on them.

* after being correctly created it is still malformed when viewed over UTF8 session.

@kamilst96
Copy link

kamilst96 commented Nov 24, 2024

Confirmed Evolution to be the same case - Does UTF8 correctly, Stalwart receives raw input correctly, IMAP command malforms characters.

EDIT: And tested Thunderbird, which was a pain - it's torpedoing the logs to the point where my trace was 4G within about 10 minutes. Anyway, same as other clients.

@mdecimus
Copy link
Member

Thanks for the help @kamilst96 , this issue has been fixed.

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

3 participants