-
Notifications
You must be signed in to change notification settings - Fork 261
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
fix: Junk/NotJunk flags #10328
base: main
Are you sure you want to change the base?
fix: Junk/NotJunk flags #10328
Conversation
Signed-off-by: SebastianKrupinski <[email protected]>
How do we test this? Found #5370 to change |
The best way to test is to insert a break point in the OCA\Mail\Service\MailManager::filterFlags() function. That way you can see the values for the table and flag.
This correctly added the front end logic,
But incorrectly changed the back end logic,
|
Imap Flags, my favorite topic ;) Please don't spend too much time on this one. We are aware about a couple of issues with tags (e.g. #10159), and it's on my to-do to work on it when I'm done with files_emailviewer and sieve. Your finding is correct, $junk is not part of the allowed flags and therefore the check will never return true. The list of allowed flags should only contain the system flags, which are mandatory from the RFC: https://www.ietf.org/rfc/rfc9051.html#name-flags-message-attribute. For system flags, we can skip the check if permflags are enabled and save a few bits. If Junk/NotJunk was not added on your system, I assume permflags are not enabled. Can you check that with the debugger? |
$Junk and $notJunk are defined in the RFC as keywords that should be supported, so they can be added to the allowed list.
Yes, my system does support permflags and they are enabled.
The issue is not my system the issue is that there are two separate logic errors one in the front end and another one in the MailManager::filterFlags() function. Firstly, the front end incorrectly sends '$junk' to the back end but the back end compares them as 'junk' to the allowed list. This then causes a request to the server for mailbox permafags. Which brings me to the second logic error, the function then checks if '\ *' exists which is NOT an indicator for system flags or keywords, '\ *' 'indicates that custom flags/keywords (tags/labels) are supported. This is why junk flags are failing on some systems, including mine, even tho my system supports them. The '*' should only be checked when used with tag/lables. I was going to address this in another PR.
Well less for you to do then, since half of the problem is already fixed, with this PR |
👍 We currently don’t handle cases where custom keywords are not allowed, but the keyword already exists. Here’s what I suggest:
Let me know your thoughts or if you have any suggestions on this approach! |
Here is my thoughts,
I also have some thoughts on how we can make this way more efficient and work better. But I'll DM you with the idea, so that we don't pollute this chat. |
Signed-off-by: SebastianKrupinski <[email protected]>
Signed-off-by: SebastianKrupinski <[email protected]>
@kesselb made the changes we discussed. The filterFlags method now handles all 3 cases, system flags, server defined/supported keywords and server custom keywords |
Issue
Junk and NotJunk flags where not being set due to a invalid comparison. UI was sending "$junk" but it was being compared to "junk".
Allowed flags was also missing "notjunk"