Bug 408653

Summary: Detect PERMANENTFLAGS during mailbox sync
Product: [Applications] trojita Reporter: aikiteresa+list
Component: OtherAssignee: Trojita default assignee <trojita-bugs>
Status: RESOLVED UNMAINTAINED    
Severity: normal    
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Microsoft Windows   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description aikiteresa+list 2019-06-13 15:56:59 UTC
SUMMARY
New Tags don't work


STEPS TO REPRODUCE
1. open an email
2. click the green TAGS button
3. enter a new tag name

OBSERVED RESULT
Nothing happens when trying to tag email.

EXPECTED RESULT
A new tag should be created.


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Jan Kundrát 2019-06-13 16:17:56 UTC
Hi, thanks for your report. Can you please attach full IMAP logs?

Here's how to get them:

1) be sure that you're in "another mailbox" than the one which doesn't work
2) activate logging: menu -> Application -> Debugging -> Protocol log
3) open the troublesome mailbox
4) try some tagging
5) upload the logs here

Thanks!
Comment 2 Jan Kundrát 2019-06-13 20:26:59 UTC
Thanks for the log (got one via private mail).

TL;DR: you won't have tags on your server, ever. Sorry, they just do not support this feature.

Here's the relevant part:

12:27:43.8601  <<<  * FLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)
12:27:43.8601  <<<  * OK [PERMANENTFLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)] Permanent flags

This happens during the initial mailbox sync, and the server informs us about the set of recognized flags/keywords, and which of them can be stored persistently. The asterisk "*" is missing, and this means that the server is saying "I cannot save message keywords", aka tags.

This happens when we try to store a keyword:

12:27:59.5801  [task] Imap::Mailbox::UpdateFlagsTask Activated
12:27:59.6591  >>>  y64 UID STORE 7 +FLAGS (broken)
12:27:59.7061  <<<  * NO Keywords are not supported!
12:27:59.7061  <<<  * 6 FETCH (FLAGS (\Seen))
12:27:59.7061  <<<  y64 OK STORE completed.
12:27:59.7071   Warning: unhandled untagged NO...
12:27:59.7071  [task] Imap::Mailbox::UpdateFlagsTask Completed

Here, the server is telling us "you should have listened when I told you I do no keywords!". From the specific pattern, this looks like Exchange. I stand by my claim that it is a miserable IMAP server, but in this case I cannot really blame the implementation because it follows the IMAP protocol spec. It's an annoying limitation for sure, but this is a bug in Trojita for trying to exercise an optional feature that the server told us upfront that it's not supported.

I'll leave this bug open. Preferably, Trojita should disable tagging on messages which are stored in a folder which doesn't support custom keywords. This is easily detectable during the initial mailbox sync.
Comment 3 Christoph Cullmann 2024-09-23 18:50:52 UTC
Trojitá is no longer maintained, please switch to a maintained alternative like https://apps.kde.org/kmail2/

Sorry for the inconveniences.