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

fix: STORE FLAGS for iCloud and other strict IMAP servers #15

Conversation

miaulalala
Copy link

@miaulalala miaulalala commented Mar 12, 2024

Apple's iCloud IMAP server (and possibly others, although I haven't tested it) want brackets around any FLAG command params as shown in the examples of RFC3501.

If the brackets aren't added, the command fails with BAD Parse Error for the \Deleted FLAG
image

but the \Seen FLAG doesn't take effect either, which I haven't been able to track down just yet.

To fix this, wrap the params of a STORE command in a Horde_Imap_Client_Data_Format_List

To Do:

  • Check \Seen flag for the same issue - \Seen FLAG now is synced across.

Apple's iCloud IMAP server (and possibly others, although I haven't tested it) want brackets around any
FLAG command params as shown in the examples of (RFC3501)[https://datatracker.ietf.org/doc/html/rfc3501#section-6.4.6]

If the brackets aren't added, the command fails with

To fix this, wrap the params of a STORE command in a

Signed-off-by: Anna Larch <anna@nextcloud.com>
Copy link
Owner

@bytestream bytestream left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems more like a bug in Apple's implementation based on the linked RFC. They've clearly interpreted FLAGS <flag list> in section 6.4.6 to only use this part of the ABNF:

flag-list       = "(" [flag *(SP flag)] ")"

If you read the ABNF though it clearly states:

store           = "STORE" SP sequence-set SP store-att-flags
store-att-flags = (["+" / "-"] "FLAGS" [".SILENT"]) SP (flag-list / (flag *(SP flag)))

Given both parenthesised and not are valid this should be OK. However, I wouldn't be surprised if there's the alternative case where the IMAP server doesn't want a parenthesised list.

@bytestream bytestream merged commit 406b4d1 into bytestream:master Mar 12, 2024
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants