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.
This commit is contained in:
Thomas Jollans 2022-11-20 14:37:57 +01:00 committed by Cédric Bellegarde
parent 3009610284
commit e092be8f3a

View file

@ -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;
}