From e092be8f3a51a6fb743fc013c4d09820e2146bad Mon Sep 17 00:00:00 2001 From: Thomas Jollans Date: Sun, 20 Nov 2022 14:37:57 +0100 Subject: [PATCH] imap-deserializer: Allow ']' in atoms (e.g. folder names) This permits IMAP folders to have names featuring square brackets. For example, AirMail for iOS creates a folder called "[Airmail]", which Geary should be able to handle. Fixes #1169. --- src/engine/imap/transport/imap-deserializer.vala | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/engine/imap/transport/imap-deserializer.vala b/src/engine/imap/transport/imap-deserializer.vala index 90c83549..2f0b6dbf 100644 --- a/src/engine/imap/transport/imap-deserializer.vala +++ b/src/engine/imap/transport/imap-deserializer.vala @@ -575,6 +575,12 @@ public class Geary.Imap.Deserializer : BaseObject, Logging.Source { case ']': if (ch != get_current_context_terminator()) { + if (state == State.ATOM) { + // Allow ']' in atom IFF it does not close the context + // this is to allow [] in folder names + append_to_string(ch); + return State.ATOM; + } warning("Received an unexpected closing brace"); return State.FAILED; }