if ( !$delete_folder ) {
$delete_folder = "false";
}
+if ( !$noselect_fix_enable ) {
+ $noselect_fix_enable = "false";
+}
if ( !$frame_top ) {
$frame_top = "_top";
}
print "15. Default Unseen Type : $WHT$default_unseen_type$NRM\n";
print "16. Auto Create Special Folders : $WHT$auto_create_special$NRM\n";
print "17. Don't move folders into Trash : $WHT$delete_folder$NRM\n";
+ print "18. Enable /NoSelect folder fix : $WHT$noselect_fix_enable$NRM\n";
print "\n";
print "R Return to Main Menu\n";
} elsif ( $menu == 4 ) {
elsif ( $command == 15 ) { $default_unseen_type = command213(); }
elsif ( $command == 16 ) { $auto_create_special = command214(); }
elsif ( $command == 17 ) { $delete_folder = command215(); }
+ elsif ( $command == 18 ) { $noselect_fix_enable = command216(); }
} elsif ( $menu == 4 ) {
if ( $command == 1 ) { $default_charset = command31(); }
elsif ( $command == 2 ) { $data_dir = command33a(); }
return $delete_folder;
}
+#noselect fix
+sub command216 {
+ print "Some IMAP server allow subfolders to exist even if the parent\n";
+ print "folders do not. This fixes some problems with the folder list\n";
+ print "when this is the case, causing the /NoSelect folders to be displayed\n";
+ print "\n";
+
+ if ( lc($noselect_fix_enable) eq "true" ) {
+ $default_value = "y";
+ } else {
+ $default_value = "n";
+ }
+ print "enable noselect fix? (y/n) [$WHT$noselect_fix_enable$NRM]: $WHT";
+ $noselect_fix_enable = <STDIN>;
+ if ( ( $noselect_fix_enable =~ /^y\n/i ) || ( ( $noselect_fix_enable =~ /^\n/ ) && ( $default_value eq "y" ) ) ) {
+ $noselect_fix_enable = "true";
+ } else {
+ $noselect_fix_enable = "false";
+ }
+ return $noselect_fix_enable;
+}
############# GENERAL OPTIONS #####################
# Default Charset
print CF "\$auto_create_special = $auto_create_special;\n";
# boolean
print CF "\$delete_folder = $delete_folder;\n";
+ # boolean
+ print CF "\$noselect_fix_enable = $noselect_fix_enable;\n";
+
print CF "\n";
# string
* Your IMAP server must support the SORT extension for this
* to work.
*/
+
global $allow_server_sort;
$allow_server_sort = false;
+/**
+ * This enables the no select fix for Cyrus when subfolders
+ * exist but parent folders do not
+ */
+
+global $noselect_fix_enable;
+$noselect_fix_enable = false;
+
/**
* Make sure there are no characters after the PHP closing
* tag below (including newline characters and whitespace).
global $data_dir, $username, $list_special_folders_first,
$folder_prefix, $trash_folder, $sent_folder, $draft_folder,
$move_to_trash, $move_to_sent, $save_as_draft,
- $delimiter;
+ $delimiter, $noselect_fix_enable;
$inbox_in_list = false;
$inbox_subscribed = false;
require_once('../src/load_prefs.php');
require_once('../functions/array.php');
+ if ($noselect_fix_enable) {
+ $lsub_args = "LSUB \"$folder_prefix\" \"*%\"";
+ }
+ else {
+ $lsub_args = "LSUB \"$folder_prefix\" \"*\"";
+ }
/* LSUB array */
- $lsub_ary = sqimap_run_command ($imap_stream, "LSUB \"$folder_prefix\" \"*%\"",
+ $lsub_ary = sqimap_run_command ($imap_stream, $lsub_args,
true, $response, $message);
+
/*
* Section about removing the last element was removed
* We don't return "* OK" anymore from sqimap_read_data