From 4a5efe09f959a9c01b05ace6e583ab5ef7f3a0af Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Sun, 5 Apr 2020 11:04:23 +0200 Subject: [PATCH] Fix bug where a special folder couldn't be created if a special-use flag is not supported (#7147) --- CHANGELOG | 1 + program/lib/Roundcube/rcube_imap.php | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 49b6f493f..79f99809e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -35,6 +35,7 @@ CHANGELOG Roundcube Webmail - Markasjunk: Fix bug where moving to Junk was failing on messages selected with Select > All (#7206) - Fix bug where session was destoryed with window close (#7251) - Fix so imap error message is displayed to the user on folder create/update (#7245) +- Fix bug where a special folder couldn't be created if a special-use flag is not supported (#7147) RELEASE 1.4.3 ------------- diff --git a/program/lib/Roundcube/rcube_imap.php b/program/lib/Roundcube/rcube_imap.php index 9d7ac714d..0a3b30fc9 100644 --- a/program/lib/Roundcube/rcube_imap.php +++ b/program/lib/Roundcube/rcube_imap.php @@ -3261,6 +3261,12 @@ class rcube_imap extends rcube_storage $result = $this->conn->createFolder($folder, $type ? array("\\" . ucfirst($type)) : null); + // Folder creation may fail when specific special-use flag is not supported. + // Try to create it anyway with no flag specified (#7147) + if (!$result && $type) { + $result = $this->conn->createFolder($folder); + } + // try to subscribe it if ($result) { // clear cache