this is a fix for the LSUB with a % when getting the folder list. This makes the...
[squirrelmail.git] / config / conf.pl
index dd1b56f52f3a078ac364dee8737ee36c951b2a09..87534d770e6b9279cf6bb5a46f8facc0b759907c 100755 (executable)
@@ -278,6 +278,9 @@ if ( !$default_use_mdn ) {
 if ( !$delete_folder ) {
     $delete_folder = "false";
 }
+if ( !$noselect_fix_enable ) {
+    $noselect_fix_enable = "false";
+}
 if ( !$frame_top ) {
     $frame_top = "_top";
 }
@@ -293,6 +296,9 @@ if ( !$allow_thread_sort ) {
 if ( !$allow_server_sort ) {
     $allow_server_sort = 'false';
 }
+if ( !$allow_charset_search ) {
+    $allow_charset_search = 'true';
+}
 if ( !$prefs_user_field ) {
     $prefs_user_field = 'user';
 }
@@ -407,6 +413,7 @@ while ( ( $command ne "q" ) && ( $command ne "Q" ) ) {
         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 ) {
@@ -426,6 +433,7 @@ while ( ( $command ne "q" ) && ( $command ne "Q" ) ) {
         if ( lc($edit_identity) eq "false" ) {
             print "13. Allow editing of name     : $WHT$edit_name$NRM\n";
         }
+        print "14. Allow server charset search : $WHT$allow_charset_search$NRM\n";
         print "\n";
         print "R   Return to Main Menu\n";
     } elsif ( $menu == 5 ) {
@@ -503,7 +511,6 @@ while ( ( $command ne "q" ) && ( $command ne "Q" ) ) {
         print "6.  Field for prefs key    : $WHT$prefs_key_field$NRM\n";
         print "7.  Field for prefs value  : $WHT$prefs_val_field$NRM\n";
         print "\n";
-        print "S   Save data\n";
         print "R   Return to Main Menu\n";
     }
     if ( $config_use_color == 1 ) {
@@ -593,6 +600,7 @@ while ( ( $command ne "q" ) && ( $command ne "Q" ) ) {
             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(); }
@@ -607,6 +615,7 @@ while ( ( $command ne "q" ) && ( $command ne "Q" ) ) {
             elsif ( $command == 11 ) { $allow_thread_sort        = command312(); }
             elsif ( $command == 12 ) { $allow_server_sort        = command313(); }
             elsif ( $command == 13 ) { $edit_name                = command311(); }
+            elsif ( $command == 14 ) { $allow_charset_search     = command314(); }
         } elsif ( $menu == 5 ) {
             if ( $command == 1 ) { command41(); }
             elsif ( $command == 2 ) { $theme_css = command42(); }
@@ -917,6 +926,7 @@ sub command19 {
     print "    uw         = University of Washington's IMAP server\n";
     print "    exchange   = Microsoft Exchange IMAP server\n";
     print "    courier    = Courier IMAP server\n";
+    print "    macosx     = Mac OS X Mailserver\n";
     print "    other      = Not one of the above servers\n";
     print "[$WHT$imap_server_type$NRM]: $WHT";
     $new_imap_server_type = <STDIN>;
@@ -1075,12 +1085,13 @@ sub command21 {
         $new_default_folder_prefix = "";
     } else {
         # add the trailing delimiter only if we know what the server is.
-        if ($optional_delimiter and $optional_delimiter ne 'detect') {
-           $new_default_folder_prefix =~ s/${optional_delimiter}*$/$optional_delimiter/;
-        } elsif ($imap_server_type eq 'cyrus' or
-                 $imap_server_type eq 'courier') {
+        if (($imap_server_type eq 'cyrus' and
+                  $optional_delimiter eq 'detect') or
+                 ($imap_server_type eq 'courier' and
+                  $optional_delimiter eq 'detect')) {
            $new_default_folder_prefix =~ s/\.*$/\./;
-        } elsif ($imap_server_type eq 'uw') {
+        } elsif ($imap_server_type eq 'uw' and
+                 $optional_delimiter eq 'detect') {
            $new_default_folder_prefix =~ s/\/*$/\//;
         }
     }
@@ -1457,6 +1468,27 @@ sub command215 {
     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
@@ -1745,6 +1777,27 @@ sub command313 {
     return $allow_server_sort;
 }
 
+sub command314 {
+    print "This option allows you to choose if SM uses charset search\n";
+    print "Your IMAP server must support the SEARCH CHARSET command for this to work\n";
+    print "\n";
+
+    if ( lc($allow_charset_search) eq "true" ) {
+        $default_value = "y";
+    } else {
+        $default_value = "n";
+    }
+    print "Allow charset searching? (y/n) [$WHT$default_value$NRM]: $WHT";
+    $allow_charset_search = <STDIN>;
+    if ( ( $allow_charset_search =~ /^y\n/i ) || ( ( $allow_charset_search =~ /^\n/ ) && ( $default_value eq "y" ) ) ) {
+        $allow_charset_search = "true";
+    } else {
+        $allow_charset_search = "false";
+    }
+    return $allow_charset_search;
+}
+
+
 sub command41 {
     print "\nNow we will define the themes that you wish to use.  If you have added\n";
     print "a theme of your own, just follow the instructions (?) about how to add\n";
@@ -2294,6 +2347,9 @@ sub save_data {
         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
@@ -2322,6 +2378,8 @@ sub save_data {
         print CF "\$allow_thread_sort        = $allow_thread_sort;\n";
        # boolean
         print CF "\$allow_server_sort        = $allow_server_sort;\n";
+        # boolean
+        print CF "\$allow_charset_search        = $allow_charset_search;\n";
         print CF "\n";
        
        # all plugins are strings