From 41833582ba2c7cd8448b8ac01f283b37419761bf Mon Sep 17 00:00:00 2001 From: Anna Larch Date: Tue, 12 Mar 2024 14:40:49 +0100 Subject: [PATCH] fix: STORE for iCloud and other strict IMAP servers 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 BAD Parse Error To fix this, wrap the params of a STORE command in a Horde_Imap_Client_Data_Format_List Otherwise, the \Delete FLAG, \Seen FLAG and possibly all other PERMFLAGs aren't added, even if the STORE command doesn't return a BAD response. Signed-off-by: Anna Larch --- lib/Horde/Imap/Client/Socket.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Horde/Imap/Client/Socket.php b/lib/Horde/Imap/Client/Socket.php index 9fddb7d9a..3449fb1a3 100644 --- a/lib/Horde/Imap/Client/Socket.php +++ b/lib/Horde/Imap/Client/Socket.php @@ -3632,14 +3632,14 @@ protected function _storeCmd($options) if (!empty($options['replace'])) { $cmds[] = array( 'FLAGS' . ($silent ? '.SILENT' : ''), - $options['replace'] + new Horde_Imap_Client_Data_Format_List($options['replace']) ); } else { foreach (array('add' => '+', 'remove' => '-') as $k => $v) { if (!empty($options[$k])) { $cmds[] = array( $v . 'FLAGS' . ($silent ? '.SILENT' : ''), - $options[$k] + new Horde_Imap_Client_Data_Format_List($options[$k]) ); } }