- if (strtolower($boxes[$p]['unformatted']) == 'inbox')
- $count_special_folders++;
- else if (strtolower($imap_server_type) == 'courier' &&
- strtolower($boxes[$p]['unformatted']) == 'inbox.trash')
- $count_special_folders++;
- else if ($boxes[$p]['unformatted'] == $trash_folder && $trash_folder)
- $count_special_folders++;
- else if ($boxes[$p]['unformatted'] == $sent_folder && $sent_folder)
- $count_special_folders++;
- else if ($boxes[$p]['unformatted'] == $draft_folder && $draft_folder)
- $count_special_folders++;
+ switch ($boxes[$p]['unformatted'])
+ {
+ case (strtoupper($boxes[$p]['unformatted']) == 'INBOX'):
+ ++$count_special_folders;
+ $skip_folders[] = $boxes[$p]['unformatted'];
+ break;
+ // FIX ME inbox.trash should be set in conf.pl
+ case 'inbox.trash':
+ if (strtolower($imap_server_type) == 'courier') {
+ ++$count_special_folders;
+ }
+ break;
+ case $trash_folder:
+ ++$count_special_folders;
+ $skip_folders[] = $trash_folder;
+ break;
+ case $sent_folder:
+ ++$count_special_folders;
+ $skip_folders[] = $sent_folder;
+ break;
+ case $draft_folder:
+ ++$count_special_folders;
+ $skip_folders[] = $draft_folder;
+ break;
+ default: break;
+ }