Skip to content

Commit

Permalink
Fix duplicated Inbox folder on IMAP servers that do not use Inbox fol…
Browse files Browse the repository at this point in the history
…der with all capital letters (#9166)
  • Loading branch information
alecpl committed Oct 18, 2023
1 parent 6880e08 commit a2da527
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 12 additions & 0 deletions program/lib/Roundcube/rcube_imap_generic.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a2da527

Please sign in to comment.