removed some vars
[squirrelmail.git] / config / conf.pl
index a841520057df74952a8202231b84163187595e39..9554acb5dfc0883132c5fc13e4f0f33caf899ae2 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,13 @@ if ( !$allow_thread_sort ) {
 if ( !$allow_server_sort ) {
     $allow_server_sort = 'false';
 }
+if ( !$uid_support ) {
+    $uid_support = 'true';
+}
+
+if ( !$allow_charset_search ) {
+    $allow_charset_search = 'true';
+}
 if ( !$prefs_user_field ) {
     $prefs_user_field = 'user';
 }
@@ -383,7 +393,7 @@ while ( ( $command ne "q" ) && ( $command ne "Q" ) ) {
             print "8.    Authenticated SMTP : $WHT$use_authenticated_smtp$NRM\n";
             print "9.    POP Before SMTP    : $WHT$pop_before_smtp$NRM\n";
         }
-        print "10.  Server               : $WHT$imap_server_type$NRM\n";
+        print "10. Server               : $WHT$imap_server_type$NRM\n";
         print "11. Invert Time          : $WHT$invert_time$NRM\n";
         print "12. Delimiter            : $WHT$optional_delimiter$NRM\n";
         print "\n";
@@ -407,6 +417,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 +437,8 @@ 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 "15. Enable UID support : $WHT$uid_support$NRM\n";
         print "\n";
         print "R   Return to Main Menu\n";
     } elsif ( $menu == 5 ) {
@@ -503,7 +516,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 +605,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 +620,8 @@ 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 ( $command == 15 ) { $uid_support              = command315(); }
         } elsif ( $menu == 5 ) {
             if ( $command == 1 ) { command41(); }
             elsif ( $command == 2 ) { $theme_css = command42(); }
@@ -730,7 +745,7 @@ sub command4 {
 sub command5 {
     print "SquirrelMail attempts to set the language in many ways.  If it\n";
     print "can not figure it out in another way, it will default to this\n";
-    print "language.  Please use the two-letter code for the desired language.\n";
+    print "language.  Please use the code for the desired language.\n";
     print "\n";
     print "[$WHT$squirrelmail_default_language$NRM]: $WHT";
     $new_signout_page = <STDIN>;
@@ -764,7 +779,7 @@ sub command6 {
 
 # domain
 sub command11 {
-    print "The domain name is the suffix at the end of all email messages.  If\n";
+    print "The domain name is the suffix at the end of all email addresses.  If\n";
     print "for example, your email address is jdoe\@myorg.com, then your domain\n";
     print "would be myorg.com.\n";
     print "\n";
@@ -917,6 +932,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 +1091,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 +1474,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 +1783,46 @@ 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 command315 {
+    print "This option allows you to enable unique identifier (UID) support.\n";
+    print "\n";
+
+    if ( lc($uid_support) eq "true" ) {
+        $default_value = "y";
+    } else {
+        $default_value = "n";
+    }
+    print "Enable Unique identifier (UID) support? (y/n) [$WHT$default_value$NRM]: $WHT";
+    $uid_support = <STDIN>;
+    if ( ( $uid_support =~ /^y\n/i ) || ( ( $uid_support =~ /^\n/ ) && ( $default_value eq "y" ) ) ) {
+        $uid_support = "true";
+    } else {
+        $uid_support = "false";
+    }
+    return $uid_support;
+}
+
+
 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 +2372,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 +2403,10 @@ 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";
+        # boolean
+        print CF "\$uid_support              = $uid_support;\n";
         print CF "\n";
        
        # all plugins are strings
@@ -2389,6 +2474,8 @@ sub save_data {
         print CF "\$prefs_key_field = '$prefs_key_field';\n";
        # string
         print CF "\$prefs_val_field = '$prefs_val_field';\n";
+       # boolean
+       print CF "\$no_list_for_subscribe = $no_list_for_subscribe;\n";
         print CF "\n";
 
         print CF "/**\n";
@@ -2433,6 +2520,7 @@ sub set_defaults {
         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 "    quit       = Do not change anything\n";
         print "Command >> ";
         $server = <STDIN>;
@@ -2490,6 +2578,20 @@ sub set_defaults {
             $optional_delimiter             = ".";
             $disp_default_folder_prefix     = $default_folder_prefix;
 
+            $continue = 1;
+        } elsif ( $server eq "macosx" ) {
+            $imap_server_type               = "macosx";
+            $default_folder_prefix          = "INBOX/";
+            $trash_folder                   = "Trash";
+            $sent_folder                    = "Sent";
+            $draft_folder                   = "Drafts";
+            $show_prefix_option             = false;
+            $default_sub_of_inbox           = true;
+            $show_contain_subfolders_option = false;
+            $optional_delimiter             = "detect";
+            $allow_charset_search           = false;
+            $disp_default_folder_prefix     = $default_folder_prefix;
+
             $continue = 1;
         } elsif ( $server eq "quit" ) {
             $continue = 1;