-
Notifications
You must be signed in to change notification settings - Fork 259
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
Unicode tags not properly supported #10159
Comments
Thanks @the-djmaze for reaching out 👍 I was just looking for another IMAP client that supports tags the other day. It's good to know that snappymail does. Our handling of tags/flags in Nextcloud Mail is strange. The reason is, that horde/imap_client lowercases all flags by default and breaks the encoding. We are trying to be smart and uppercase everything before converting from utf7-imap to utf-8, but that doesn't work too well1. As a first step, we need to change, or add a new setter/getter, to read the unmodified flags: https://github.com/horde/Imap_Client/blob/98a4ba591bc4fa12341684d4051b344579a34e6f/lib/Horde/Imap/Client/Data/Fetch.php#L328-L331 I don't know if there's a reason that horde lowercases all flags by default. cc @ChristophWurst @miaulalala Footnotes |
that's also kinda bad with registered IANA flags such as |
Yes, but what if there are tags in use IMAP Formal Syntax says:
So $MDNSent, $mdnsENT, $MdNsEnT, $MdnSent are compliant. Lowercase flags is ok, but should be done AFTER To prevent issues with servers that are case-sensitive (so wrong), setting a flag should be done with IANA registration So @kesselb wants something cumbersome (when not fixing the other code) like: public function setFlags(array $flags)
{
$this->_data[Horde_Imap_Client::FETCH_FLAGS] = array_map(
'Horde_Imap_Client_Utf7imap::Utf8ToUtf7Imap',
array_unique(
array_map(
'trim',
array_map(
'Horde_Imap_Client_Utf7imap::Utf7ImapToUtf8',
$flags
)
)
)
)
);
} Or when fixing the other code where Mail will always be UTF-8 (and only do Utf8ToUtf7Imap when sending command to server) public function setFlags(array $flags)
{
$this->_data[Horde_Imap_Client::FETCH_FLAGS] = array_unique(array_map(
'trim',
$flags
));
} |
Steps to reproduce
Expected behavior
See tags like "🧪" or "ກ ຂ ຄ"
Actual behavior
Vice-versa
SnappyMail shows:
Thunderbird can't handle them.
Mail app version
3.7.8
Details
IMAP 4.1 uses a modified version of UTF-7
IMAP 4.2 uses UTF-8
With NC Mail created tag
NC Mail creates the invalid
$&2d7d6g-
and can't decode&2D7d6g-
The text was updated successfully, but these errors were encountered: