-
-
-############################################################
-# default_sub_of_inbox
-############################################################
-if ($default_sub_of_inbox eq "false") {
- $default_value = "n";
-} else {
- $default_value = "y";
-}
-print "By default, are new folders subfolders of INBOX (y/n) [$default_value]: ";
-$autoe = <STDIN>;
-if (($autoe =~ /^y\n/i) || (($autoe =~ /^\n/) && ($default_value eq "y"))) {
- print FILE " \$default_sub_of_inbox = true;\n";
-} else {
- print FILE " \$default_sub_of_inbox = false;\n";
-}
-
-
-
-
-############################################################
-# show_contain_subfolders_option
-############################################################
-print "\nSome IMAP daemons (UW) handle folders weird. They only allow a\n";
-print "folder to contain either messages or subfolders. Not both at the\n";
-print "same time. This option controls whether or not to display an \n";
-print "option during folder creation letting them choose if this folder\n";
-print "contains messages or folders.\n";
-if ($show_contain_subfolders_option eq "false") {
- $default_value = "n";
-} else {
- $default_value = "y";
-}
-print "Show the option to contain subfolders (y/n) [$default_value]: ";
-$autoe = <STDIN>;
-if (($autoe =~ /^y\n/i) || (($autoe =~ /^\n/) && ($default_value eq "y"))) {
- print FILE " \$show_contain_subfolders_option = true;\n";
-} else {
- print FILE " \$show_contain_subfolders_option = false;\n";
-}
-
-
-
-
-
-############################################################
-# auto_forward
-############################################################
-print "\nThis option decides whether or not to use META tags to forward\n";
-print "users past some of the notification screens\n";
-if ($auto_forward eq "false") {
- $default_value = "n";
-} else {
- $default_value = "y";
-}
-print "Automatically forward where possible (y/n) [$default_value]: ";
-$autoe = <STDIN>;
-if (($autoe =~ /^y\n/i) || (($autoe =~ /^\n/) && ($default_value eq "y"))) {
- print FILE " \$auto_forward = true;\n";
-} else {
- print FILE " \$auto_forward = false;\n";
-}
-
-
-
-
-############################################################
-# DEFAULT CHARSET
-############################################################
-print "\nThis option controls what character set is used when sending mail\n";
-print "and when sending HTMl to the browser. Do not set this to US-ASCII,\n";
-print "use ISO-8859-1 instead. For cyrillic it is best to use KOI8-R,\n";
-print "since this implementation is faster than the alternatives.\n";
-print "Default charset [$default_charset]: ";
-$new_default_charset = <STDIN>;
-if ($new_default_charset eq "\n") {
- $new_default_charset = $default_charset;
-} else {
- $new_default_charset =~ s/[\r|\n]//g;
-}
-print FILE " ".'$default_charset = "' . $new_default_charset . "\";\n";
-
-
-
-
-############################################################
-# DATA DIRECTORY
-############################################################
-print "\nIt is a possible security hole to have a writable directory\n";
-print "under the web server's root directory (ex: /home/httpd/html).\n";
-print "For this reason, it is possible to put the data directory\n";
-print "anywhere you would like. The path name can be absolute or\n";
-print "relative (to the config directory). It doesn't matter. Here are\n";
-print "two examples:\n";
-print " Absolute:\n";
-print " /usr/local/squirrelmail/data/;\n";
-print " Relative (to the config directory):\n";
-print " ../data/;\n";
-print "Where is the data directory [$data_dir]: ";
-$new_data_dir = <STDIN>;
-if ($new_data_dir eq "\n") {
- $new_data_dir = $data_dir;
-} else {
- $new_data_dir =~ s/[\r|\n]//g;
-}
-print FILE " ".'$data_dir = "' . $new_data_dir . "\";\n";
-
-
-
-
-############################################################
-# ATTACHMENT DIRECTORY
-############################################################
-print "\nPath to directory used for storing attachments while a mail is\n";
-print "being sent. There are a few security considerations regarding this\n";
-print "directory:\n";
-print " - It should have the permission 733 (rwx-wx-wx) to make it\n";
-print " impossible for a random person with access to the webserver to\n";
-print " list files in this directory. Confidential data might be laying\n";
-print " around there\n";
-print " - Since the webserver is not able to list the files in the content\n";
-print " is also impossible for the webserver to delete files lying around\n";
-print " there for too long.\n";
-print " - It should probably be another directory than data_dir.\n";
-print "Where is the attachment directory [$attachment_dir]: ";
-$new_attachment_dir = <STDIN>;
-if ($new_attachment_dir eq "\n") {
- $new_attachment_dir = $attachment_dir;
-} else {
- $new_attachment_dir =~ s/[\r|\n]//g;
-}
-print FILE " ".'$attachment_dir = "' . $new_attachment_dir . "\";\n";
-
-
-
-
-############################################################
-# DEFAULT LEFT SIZE
-############################################################
-print "What is the default left folder list size (pixels) [$default_left_size]: ";
-$new_default_left_size = <STDIN>;
-if ($new_default_left_size eq "\n") {
- $new_default_left_size = $default_left_size;
-} else {
- $new_default_left_size =~ s/[\r|\n]//g;
-}
-print FILE " ".'$default_left_size = "' . $new_default_left_size . "\";\n";
-
-
-
-
-
-
-
-print "\n-------------------------------------------------.\n";
-print " Special Folders )\n";
-print "-------------------------------------------------'\n";
-
-############################################################
-# Trash folder
-############################################################
-print "What is the default trash folder [$trash_folder]: ";
-$new_trash_folder = <STDIN>;
-if ($new_trash_folder eq "\n") {
- $new_trash_folder = $trash_folder;
-} else {
- $new_trash_folder =~ s/[\r|\n]//g;
-}
-print FILE " ".'$trash_folder = "' . $new_trash_folder . "\";\n";
-
-
-
-############################################################
-# Default move to trash
-############################################################
-if ($default_move_to_trash eq "true") {
- $default_value = "y";
-} else {
- $default_value = "n";
-}
-print "By default, should deleted messages be moved to $new_trash_folder (y/n) [$default_value]: ";
-$move_trash = <STDIN>;
-if (($move_trash =~ /^y\n/i) || (($move_trash =~ /^\n/) && ($default_value eq "y"))) {
- print FILE " \$default_move_to_trash = true;\n";
-} else {
- print FILE " \$default_move_to_trash = false;\n";
-}
-
-
-
-############################################################
-# Sent folder
-############################################################
-print "What is the default sent folder [$sent_folder]: ";
-$new_sent_folder = <STDIN>;
-if ($new_sent_folder eq "\n") {
- $new_sent_folder = $sent_folder;
-} else {
- $new_sent_folder =~ s/[\r|\n]//g;
-}
-print FILE " ".'$sent_folder = "' . $new_sent_folder . "\";\n";
-
-
-
-
-############################################################
-# Special Folders
-############################################################
-print "\nSpecial folders are folders that can't be manipulated like normal\n";
-print "user-created folders. A couple of examples of these would be the\n";
-print "trash folder, the sent folder, etc.\n";
-print "Special Folders:\n";
-$count = 0;
-print "\n";
-while ($count < @special_folders) {
- print " $count) " . $special_folders[$count] . "\n";
- $count++;
-}
-print "[folders] command (?=help) > ";
-$input = <STDIN>;
-$input =~ s/[\r|\n]//g;
-while ($input ne "d") {
- ## ADD
- if ($input =~ /^\s*\+\s*.*/) {
- $input =~ s/^\s*\+\s*//;
- $special_folders[$#special_folders+1] = $input;
- }
-
- elsif ($input =~ /^\s*-\s*[0-9]?/) {
- if ($input =~ /[0-9]+\s*$/) {
- $rem_num = $input;
- $rem_num =~ s/^\s*-\s*//g;
- $rem_num =~ s/\s*$//;
- } else {
- $rem_num = $#special_folders;
- }
-
- if ($rem_num == 0) {
- print "You cannot remove INBOX. It is a very special folder.\n";
- } else {
- $count = 0;
- @new_special_folders = ();
- while ($count <= $#special_folders) {
- if ($count != $rem_num) {
- @new_special_folders = (@new_special_folders, $special_folders[$count]);
- }
- $count++;
- }
- @special_folders = @new_special_folders;
- }
- }
-
- elsif ($input =~ /^\s*l\s*/) {
- $count = 0;
- print "\n";
- while ($count < @special_folders) {
- print " $count) " . $special_folders[$count] . "\n";
- $count++;
- }
- } elsif ($input =~ /^\s*\?\s*/) {
- print ".-------------------------.\n";
- print "| + Folder (add folder) |\n";
- print "| - N (remove folder) |\n";
- print "| l (list folders) |\n";
- print "| d (done) |\n";
- print "`-------------------------'\n";
- }
-
- else {
- print "Unrecognized command.\n";
- }
-
- print "[folders] command (?=help) > ";
- $input = <STDIN>;
- $input =~ s/[\r|\n]//g;
-}
-
-$count = 0;
-while ($count <= $#special_folders) {
- print FILE " \$special_folders[$count] = \"$special_folders[$count]\";\n";
- $count++;
-}
-
-
-############################################################
-# Use special folder color
-############################################################
-if ($use_special_folder_color eq "true") {
- $default_value = "y";
-} else {
- $default_value = "n";
-}
-print "\nHighlight special folders in a different color (y/n) [$default_value]: ";
-$use_spec_folder = <STDIN>;
-if (($use_spec_folder =~ /^y\n/i) || (($use_spec_folder =~ /^\n/) && ($default_value eq "y"))) {
- print FILE " \$use_special_folder_color = true;\n";
-} else {
- print FILE " \$use_special_folder_color = false;\n";
-}
-
-
-
-
-############################################################
-# list_special_folders_first
-############################################################
-if ($list_special_folders_first eq "false") {
- $default_value = "n";
-} else {
- $default_value = "y";
-}
-print "Should special folders be listed first (y/n) [$default_value]: ";
-$autoe = <STDIN>;
-if (($autoe =~ /^y\n/i) || (($autoe =~ /^\n/) && ($default_value eq "y"))) {
- print FILE " \$list_special_folders_first = true;\n";
-} else {
- print FILE " \$list_special_folders_first = false;\n";
-}
-
-
-
-
-############################################################
-# Themes
-############################################################
-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";
-print "them. You can also change the default theme.\n";
-print "[theme] command (?=help) > ";
-$input = <STDIN>;
-$input =~ s/[\r|\n]//g;
-$theme_default = 0;
-while ($input ne "d") {
- if ($input =~ /^\s*l\s*/i) {
- $count = 0;
- while ($count <= $#theme_name) {
- if ($count == $theme_default) {
- print " *";
- } else {
- print " ";
- }
- $name = $theme_name[$count];
- $num_spaces = 25 - length($name);
- for ($i = 0; $i < $num_spaces;$i++) {
- $name = $name . " ";
- }
-
- print " $count. $name";
- print "($theme_path[$count])\n";
-
- $count++;
- }
- } elsif ($input =~ /^\s*m\s*[0-9]+/i) {
- $old_def = $theme_default;
- $theme_default = $input;
- $theme_default =~ s/^\s*m\s*//;
- if (($theme_default > $#theme_name) || ($theme_default < 0)) {
- print "Cannot set default theme to $theme_default. That theme does not exist.\n";
- $theme_default = $old_def;
- }
- } elsif ($input =~ /^\s*\+/) {
- print "What is the name of this theme: ";
- $name = <STDIN>;
- $name =~ s/[\r|\n]//g;
- $theme_name[$#theme_name+1] = $name;
- print "Be sure to put ../config/ before the filename.\n";
- print "What file is this stored in (ex: ../config/default_theme.php): ";
- $name = <STDIN>;
- $name =~ s/[\r|\n]//g;
- $theme_path[$#theme_path+1] = $name;
- } elsif ($input =~ /^\s*-\s*[0-9]?/) {
- if ($input =~ /[0-9]+\s*$/) {
- $rem_num = $input;
- $rem_num =~ s/^\s*-\s*//g;
- $rem_num =~ s/\s*$//;
- } else {
- $rem_num = $#theme_name;
- }
- if ($rem_num == $theme_default) {
- print "You cannot remove the default theme!\n";
- } else {
- $count = 0;
- @new_theme_name = ();
- @new_theme_path = ();
- while ($count <= $#theme_name) {
- if ($count != $rem_num) {
- @new_theme_name = (@new_theme_name, $theme_name[$count]);
- @new_theme_path = (@new_theme_path, $theme_path[$count]);
- }
- $count++;
- }
- @theme_name = @new_theme_name;
- @theme_path = @new_theme_path;
- if ($theme_default > $rem_num) {
- $theme_default--;
- }
- }
- } elsif ($input =~ /^\s*\?\s*/) {
- print ".-------------------------.\n";
- print "| + (add theme) |\n";
- print "| - N (remove theme) |\n";
- print "| m N (mark default) |\n";
- print "| l (list themes) |\n";
- print "| d (done) |\n";
- print "`-------------------------'\n";
- }
- print "[theme] command (?=help) > ";
- $input = <STDIN>;
- $input =~ s/[\r|\n]//g;
-}
-
-$count = 0;
-print FILE " \$theme[0][\"NAME\"] = \"$theme_name[$theme_default]\";\n";
-print FILE " \$theme[0][\"PATH\"] = \"$theme_path[$theme_default]\";\n";
-$index = 1;
-while ($count < $#theme_name) {
- if ($count != $theme_default) {
- print FILE " \$theme[$index][\"NAME\"] = \"$theme_name[$count]\";\n";
- print FILE " \$theme[$index][\"PATH\"] = \"$theme_path[$count]\";\n";
- $index++;
- }
- $count++;
-}
-
-print FILE "\n?>\n";
-close FILE;
-
-
-print "\n\nFINISHED!\n";
-print "All changes have been written to cf.php. If you would like, I can write\n";
-print "the changes to config.php.\n";
-print "Overwrite config.php (y/n) [y]: ";
-$autoe = <STDIN>;
-if (($autoe =~ /^y\n/i) || ($autoe =~ /^\n/)) {
- system "mv -f cf.php config.php";
-}
-
-