Opened 3 years ago
Closed 3 years ago
#1486346 closed Bugs (fixed)
Check for default folders is not case sensitive: drafts != Drafts
| Reported by: | duelli | Owned by: | |
|---|---|---|---|
| Priority: | 5 | Milestone: | 0.4-beta |
| Component: | Core functionality | Version: | 0.3.1 |
| Severity: | normal | Keywords: | |
| Cc: |
Description
In our configuration, we have
$rcmail_config['create_default_folders'] = true;
$rcmail_config['protect_default_folders'] = true;
$rcmail_config['default_imap_folders'] = array('INBOX', 'Drafts', 'Sent', 'Junk', 'Trash');
We have a dovecot 1.0 IMAP server.
We found that the check for default folders is case insensitive.
For instance, if a user already has a folder called "drafts" (note the lower case initial letter) and no personal settings for default folders, RoundCube detects the "drafts" folder and treats it identical to a "Drafts" folder as far as automatic creation of folders is concerned.
When a draft would be finally saved to the "Drafts" folder, only the folder "drafts" is found but not "Drafts". RoundCube shows and logs an error message which says:
[02-Dec-2009 15:45:12 +0100]: IMAP Error: Could not save message in Drafts in /srv/roundcube/program/steps/mail/sendmail.inc on line 0 (POST /roundcube/?_task=mail&_action=send)
As noted in Comment 6 of bug #1486260, the check for default folders should be case sensitive.
Change History (5)
comment:1 Changed 3 years ago by duelli
comment:2 Changed 3 years ago by thomasb
- Resolution set to fixed
- Status changed from new to closed
Fixed in [d5ffb587]
comment:3 Changed 3 years ago by alec
- Component changed from PHP backend to Core functionality
- Resolution fixed deleted
- Status changed from closed to reopened
I think we should make all folder checks case insensitive. There are other places to fix eg. app.js line 1888. Also in rcube_imap we should get rid of default_folders_lc, etc.
comment:4 Changed 3 years ago by alec
Of course, I mean make them case sensitive ;)
comment:5 Changed 3 years ago by thomasb
- Resolution set to fixed
- Status changed from reopened to closed
Done in [c8cf268b]

For what reason do you use the in_array_nocase function instead of in_array in function create_default_folders?
/** * Create all folders specified as default */ function create_default_folders() { $a_folders = iil_C_ListMailboxes($this->conn, $this->mod_mailbox(''), '*'); $a_subscribed = iil_C_ListSubscribed($this->conn, $this->mod_mailbox(''), '*'); // create default folders if they do not exist foreach ($this->default_folders as $folder) { $abs_name = $this->mod_mailbox($folder); if (!in_array_nocase($abs_name, $a_folders)) $this->create_mailbox($folder, TRUE); else if (!in_array_nocase($abs_name, $a_subscribed)) $this->subscribe($folder); } }