diff --git a/CHANGELOG.md b/CHANGELOG.md index a61d7d5f11a..91c8827a7e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ - Password: Allow LDAP access using LDAP URI and SASL binding (#8402) - Fix potential HTTP protocol version mismatch (#8982) - Fix PHP8 fatal error when parsing a malformed BODYSTRUCTURE (#9171) +- Fix duplicated Inbox folder on IMAP servers that do not use Inbox folder with all capital letters (#9166) ## Release 1.6.4 diff --git a/program/lib/Roundcube/rcube_imap_generic.php b/program/lib/Roundcube/rcube_imap_generic.php index 8334a7f93b4..fe36d489269 100644 --- a/program/lib/Roundcube/rcube_imap_generic.php +++ b/program/lib/Roundcube/rcube_imap_generic.php @@ -1658,6 +1658,18 @@ protected function _listMailboxes($ref, $mailbox, $subscribed = false, $return_o $mailbox = rtrim($mailbox, $delim); } + // Make it easier for the client to deal with INBOX folder + // by always returning the word with all capital letters + if (strlen($mailbox) == 5 + && ($mailbox[0] == 'i' || $mailbox[0] == 'I') + && ($mailbox[1] == 'n' || $mailbox[1] == 'N') + && ($mailbox[2] == 'b' || $mailbox[2] == 'B') + && ($mailbox[3] == 'o' || $mailbox[3] == 'O') + && ($mailbox[4] == 'x' || $mailbox[4] == 'X') + ) { + $mailbox = 'INBOX'; + } + // Add to result array if (!$lstatus) { $folders[] = $mailbox;