Fixed Cyrillic encoded attachments issue#22998
Fixed Cyrillic encoded attachments issue#22998akstis-typer wants to merge 3 commits intoglpi-project:11.0/bugfixesfrom
Conversation
|
Seems correct after a first quick review. A test case must be added. You can take a look at the PR which introduces initially the encoding check: #21575 |
Trying to resolve issue when Windows-1251 encoding thinking that text encoded by ISO-8859-1 is a valid text Co-authored-by: Cédric Anne <cedric.anne@gmail.com>
|
I guess mb_check_encoding() returning false for ISO-8859-1 and the Windows-1251 returning true - so it gets decoded. I'll think how to solve this issue |
|
OK, thanks. I put this one to draft for now; feel free to switch back as ready when you're done :) |
|
I have hard time launching tests locally. I git cloned repo, install all dependencies I need (ran composer install, bin/console dependencies install) and tried to launch ./tests/run_tests.sh --build imap and when it builds, I got error from composer I think that inside docker container the command runs with insufficient privileges however I tried to run script with sudo privileges and local user privileges - all results are the same. Can someone help me on that one? :) |
|
I do not know/use docker at all; I cannot help. |
|
I was thinking about that issue and have a conclusion: we can't say nothing about encoding of attachments wothout metadata, but, we also cannot decode every single file without charset, using ISO-8859-1 encoding. |
And about that - I got it. User inside docker container (www-data) have uid and guid = 1000, however my www-data user, that have permissions to read and write to my folder, that got mounted inside docker container, have uid and guid = 33 - thats why composer responded with no permissions error. |
|
Also, when I ran imap test I notice that original solution with |
Tests are currently all working on CI. |
|
I have the same problem also in glpi 11.0.4 when i receive an email from one platform. It goes to mailbox and everything appears good, but when glpi receiver makes it a ticket the Subject of the email witch is also the subject of the ticket shows gibberish. If i send an email direct to the mailbox lets say from outlook, ticket created will be readble |
Checklist before requesting a review
Description
Changed MailCollector.php getDecodedContent method so that it checks for Windows-1251 encoding. It's easy to add new encodings to check if needed. Just add your encoding in $encodingsToCheck array