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

SELECT: parsing fails if FLAGS or PERMANENTFLAGS responses contain parentheses #438

Open
InterLinked1 opened this issue Jul 21, 2023 · 0 comments

Comments

@InterLinked1
Copy link

Although probably atypical, it's not explicitly prohibited by the RFC for IMAP flags to contain parentheses. However, if a mailbox is selected and it contains flags that have an opening parenthesis in them (and possibly other characters), the function will return an error. Here's an example:

I'd never intentionally include parentheses in labels, but due to a bug in testing, I managed to add a malformed flag to a mailbox, and now I've basically made the mailbox permanently inaccessible to libetpan, since, to my knowledge, there is no way to remove flags from a mailbox (even if the messages with those flags are expunged). The mailbox would need to be deleted, after all messages are moved to another one. Unfortunately, this happened on an INBOX, so I can't do that; therefore, I think it is a somewhat high severity issue.

[2023-07-21 16:03:07.735]   DEBUG[64389]: imap_client.c:425 __imap_client_send_wait_response: => 28 SELECT "INBOX"
[2023-07-21 16:03:07.766]   DEBUG[64389]: imap_client.c:354 client_command_passthru: <= * 197 EXISTS
[2023-07-21 16:03:07.767]   DEBUG[64389]: imap_client.c:354 client_command_passthru: <= * 2 RECENT
[2023-07-21 16:03:07.767]   DEBUG[64389]: imap_client.c:354 client_command_passthru: <= * OK [UIDNEXT 249] Predicted next UID
[2023-07-21 16:03:07.770]   DEBUG[64389]: imap_client.c:354 client_command_passthru: <= * OK [UNSEEN 134] Found
[2023-07-21 16:03:07.770]   DEBUG[64389]: imap_client.c:354 client_command_passthru: <= * OK [HIGHESTMODSEQ 998] Highest
[2023-07-21 16:03:07.770]   DEBUG[64389]: imap_client.c:354 client_command_passthru: <= * OK [UIDVALIDITY 674612150] UIDs valid
[2023-07-21 16:03:07.770]   DEBUG[64389]: imap_client.c:354 client_command_passthru: <= * FLAGS (\Answered \Deleted \Draft \Flagged \Seen (\Seen nonjunk $label1 FLAGS)
[2023-07-21 16:03:07.771]   DEBUG[64389]: imap_client.c:354 client_command_passthru: <= * OK [PERMANENTFLAGS (\Answered \Deleted \Draft \Flagged \Seen (\Seen nonjunk $label1 FLAGS \*)] F
[2023-07-21 16:03:07.771]   DEBUG[64389]: imap_client.c:358 client_command_passthru: <= 28 OK [READ-WRITE] SELECT
[2023-07-21 16:03:07.807] WARNING[64388]: mod_webmail.c:946 client_imap_select: SELECT 'XXXX.INBOX' failed: connect
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

No branches or pull requests

1 participant