ea7dcd07453317347794352ecc90eee7e9ee6299
3 # Luke Ehresman (luke@squirrelmail.org)
5 # A simple configure script to configure squirrelmail
6 ############################################################
9 $conf_pl_version = "x51";
11 ############################################################
12 # First, lets read in the data already in there...
13 ############################################################
14 if ( -e
"config.php") {
15 open (FILE
, "config.php");
16 while ($line = <FILE
>) {
17 if ($line =~ /^\s+\$/) {
22 if ($var =~ /^([a-z]|[A-Z])/) {
23 @o = split(/\s*EQUALS\s*/, $var);
24 if ($o[0] eq "config_version") {
25 $o[1] =~ s/[\n|\r]//g;
30 $config_version = $o[1];
38 if ($config_version ne $conf_pl_version) {
40 print $WHT."WARNING:\n".$NRM;
41 print " The file \"config/config.php\" was found, but it is for an older version of\n";
42 print " SquirrelMail. It is possible to still read the defaults from this file\n";
43 print " but be warned that many preferences change between versions. It is\n";
44 print " recommended that you start with a clean config.php for each upgrade that\n";
45 print " you do. To do this, just move config/config.php out of the way.\n\n";
46 print "Continue loading with the old config.php [y/n]? ";
48 if (($ctu =~ /^n\n/i) || ($ctu =~ /^\n/)) {
52 print "\nDo you want me to stop warning you [y/n]? ";
54 if ($ctu =~ /^y\n/i) {
55 $print_config_version = $conf_pl_version;
57 $print_config_version = $config_version;
60 $print_config_version = $config_version;
64 open (FILE
, "config.php");
65 } elsif (-e
"config_default.php") {
66 open (FILE
, "config_default.php");
67 while ($line = <FILE
>) {
68 if ($line =~ /^\s+\$/) {
73 if ($var =~ /^([a-z]|[A-Z])/) {
74 @o = split(/\s*EQUALS\s*/, $var);
75 if ($o[0] eq "config_version") {
76 $o[1] =~ s/[\n|\r]//g;
81 $config_version = $o[1];
89 if ($config_version ne $conf_pl_version) {
91 print $WHT."WARNING:\n".$NRM;
92 print " You are trying to use a \"config_default.php\" from an older version of\n";
93 print " SquirrelMail. This is HIGHLY unrecommended. You should get the\n";
94 print " \"config_default.php\" that matches the version of SquirrelMail that you\n";
95 print " are running. You can get this from the SquirrelMail web page by going\n";
96 print " to: http://www.squirrelmail.org.\n\n";
97 print "Continue loading with the old config_default.php (not a good idea) [y/n]? ";
99 if (($ctu =~ /^n\n/i) || ($ctu =~ /^\n/)) {
103 print "\nDo you want me to stop warning you [y/n]? ";
105 if ($ctu =~ /^y\n/i) {
106 $print_config_version = $conf_pl_version;
108 $print_config_version = $config_version;
111 $print_config_version = $config_version;
114 open (FILE
, "config_default.php");
116 print "No configuration file found. Please get config_default.php or\n";
117 print "config.php before running this again. This program needs a\n";
118 print "default config file to get default values.\n";
122 # Reads and parses the current configuration file (either
123 # config.php or config_default.php).
125 while ($line = <FILE
>) {
126 if ($line =~ /^\s+\$/) {
131 if ($var =~ /^([a-z]|[A-Z])/) {
132 @options = split(/\s*EQUALS\s*/, $var);
133 $options[1] =~ s/[\n|\r]//g;
134 $options[1] =~ s/\";\s*$//;
135 $options[1] =~ s/;$//;
136 $options[1] =~ s/^"//;
138 if ($options[0] =~ /^theme\[[0-9]+\]\["PATH"\]/) {
140 $sub =~ s/\]\["PATH"\]//;
142 if (-e
"../themes") {
143 $options[1] =~ s/^\.\.\/config/\
.\
.\
/themes/;
145 $theme_path[$sub] = $options[1];
146 } elsif ($options[0] =~ /^theme\[[0-9]+\]\["NAME"\]/) {
148 $sub =~ s/\]\["NAME"\]//;
150 $theme_name[$sub] = $options[1];
151 } elsif ($options[0] =~ /^plugins\[[0-9]+\]/) {
154 $sub =~ s/^plugins\[//;
155 $plugins[$sub] = $options[1];
156 } elsif ($options[0] =~ /^ldap_server\[[0-9]+\]/) {
159 $sub =~ s/^ldap_server\[//;
161 while (($tmp = <FILE
>) && ($continue != 1)) {
162 if ($tmp =~ /\);\s*$/) {
166 if ($tmp =~ /^\s*"host"/i) {
167 $tmp =~ s/^\s*"host"\s*=>\s*"//i;
169 $tmp =~ s/"\);\s*$//;
171 } elsif ($tmp =~ /^\s*"base"/i) {
172 $tmp =~ s/^\s*"base"\s*=>\s*"//i;
174 $tmp =~ s/"\);\s*$//;
176 } elsif ($tmp =~ /^\s*"charset"/i) {
177 $tmp =~ s/^\s*"charset"\s*=>\s*"//i;
179 $tmp =~ s/"\);\s*$//;
181 } elsif ($tmp =~ /^\s*"port"/i) {
182 $tmp =~ s/^\s*"port"\s*=>\s*"//i;
184 $tmp =~ s/"\);\s*$//;
186 } elsif ($tmp =~ /^\s*"maxrows"/i) {
187 $tmp =~ s/^\s*"maxrows"\s*=>\s*"//i;
189 $tmp =~ s/"\);\s*$//;
191 } elsif ($tmp =~ /^\s*"name"/i) {
192 $tmp =~ s/^\s*"name"\s*=>\s*"//i;
194 $tmp =~ s/"\);\s*$//;
198 $ldap_host[$sub] = $host;
199 $ldap_base[$sub] = $base;
200 $ldap_name[$sub] = $name;
201 $ldap_port[$sub] = $port;
202 $ldap_maxrows[$sub] = $maxrows;
203 $ldap_charset[$sub] = $charset;
205 ${$options[0]} = $options[1];
210 if ($useSendmail ne "true") {
211 $useSendmail = "false";
213 if (!$sendmail_path) {
214 $sendmail_path = "/usr/sbin/sendmail";
216 if (!$default_unseen_notify) {
217 $default_unseen_notify = 2;
219 if (!$default_unseen_type) {
220 $default_unseen_type = 1;
223 #####################################################################################
225 while (($command ne "q") && ($command ne "Q")) {
227 print $WHT."SquirrelMail Configuration : ".$NRM;
228 if ($config == 1) { print "Read: config.php"; }
229 elsif ($config == 2) { print "Read: config_default.php"; }
231 print "---------------------------------------------------------\n";
234 print $WHT."Main Menu --\n".$NRM;
235 print "1. Organization Preferences\n";
236 print "2. Server Settings\n";
237 print "3. Folder Defaults\n";
238 print "4. General Options\n";
240 print "6. Address Books (LDAP)\n";
241 print "7. Message of the Day (MOTD)\n";
242 print "8. Plugins\n";
244 print "D. Set pre-defined settings for specific IMAP servers\n";
246 } elsif ($menu == 1) {
247 print $WHT."Organization Preferences\n".$NRM;
248 print "1. Organization Name : $WHT$org_name$NRM\n";
249 print "2. Organization Logo : $WHT$org_logo$NRM\n";
250 print "3. Organization Title : $WHT$org_title$NRM\n";
252 print "R Return to Main Menu\n";
253 } elsif ($menu == 2) {
254 print $WHT."Server Settings\n".$NRM;
255 print "1. Domain : $WHT$domain$NRM\n";
256 print "2. IMAP Server : $WHT$imapServerAddress$NRM\n";
257 print "3. IMAP Port : $WHT$imapPort$NRM\n";
258 print "4. Use Sendmail/SMTP : $WHT";
259 if ($useSendmail eq "true") {
265 if ($useSendmail eq "true") {
266 print "5. Sendmail Path : $WHT$sendmail_path$NRM\n";
268 print "6. SMTP Server : $WHT$smtpServerAddress$NRM\n";
269 print "7. SMTP Port : $WHT$smtpPort$NRM\n";
271 print "8. Server : $WHT$imap_server_type$NRM\n";
273 print "R Return to Main Menu\n";
274 } elsif ($menu == 3) {
275 print $WHT."Folder Defaults\n".$NRM;
276 print "1. Default Folder Prefix : $WHT$default_folder_prefix$NRM\n";
277 print "2. Show Folder Prefix Option : $WHT$show_prefix_option$NRM\n";
278 print "3. Trash Folder : $WHT$trash_folder$NRM\n";
279 print "4. Sent Folder : $WHT$sent_folder$NRM\n";
280 print "5. By default, move to trash : $WHT$default_move_to_trash$NRM\n";
281 print "6. By default, move to sent : $WHT$default_move_to_sent$NRM\n";
282 print "7. List Special Folders First : $WHT$list_special_folders_first$NRM\n";
283 print "8. Show Special Folders Color : $WHT$use_special_folder_color$NRM\n";
284 print "9. Auto Expunge : $WHT$auto_expunge$NRM\n";
285 print "10. Default Sub. of INBOX : $WHT$default_sub_of_inbox$NRM\n";
286 print "11. Show 'Contain Sub.' Option : $WHT$show_contain_subfolders_option$NRM\n";
287 print "12. Default Unseen Notify : $WHT$default_unseen_notify$NRM\n";
288 print "13. Default Unseen Type : $WHT$default_unseen_type$NRM\n";
290 print "R Return to Main Menu\n";
291 } elsif ($menu == 4) {
292 print $WHT."General Options\n".$NRM;
293 print "1. Default Charset : $WHT$default_charset$NRM\n";
294 print "2. Data Directory : $WHT$data_dir$NRM\n";
295 print "3. Attachment Directory : $WHT$attachment_dir$NRM\n";
296 print "4. Default Left Size : $WHT$default_left_size$NRM\n";
298 print "R Return to Main Menu\n";
299 } elsif ($menu == 5) {
300 print $WHT."Themes\n".$NRM;
301 print "1. Change Themes\n";
302 for ($count = 0; $count <= $#theme_name; $count++) {
303 print " > $theme_name[$count]\n";
306 print "R Return to Main Menu\n";
307 } elsif ($menu == 6) {
308 print $WHT."Address Books (LDAP)\n".$NRM;
309 print "1. Change Servers\n";
310 for ($count = 0; $count <= $#ldap_host; $count++) {
311 print " > $ldap_host[$count]\n";
313 print "2. Use Javascript Address Book Search : $WHT$default_use_javascript_addr_book$NRM\n";
315 print "R Return to Main Menu\n";
316 } elsif ($menu == 7) {
317 print $WHT."Message of the Day (MOTD)\n".$NRM;
320 print "1 Edit the MOTD\n";
322 print "R Return to Main Menu\n";
323 } elsif ($menu == 8) {
324 print $WHT."Plugins\n".$NRM;
325 print "1 Change Plugins\n";
326 for ($count = 0; $count <= $#plugins; $count++) {
327 print " > $plugins[$count]\n";
330 print "R Return to Main Menu\n";
332 print "S Save data\n";
336 print "Command >> ".$WHT;
338 $command =~ s/[\n|\r]//g;
341 # Read the commands they entered.
342 if (($command eq "R") || ($command eq "r")) {
344 } elsif (($command eq "s") || ($command eq "S")) {
346 print "Data saved in config.php\n";
347 print "Press any key to continue...";
350 } elsif ((($command eq "q") || ($command eq "Q")) && ($saved == 0)) {
351 print "You have not saved your data.\n";
352 print "Save? (y/n) [".$WHT."y".$NRM."]: ";
354 if (($save =~ /^y/i) || ($save =~ /^\s*$/)) {
357 } elsif (($command eq "d") || ($command eq "D")) {
362 if (($command > 0) && ($command < 9)) {
365 } elsif ($menu == 1) {
366 if ($command == 1) { $org_name = command1
(); }
367 elsif ($command == 2) { $org_logo = command2
(); }
368 elsif ($command == 3) { $org_title = command3
(); }
369 } elsif ($menu == 2) {
370 if ($command == 1) { $domain = command11
(); }
371 elsif ($command == 2) { $imapServerAddress = command12
(); }
372 elsif ($command == 3) { $imapPort = command13
(); }
373 elsif ($command == 4) { $useSendmail = command14
(); }
374 elsif ($command == 5) { $sendmail_path = command15
(); }
375 elsif ($command == 6) { $smtpServerAddress = command16
(); }
376 elsif ($command == 7) { $smtpPort = command17
(); }
377 elsif ($command == 8) { $imap_server_type = command18
(); }
378 } elsif ($menu == 3) {
379 if ($command == 1) { $default_folder_prefix = command21
(); }
380 elsif ($command == 2) { $show_prefix_option = command22
(); }
381 elsif ($command == 3) { $trash_folder = command23
(); }
382 elsif ($command == 4) { $sent_folder = command24
(); }
383 elsif ($command == 5) { $default_move_to_trash = command25
(); }
384 elsif ($command == 6) { $default_move_to_sent = command26
(); }
385 elsif ($command == 7) { $list_special_folders_first = command27
(); }
386 elsif ($command == 8) { $use_special_folder_color = command28
(); }
387 elsif ($command == 9) { $auto_expunge = command29
(); }
388 elsif ($command == 10){ $default_sub_of_inbox = command210
(); }
389 elsif ($command == 11){ $show_contain_subfolders_option = command211
(); }
390 elsif ($command == 12){ $default_unseen_notify = command212
(); }
391 elsif ($command == 13){ $default_unseen_type = command213
(); }
392 } elsif ($menu == 4) {
393 if ($command == 1) { $default_charset = command31
(); }
394 elsif ($command == 2) { $data_dir = command33
(); }
395 elsif ($command == 3) { $attachment_dir = command34
(); }
396 elsif ($command == 4) { $default_left_size = command35
(); }
397 } elsif ($menu == 5) {
401 } elsif ($menu == 6) {
402 if ($command == 1) { command61
(); }
403 elsif ($command == 2) { command62
(); }
404 } elsif ($menu == 7) {
405 if ($command == 1) { $motd = command71
(); }
406 } elsif ($menu == 8) {
407 if ($command == 1) { $plugins = command81
(); }
412 ####################################################################################
416 print "We have tried to make the name SquirrelMail as transparent as\n";
417 print "possible. If you set up an organization name, most places where\n";
418 print "SquirrelMail would take credit will be credited to your organization.\n";
420 print "[$WHT$org_name$NRM]: $WHT";
421 $new_org_name = <STDIN
>;
422 if ($new_org_name eq "\n") {
423 $new_org_name = $org_name;
425 $new_org_name =~ s/[\r|\n]//g;
427 return $new_org_name;
433 print "Your organization's logo is an image that will be displayed at\n";
434 print "different times throughout SquirrelMail. This is asking for the\n";
435 print "literal (/usr/local/squirrelmail/images/logo.jpg) or relative\n";
436 print "(../images/logo.jpg) path to your logo.\n";
438 print "[$WHT$org_logo$NRM]: $WHT";
439 $new_org_logo = <STDIN
>;
440 if ($new_org_logo eq "\n") {
441 $new_org_logo = $org_logo;
443 $new_org_logo =~ s/[\r|\n]//g;
445 return $new_org_logo;
450 print "A title is what is displayed at the top of the browser window in\n";
451 print "the titlebar. Usually this will end up looking something like:\n";
452 print "\"Netscape: $org_title\"\n";
454 print "[$WHT$org_title$NRM]: $WHT";
455 $new_org_title = <STDIN
>;
456 if ($new_org_title eq "\n") {
457 $new_org_title = $org_title;
459 $new_org_title =~ s/[\r|\n]//g;
461 return $new_org_title;
464 ####################################################################################
468 print "The domain name is the suffix at the end of all email messages. If\n";
469 print "for example, your email address is jdoe\@myorg.com, then your domain\n";
470 print "would be myorg.com.\n";
472 print "[$WHT$domain$NRM]: $WHT";
473 $new_domain = <STDIN
>;
474 if ($new_domain eq "\n") {
475 $new_domain = $domain;
477 $new_domain =~ s/[\r|\n]//g;
484 print "This is the address where your IMAP server resides.\n";
485 print "[$WHT$imapServerAddress$NRM]: $WHT";
486 $new_imapServerAddress = <STDIN
>;
487 if ($new_imapServerAddress eq "\n") {
488 $new_imapServerAddress = $imapServerAddress;
490 $new_imapServerAddress =~ s/[\r|\n]//g;
492 return $new_imapServerAddress;
497 print "This is the port that your IMAP server is on. Usually this is 143.\n";
498 print "[$WHT$imapPort$NRM]: $WHT";
499 $new_imapPort = <STDIN
>;
500 if ($new_imapPort eq "\n") {
501 $new_imapPort = $imapPort;
503 $new_imapPort =~ s/[\r|\n]//g;
505 return $new_imapPort;
510 print "You now need to choose the method that you will use for sending\n";
511 print "messages in SquirrelMail. You can either connect to an SMTP server\n";
512 print "or use sendmail directly.\n";
513 if ($useSendmail eq "true") {
514 $default_value = "1";
516 $default_value = "2";
519 print " 1. Sendmail\n";
521 print "Your choice [1/2] [$WHT$default_value$NRM]: $WHT";
522 $use_sendmail = <STDIN
>;
523 if (($use_sendmail =~ /^1\n/i) || (($use_sendmail =~ /^\n/) && ($default_value eq "1"))) {
524 $useSendmail = "true";
526 $useSendmail = "false";
533 if ($sendmail_path[0] !~ /./) {
534 $sendmail_path = "/usr/sbin/sendmail";
536 print "Specify where the sendmail executable is located. Usually /usr/sbin/sendmail\n";
537 print "[$WHT$sendmail_path$NRM]: $WHT";
538 $new_sendmail_path = <STDIN
>;
539 if ($new_sendmail_path eq "\n") {
540 $new_sendmail_path = $sendmail_path;
542 $new_sendmail_path =~ s/[\r|\n]//g;
544 return $new_sendmail_path;
549 print "This is the location of your SMTP server.\n";
550 print "[$WHT$smtpServerAddress$NRM]: $WHT";
551 $new_smtpServerAddress = <STDIN
>;
552 if ($new_smtpServerAddress eq "\n") {
553 $new_smtpServerAddress = $smtpServerAddress;
555 $new_smtpServerAddress =~ s/[\r|\n]//g;
557 return $new_smtpServerAddress;
562 print "This is the port to connect to for SMTP. Usually 25.\n";
563 print "[$WHT$smtpPort$NRM]: $WHT";
564 $new_smtpPort = <STDIN
>;
565 if ($new_smtpPort eq "\n") {
566 $new_smtpPort = $smtpPort;
568 $new_smtpPort =~ s/[\r|\n]//g;
570 return $new_smtpPort;
574 print "Eash IMAP server has its own quirks. As much as we tried to stick\n";
575 print "to standards, it doesn't help much if the IMAP server doesn't follow\n";
576 print "the same principles. We have made some work-arounds for some of\n";
577 print "these servers. If you would like to use them, please select your\n";
578 print "IMAP server. If you do not wish to use these work-arounds, you can\n";
579 print "set this to \"other\", and none will be used.\n";
580 print " cyrus = Cyrus IMAP server\n";
581 print " uw = University of Washington's IMAP server\n";
582 print " exchange = Microsoft Exchange IMAP server\n";
583 print " courier = Courier IMAP server\n";
584 print "[$WHT$imap_server_type$NRM]: $WHT";
585 $new_imap_server_type = <STDIN
>;
586 if ($new_imap_server_type eq "\n") {
587 $new_imap_server_type = $imap_server_type;
589 $new_imap_server_type =~ s/[\r|\n]//g;
591 return $new_imap_server_type;
596 print "\nYou can now create the welcome message that is displayed\n";
597 print "every time a user logs on. You can use HTML or just plain\n";
598 print "text. If you do not wish to have one, just make it blank.\n\n(Type @ on a blank line to exit)\n";
604 $line =~ s/[\r|\n]//g;
606 $line =~ s/ /\ \ /g;
607 $line =~ s/\t/\ \ \ \ /g;
609 $line =~ s/\"/\\\"/g;
611 $new_motd = $new_motd . $line;
613 } while ($line ne "@");
617 ################# PLUGINS ###################
620 print "\nThis is where you can define plugins. The plugin must already exist in the\n";
621 print "plugins/ directory in order to add them here. A plugin name is the name of the\n";
622 print "directory that it resides in. For example, if you have a plugin in the directory\n";
623 print "plugins/myplug, the name is \"myplug\".\n\n";
624 print "[plugins] command (?=help) > ";
626 $input =~ s/[\r|\n]//g;
627 while ($input ne "d") {
628 if ($input =~ /^\s*l\s*/i) {
630 while ($count <= $#plugins) {
631 print " $count. $plugins[$count]\n";
635 } elsif ($input =~ /^\s*\+/) {
636 print "What is the name of this plugin: ";
638 $name =~ s/[\r|\n]//g;
640 if (-e
"../plugins/$name") {
642 for ($m=0; $m <= $#plugins; $m++) {
643 if ($plugins[$m] eq $name) {
648 print "\nThat plugin already exists in the list!\n";
650 $plugins[$#plugins+1] = $name;
654 print "\nThat plugin does not exist in the plugins/ directory!\n\n";
656 } elsif ($input =~ /^\s*-\s*[0-9]?/) {
657 if ($input =~ /[0-9]+\s*$/) {
659 $rem_num =~ s/^\s*-\s*//g;
660 $rem_num =~ s/\s*$//;
662 $rem_num = $#plugins;
667 while ($count <= $#plugins) {
668 if ($count != $rem_num) {
669 @new_plugins = (@new_plugins, $plugins[$count]);
673 @plugins = @new_plugins;
674 } elsif ($input =~ /^\s*\?\s*/) {
675 print ".-------------------------.\n";
676 print "| + (add plugin) |\n";
677 print "| - N (remove plugin) |\n";
678 print "| l (list plugins) |\n";
679 print "| d (done) |\n";
680 print "`-------------------------'\n";
682 print "[plugins] command (?=help) > ";
684 $input =~ s/[\r|\n]//g;
688 ################# FOLDERS ###################
690 # default_folder_prefix
692 print "Some IMAP servers (UW, for example) store mail and folders in\n";
693 print "your user space in a separate subdirectory. This is where you\n";
694 print "specify what that directory is.\n";
696 print "EXAMPLE: mail/";
698 print "NOTE: If you use Cyrus, or some server that would not use this\n";
699 print " option, you must set this to 'none'.\n";
701 print "[$WHT$default_folder_prefix$NRM]: $WHT";
702 $new_default_folder_prefix = <STDIN
>;
703 if ($new_default_folder_prefix eq "\n") {
704 $new_default_folder_prefix = $default_folder_prefix;
706 $new_default_folder_prefix =~ s/[\r|\n]//g;
708 if (($new_default_folder_prefix =~ /^\s*$/) || ($new_default_folder_prefix =~ /none/i)) {
709 $new_default_folder_prefix = "";
711 $new_default_folder_prefix =~ s/\/*$//g
;
712 $new_default_folder_prefix =~ s/$/\//g
;
714 return $new_default_folder_prefix;
719 print "It is possible to set up the default folder prefix as a user\n";
720 print "specific option, where each user can specify what their mail\n";
721 print "folder is. If you set this to false, they will never see the\n";
722 print "option, but if it is true, this option will appear in the\n";
723 print "'options' section.\n";
725 print "NOTE: You set the default folder prefix in option '1' of this\n";
726 print " section. That will be the default if the user doesn't\n";
727 print " specify anything different.\n";
730 if ($show_prefix_option eq "true") {
731 $default_value = "y";
733 $default_value = "n";
736 print "Show option (y/n) [$WHT$default_value$NRM]: $WHT";
738 if (($new_show =~ /^y\n/i) || (($new_show =~ /^\n/) && ($default_value eq "y"))) {
739 $show_prefix_option = "true";
741 $show_prefix_option = "false";
743 return $show_prefix_option;
748 print "You can now specify where the default trash folder is located.\n";
749 print "On servers where you do not want this, you can set it to anything\n";
750 print "and set option 7 to false.\n";
752 print "This is relative to where the rest of your email is kept. You do\n";
753 print "not need to worry about their mail directory. If this folder\n";
754 print "would be ~/mail/trash on the filesystem, you only need to specify\n";
755 print "that this is 'trash', and be sure to put 'mail/' in option 1.\n";
758 print "[$WHT$trash_folder$NRM]: $WHT";
759 $new_trash_folder = <STDIN
>;
760 if ($new_trash_folder eq "\n") {
761 $new_trash_folder = $trash_folder;
763 $new_trash_folder =~ s/[\r|\n]//g;
765 return $new_trash_folder;
770 print "This is where messages that are sent will be stored. SquirrelMail\n";
771 print "by default puts a copy of all outgoing messages in this folder.\n";
773 print "This is relative to where the rest of your email is kept. You do\n";
774 print "not need to worry about their mail directory. If this folder\n";
775 print "would be ~/mail/sent on the filesystem, you only need to specify\n";
776 print "that this is 'sent', and be sure to put 'mail/' in option 1.\n";
779 print "[$WHT$sent_folder$NRM]: $WHT";
780 $new_sent_folder = <STDIN
>;
781 if ($new_sent_folder eq "\n") {
782 $new_sent_folder = $sent_folder;
784 $new_sent_folder =~ s/[\r|\n]//g;
786 return $new_sent_folder;
789 # default move to trash
791 print "By default, should messages get moved to the trash folder? You\n";
792 print "can specify the default trash folder in option 3. If this is set\n";
793 print "to false, messages will get deleted immediately without moving\n";
794 print "to the trash folder.\n";
796 print "Trash folder is currently: $trash_folder\n";
799 if ($default_move_to_trash eq "true") {
800 $default_value = "y";
802 $default_value = "n";
804 print "By default, move to trash (y/n) [$WHT$default_value$NRM]: $WHT";
806 if (($new_show =~ /^y\n/i) || (($new_show =~ /^\n/) && ($default_value eq "y"))) {
807 $default_move_to_trash = "true";
809 $default_move_to_trash = "false";
811 return $default_move_to_trash;
814 # default move to sent
816 print "By default, should messages get moved to the sent folder? You\n";
817 print "can specify the default sent folder in option 4. If this is set\n";
818 print "to false, messages will get sent an no copy will be made.\n";
820 print "Trash folder is currently: $sent_folder\n";
823 if ($default_move_to_sent eq "true") {
824 $default_value = "y";
826 $default_value = "n";
828 print "By default, move to sent (y/n) [$WHT$default_value$NRM]: $WHT";
830 if (($new_show =~ /^y\n/i) || (($new_show =~ /^\n/) && ($default_value eq "y"))) {
831 $default_move_to_sent = "true";
833 $default_move_to_sent = "false";
835 return $default_move_to_sent;
838 # List special folders first
840 print "SquirrelMail has what we call 'special folders' that are not\n";
841 print "manipulated and viewed like normal folders. Some examples of\n";
842 print "these folders would be INBOX, Trash, Sent, etc. This option\n";
843 print "Simply asks if you want these folders listed first in the folder\n";
847 if ($list_special_folders_first eq "true") {
848 $default_value = "y";
850 $default_value = "n";
853 print "List first (y/n) [$WHT$default_value$NRM]: $WHT";
855 if (($new_show =~ /^y\n/i) || (($new_show =~ /^\n/) && ($default_value eq "y"))) {
856 $list_special_folders_first = "true";
858 $list_special_folders_first = "false";
860 return $list_special_folders_first;
863 # Show special folders color
865 print "SquirrelMail has what we call 'special folders' that are not\n";
866 print "manipulated and viewed like normal folders. Some examples of\n";
867 print "these folders would be INBOX, Trash, Sent, etc. This option\n";
868 print "wants to know if we should display special folders in a\n";
869 print "color than the other folders.\n";
872 if ($use_special_folder_color eq "true") {
873 $default_value = "y";
875 $default_value = "n";
878 print "Show color (y/n) [$WHT$default_value$NRM]: $WHT";
880 if (($new_show =~ /^y\n/i) || (($new_show =~ /^\n/) && ($default_value eq "y"))) {
881 $use_special_folder_color = "true";
883 $use_special_folder_color = "false";
885 return $use_special_folder_color;
890 print "The way that IMAP handles deleting messages is as follows. You\n";
891 print "mark the message as deleted, and then to 'really' delete it, you\n";
892 print "expunge it. This option asks if you want to just have messages\n";
893 print "marked as deleted, or if you want SquirrelMail to expunge the \n";
894 print "messages too.\n";
897 if ($auto_expunge eq "true") {
898 $default_value = "y";
900 $default_value = "n";
902 print "Auto expunge (y/n) [$WHT$default_value$NRM]: $WHT";
904 if (($new_show =~ /^y\n/i) || (($new_show =~ /^\n/) && ($default_value eq "y"))) {
905 $auto_expunge = "true";
907 $auto_expunge = "false";
909 return $auto_expunge;
912 # Default sub of inbox
914 print "Some IMAP servers (Cyrus) have all folders as subfolders of INBOX.\n";
915 print "This can cause some confusion in folder creation for users when\n";
916 print "they try to create folders and don't put it as a subfolder of INBOX\n";
917 print "and get permission errors. This option asks if you want folders\n";
918 print "to be subfolders of INBOX by default.\n";
921 if ($default_sub_of_inbox eq "true") {
922 $default_value = "y";
924 $default_value = "n";
926 print "Default sub of INBOX (y/n) [$WHT$default_value$NRM]: $WHT";
928 if (($new_show =~ /^y\n/i) || (($new_show =~ /^\n/) && ($default_value eq "y"))) {
929 $default_sub_of_inbox = "true";
931 $default_sub_of_inbox = "false";
933 return $default_sub_of_inbox;
936 # Show contain subfolder option
938 print "Some IMAP servers (UW) make it so that there are two types of\n";
939 print "folders. Those that contain messages, and those that contain\n";
940 print "subfolders. If this is the case for your server, set this to\n";
941 print "true, and it will ask the user whether the folder they are\n";
942 print "creating contains subfolders or messages.\n";
945 if ($show_contain_subfolders_option eq "true") {
946 $default_value = "y";
948 $default_value = "n";
950 print "Show option (y/n) [$WHT$default_value$NRM]: $WHT";
952 if (($new_show =~ /^y\n/i) || (($new_show =~ /^\n/) && ($default_value eq "y"))) {
953 $show_contain_subfolders_option = "true";
955 $show_contain_subfolders_option = "false";
957 return $show_contain_subfolders_option;
960 # Default Unseen Notify
962 print "This option specifies where the users will receive notification\n";
963 print "about unseen messages by default. This is of course an option that\n";
964 print "can be changed on a user level.\n";
965 print " 1 = No notification\n";
966 print " 2 = Only on the INBOX\n";
967 print " 3 = On all folders\n";
970 print "Which one should be default (1,2,3)? [$WHT$default_unseen_notify$NRM]: $WHT";
972 if ($new_show =~ /^[1|2|3]\n/i) {
973 $default_unseen_notify = $new_show;
975 $default_unseen_notify =~ s/[\r|\n]//g;
976 return $default_unseen_notify;
979 # Default Unseen Type
981 print "Here you can define the default way that unseen messages will be displayed\n";
982 print "to the user in the folder listing on the left side.\n";
983 print " 1 = Only unseen messages (4)\n";
984 print " 2 = Unseen and Total messages (4/27)\n";
987 print "Which one should be default (1,2)? [$WHT$default_unseen_type$NRM]: $WHT";
989 if ($new_show =~ /^[1|2]\n/i) {
990 $default_unseen_type = $new_show;
992 $default_unseen_type =~ s/[\r|\n]//g;
993 return $default_unseen_type;
997 ############# GENERAL OPTIONS #####################
1001 print "This option controls what character set is used when sending\n";
1002 print "mail and when sending HTML to the browser. Do not set this\n";
1003 print "to US-ASCII, use ISO-8859-1 instead. For cyrillic, it is best\n";
1004 print "to use KOI8-R, since this implementation is faster than most\n";
1005 print "of the alternatives\n";
1008 print "[$WHT$default_charset$NRM]: $WHT";
1009 $new_default_charset = <STDIN
>;
1010 if ($new_default_charset eq "\n") {
1011 $new_default_charset = $default_charset;
1013 $new_default_charset =~ s/[\r|\n]//g;
1015 return $new_default_charset;
1020 print "It is a possible security hole to have a writable directory\n";
1021 print "under the web server's root directory (ex: /home/httpd/html).\n";
1022 print "For this reason, it is possible to put the data directory\n";
1023 print "anywhere you would like. The path name can be absolute or\n";
1024 print "relative (to the config directory). It doesn't matter. Here\n";
1025 print "are two examples:\n";
1026 print " Absolute: /usr/local/squirrelmail/data/\n";
1027 print " Relative: ../data/\n";
1030 print "[$WHT$data_dir$NRM]: $WHT";
1031 $new_data_dir = <STDIN
>;
1032 if ($new_data_dir eq "\n") {
1033 $new_data_dir = $data_dir;
1035 $new_data_dir =~ s/[\r|\n]//g;
1037 if ($new_data_dir =~ /^\s*$/) {
1040 $new_data_dir =~ s/\/*$//g
;
1041 $new_data_dir =~ s/$/\//g
;
1043 return $new_data_dir;
1046 # Attachment directory
1048 print "Path to directory used for storing attachments while a mail is\n";
1049 print "being sent. There are a few security considerations regarding this\n";
1050 print "directory:\n";
1051 print " 1. It should have the permission 733 (rwx-wx-wx) to make it\n";
1052 print " impossible for a random person with access to the webserver\n";
1053 print " to list files in this directory. Confidential data might\n";
1054 print " be laying around in there.\n";
1055 print " 2. Since the webserver is not able to list the files in the\n";
1056 print " content is also impossible for the webserver to delete files\n";
1057 print " lying around there for too long.\n";
1058 print " 3. It should probably be another directory than the data\n";
1059 print " directory specified in option 3.\n";
1062 print "[$WHT$attachment_dir$NRM]: $WHT";
1063 $new_attachment_dir = <STDIN
>;
1064 if ($new_attachment_dir eq "\n") {
1065 $new_attachment_dir = $attachment_dir;
1067 $new_attachment_dir =~ s/[\r|\n]//g;
1069 if ($new_attachment_dir =~ /^\s*$/) {
1070 $new_attachment_dir = "";
1072 $new_attachment_dir =~ s/\/*$//g
;
1073 $new_attachment_dir =~ s/$/\//g
;
1075 return $new_attachment_dir;
1080 print "This is the default size (in pixels) of the left folder list.\n";
1081 print "Default is 200, but you can set it to whatever you wish. This\n";
1082 print "is a user preference, so this will only show up as their default.\n";
1084 print "[$WHT$default_left_size$NRM]: $WHT";
1085 $new_default_left_size = <STDIN
>;
1086 if ($new_default_left_size eq "\n") {
1087 $new_default_left_size = $default_left_size;
1089 $new_default_left_size =~ s/[\r|\n]//g;
1091 return $new_default_left_size;
1096 print "\nNow we will define the themes that you wish to use. If you have added\n";
1097 print "a theme of your own, just follow the instructions (?) about how to add\n";
1098 print "them. You can also change the default theme.\n";
1099 print "[theme] command (?=help) > ";
1101 $input =~ s/[\r|\n]//g;
1102 while ($input ne "d") {
1103 if ($input =~ /^\s*l\s*/i) {
1105 while ($count <= $#theme_name) {
1106 if ($count == $theme_default) {
1111 $name = $theme_name[$count];
1112 $num_spaces = 25 - length($name);
1113 for ($i = 0; $i < $num_spaces;$i++) {
1114 $name = $name . " ";
1117 print " $count. $name";
1118 print "($theme_path[$count])\n";
1122 } elsif ($input =~ /^\s*m\s*[0-9]+/i) {
1123 $old_def = $theme_default;
1124 $theme_default = $input;
1125 $theme_default =~ s/^\s*m\s*//;
1126 if (($theme_default > $#theme_name) || ($theme_default < 0)) {
1127 print "Cannot set default theme to $theme_default. That theme does not exist.\n";
1128 $theme_default = $old_def;
1130 } elsif ($input =~ /^\s*\+/) {
1131 print "What is the name of this theme: ";
1133 $name =~ s/[\r|\n]//g;
1134 $theme_name[$#theme_name+1] = $name;
1135 print "Be sure to put ../themes/ before the filename.\n";
1136 print "What file is this stored in (ex: ../themes/default_theme.php): ";
1138 $name =~ s/[\r|\n]//g;
1139 $theme_path[$#theme_path+1] = $name;
1140 } elsif ($input =~ /^\s*-\s*[0-9]?/) {
1141 if ($input =~ /[0-9]+\s*$/) {
1143 $rem_num =~ s/^\s*-\s*//g;
1144 $rem_num =~ s/\s*$//;
1146 $rem_num = $#theme_name;
1148 if ($rem_num == $theme_default) {
1149 print "You cannot remove the default theme!\n";
1152 @new_theme_name = ();
1153 @new_theme_path = ();
1154 while ($count <= $#theme_name) {
1155 if ($count != $rem_num) {
1156 @new_theme_name = (@new_theme_name, $theme_name[$count]);
1157 @new_theme_path = (@new_theme_path, $theme_path[$count]);
1161 @theme_name = @new_theme_name;
1162 @theme_path = @new_theme_path;
1163 if ($theme_default > $rem_num) {
1167 } elsif ($input =~ /^\s*t\s*/i) {
1168 print "\nStarting detection...\n\n";
1170 opendir(DIR
, "../themes");
1171 @files = grep { /\.php$/i } readdir(DIR
);
1173 while ($cnt <= $#files) {
1174 $filename = "../themes/" . $files[$cnt];
1176 for ($x=0; $x <= $#theme_path; $x++) {
1177 if ($theme_path[$x] eq $filename) {
1182 print "** Found theme: $filename\n";
1183 print " What is its name? ";
1185 $nm =~ s/[\n|\r]//g;
1186 $theme_name[$#theme_name+1] = $nm;
1187 $theme_path[$#theme_path+1] = $filename;
1192 for ($cnt=0; $cnt <= $#theme_path; $cnt++) {
1193 $filename = $theme_path[$cnt];
1194 if (! (-e
$filename)) {
1195 print " Removing $filename (file not found)\n";
1197 @new_theme_name = ();
1198 @new_theme_path = ();
1199 for ($x=0; $x < $#theme_path; $x++) {
1200 if ($theme_path[$x] eq $filename) {
1204 $new_theme_name[$x] = $theme_name[$x+1];
1205 $new_theme_path[$x] = $theme_path[$x+1];
1207 $new_theme_name[$x] = $theme_name[$x];
1208 $new_theme_path[$x] = $theme_path[$x];
1211 @theme_name = @new_theme_name;
1212 @theme_path = @new_theme_path;
1215 print "\nDetection complete!\n\n";
1218 } elsif ($input =~ /^\s*\?\s*/) {
1219 print ".-------------------------.\n";
1220 print "| t (detect themes) |\n";
1221 print "| + (add theme) |\n";
1222 print "| - N (remove theme) |\n";
1223 print "| m N (mark default) |\n";
1224 print "| l (list themes) |\n";
1225 print "| d (done) |\n";
1226 print "`-------------------------'\n";
1228 print "[theme] command (?=help) > ";
1230 $input =~ s/[\r|\n]//g;
1236 print "You can now define different LDAP servers.\n";
1237 print "[ldap] command (?=help) > ";
1239 $input =~ s/[\r|\n]//g;
1240 while ($input ne "d") {
1241 if ($input =~ /^\s*l\s*/i) {
1243 while ($count <= $#ldap_host) {
1244 print "$count. $ldap_host[$count]\n";
1245 print " base: $ldap_base[$count]\n";
1246 if ($ldap_charset[$count]) {
1247 print " charset: $ldap_charset[$count]\n";
1249 if ($ldap_port[$count]) {
1250 print " port: $ldap_port[$count]\n";
1252 if ($ldap_name[$count]) {
1253 print " name: $ldap_name[$count]\n";
1255 if ($ldap_maxrows[$count]) {
1256 print " maxrows: $ldap_maxrows[$count]\n";
1261 } elsif ($input =~ /^\s*\+/) {
1262 $sub = $#ldap_host + 1;
1264 print "First, we need to have the hostname or the IP address where\n";
1265 print "this LDAP server resides. Example: ldap.bigfoot.com\n";
1268 $name =~ s/[\r|\n]//g;
1269 $ldap_host[$sub] = $name;
1273 print "Next, we need the server root (base dn). For this, an empty\n";
1274 print "string is allowed.\n";
1275 print "Example: ou=member_directory,o=netcenter.com\n";
1278 $name =~ s/[\r|\n]//g;
1279 $ldap_base[$sub] = $name;
1283 print "This is the TCP/IP port number for the LDAP server. Default\n";
1284 print "port is 389. This is optional. Press ENTER for default.\n";
1287 $name =~ s/[\r|\n]//g;
1288 $ldap_port[$sub] = $name;
1292 print "This is the charset for the server. Default is utf-8. This\n";
1293 print "is also optional. Press ENTER for default.\n";
1296 $name =~ s/[\r|\n]//g;
1297 $ldap_charset[$sub] = $name;
1301 print "This is the name for the server, used to tag the results of\n";
1302 print "the search. Default it \"LDAP: hostname\". Press ENTER for default\n";
1305 $name =~ s/[\r|\n]//g;
1306 $ldap_name[$sub] = $name;
1310 print "You can specify the maximum number of rows in the search result.\n";
1311 print "Default is unlimited. Press ENTER for default.\n";
1314 $name =~ s/[\r|\n]//g;
1315 $ldap_maxrows[$sub] = $name;
1319 } elsif ($input =~ /^\s*-\s*[0-9]?/) {
1320 if ($input =~ /[0-9]+\s*$/) {
1322 $rem_num =~ s/^\s*-\s*//g;
1323 $rem_num =~ s/\s*$//;
1325 $rem_num = $#ldap_host;
1328 @new_ldap_host = ();
1329 @new_ldap_base = ();
1330 @new_ldap_port = ();
1331 @new_ldap_name = ();
1332 @new_ldap_charset = ();
1333 @new_ldap_maxrows = ();
1334 while ($count <= $#ldap_host) {
1335 if ($count != $rem_num) {
1336 @new_ldap_host = (@new_ldap_host, $ldap_host[$count]);
1337 @new_ldap_base = (@new_ldap_base, $ldap_base[$count]);
1338 @new_ldap_port = (@new_ldap_port, $ldap_port[$count]);
1339 @new_ldap_name = (@new_ldap_name, $ldap_name[$count]);
1340 @new_ldap_charset = (@new_ldap_charset, $ldap_charset[$count]);
1341 @new_ldap_maxrows = (@new_ldap_maxrows, $ldap_maxrows[$count]);
1345 @ldap_host = @new_ldap_host;
1346 @ldap_base = @new_ldap_base;
1347 @ldap_port = @new_ldap_port;
1348 @ldap_name = @new_ldap_name;
1349 @ldap_charset = @new_ldap_charset;
1350 @ldap_maxrows = @new_ldap_maxrows;
1351 } elsif ($input =~ /^\s*\?\s*/) {
1352 print ".-------------------------.\n";
1353 print "| + (add host) |\n";
1354 print "| - N (remove host) |\n";
1355 print "| l (list hosts) |\n";
1356 print "| d (done) |\n";
1357 print "`-------------------------'\n";
1359 print "[ldap] command (?=help) > ";
1361 $input =~ s/[\r|\n]//g;
1366 print "Some of our developers have come up with very good javascript interface\n";
1367 print "for searching through address books, however, our original goals said\n";
1368 print "that we would be 100% HTML. In order to make it possible to use their\n";
1369 print "interface, and yet stick with our goals, we have also written a plain\n";
1370 print "HTML version of the search. Here, you can choose which version to use.\n";
1372 print "This is just the default value. It is also a user option that each\n";
1373 print "user can configure individually\n";
1376 if ($default_use_javascript_addr_book eq "true") {
1377 $default_value = "y";
1379 $default_use_javascript_addr_book = "false";
1380 $default_value = "n";
1382 print "Use javascript version by default (y/n) [$WHT$default_value$NRM]: $WHT";
1383 $new_show = <STDIN
>;
1384 if (($new_show =~ /^y\n/i) || (($new_show =~ /^\n/) && ($default_value eq "y"))) {
1385 $default_use_javascript_addr_book = "true";
1387 $default_use_javascript_addr_book = "false";
1389 return $default_use_javascript_addr_book;
1394 open (FILE
, ">config.php");
1396 print FILE
"<?php\n\t/** SquirrelMail configuration\n";
1397 print FILE
"\t ** Created using the configure script, conf.pl\n\t **/\n\n";
1399 if ($print_config_version) {
1400 print FILE
"\t\$config_version = \"$print_config_version\";\n";
1404 print FILE
"\t\$org_name = \"$org_name\";\n";
1405 print FILE
"\t\$org_logo = \"$org_logo\";\n";
1406 print FILE
"\t\$org_title = \"$org_title\";\n";
1410 print FILE
"\t\$domain = \"$domain\";\n";
1411 print FILE
"\t\$imapServerAddress = \"$imapServerAddress\";\n";
1412 print FILE
"\t\$imapPort = $imapPort;\n";
1413 print FILE
"\t\$useSendmail = $useSendmail;\n";
1414 print FILE
"\t\$smtpServerAddress = \"$smtpServerAddress\";\n";
1415 print FILE
"\t\$smtpPort = $smtpPort;\n";
1416 print FILE
"\t\$sendmailPath = \"$sendmail_path\";\n";
1417 print FILE
"\t\$imap_server_type = \"$imap_server_type\";\n";
1421 print FILE
"\t\$default_folder_prefix = \"$default_folder_prefix\";\n";
1422 print FILE
"\t\$trash_folder = \"$trash_folder\";\n";
1423 print FILE
"\t\$sent_folder = \"$sent_folder\";\n";
1424 print FILE
"\t\$default_move_to_trash = $default_move_to_trash;\n";
1425 print FILE
"\t\$default_move_to_sent = $default_move_to_sent;\n";
1426 print FILE
"\t\$show_prefix_option = $show_prefix_option;\n";
1427 print FILE
"\t\$list_special_folders_first = $list_special_folders_first;\n";
1428 print FILE
"\t\$use_special_folder_color = $use_special_folder_color;\n";
1429 print FILE
"\t\$auto_expunge = $auto_expunge;\n";
1430 print FILE
"\t\$default_sub_of_inbox = $default_sub_of_inbox;\n";
1431 print FILE
"\t\$show_contain_subfolders_option = $show_contain_subfolders_option;\n";
1432 print FILE
"\t\$default_unseen_notify = $default_unseen_notify;\n";
1433 print FILE
"\t\$default_unseen_type = $default_unseen_type;\n";
1436 print FILE
"\t\$default_charset = \"$default_charset\";\n";
1437 print FILE
"\t\$data_dir = \"$data_dir\";\n";
1438 print FILE
"\t\$attachment_dir = \"$attachment_dir\";\n";
1439 print FILE
"\t\$default_left_size = $default_left_size;\n";
1443 for ($count=0; $count <= $#plugins; $count++) {
1444 print FILE
"\t\$plugins[$count] = \"$plugins[$count]\";\n";
1449 for ($count=0; $count <= $#theme_name; $count++) {
1450 print FILE
"\t\$theme[$count][\"PATH\"] = \"$theme_path[$count]\";\n";
1451 print FILE
"\t\$theme[$count][\"NAME\"] = \"$theme_name[$count]\";\n";
1456 if ($default_use_javascript_addr_book ne "true") {
1457 $default_use_javascript_addr_book = "false";
1459 print FILE
"\t\$default_use_javascript_addr_book = $default_use_javascript_addr_book;\n";
1460 for ($count=0; $count <= $#ldap_host; $count++) {
1461 print FILE
"\t\$ldap_server[$count] = Array(\n";
1462 print FILE
"\t\t\t\"host\" => \"$ldap_host[$count]\",\n";
1463 print FILE
"\t\t\t\"base\" => \"$ldap_base[$count]\"";
1464 if ($ldap_name[$count]) {
1465 print FILE
",\n\t\t\t\"name\" => \"$ldap_name[$count]\"";
1467 if ($ldap_port[$count]) {
1468 print FILE
",\n\t\t\t\"port\" => \"$ldap_port[$count]\"";
1470 if ($ldap_charset[$count]) {
1471 print FILE
",\n\t\t\t\"charset\" => \"$ldap_charset[$count]\"";
1473 if ($ldap_maxrows[$count]) {
1474 print FILE
",\n\t\t\t\"maxrows\" => \"$ldap_maxrows[$count]\"";
1476 print FILE
");\n\n";
1479 print FILE
"\t\$motd = \"$motd\";\n";
1487 print $WHT."SquirrelMail Configuration : ".$NRM;
1488 if ($config == 1) { print "Read: config.php"; }
1489 elsif ($config == 2) { print "Read: config_default.php"; }
1491 print "---------------------------------------------------------\n";
1493 print "While we have been building SquirrelMail, we have discovered some\n";
1494 print "preferences that work better with some servers that don't work so\n";
1495 print "well with others. If you select your IMAP server, this option will\n";
1496 print "set some pre-defined settings for that server.\n";
1498 print "Please note that you will still need to go through and make sure\n";
1499 print "everything is correct. This does not change everything. There are\n";
1500 print "only a few settings that this will change.\n";
1504 while ($continue != 1) {
1505 print "Please select your IMAP server:\n";
1506 print " cyrus = Cyrus IMAP server\n";
1507 print " uw = University of Washington's IMAP server\n";
1508 print " exchange = Microsoft Exchange IMAP server\n";
1509 print " courier = Courier IMAP server\n";
1510 print " quit = Do not change anything\n";
1511 print "Command >> ";
1513 $server =~ s/[\r|\n]//g;
1516 if ($server eq "cyrus") {
1517 $default_folder_prefix = "INBOX";
1518 $trash_folder = "INBOX.Trash";
1519 $sent_folder = "INBOX.Sent";
1520 $show_prefix_option = false
;
1521 $default_sub_of_inbox = true
;
1522 $show_contain_subfolders_option = false
;
1523 $imap_server_type = "cyrus";
1525 print " default_folder_prefix = INBOX\n";
1526 print " trash_folder = INBOX.Trash\n";
1527 print " sent_folder = INBOX.Sent\n";
1528 print " show_prefix_option = false\n";
1529 print " default_sub_of_inbox = true\n";
1530 print "show_contain_subfolders_option = false\n";
1531 print " imap_server_type = cyrus\n";
1534 } elsif ($server eq "uw") {
1535 $default_folder_prefix = "mail/";
1536 $trash_folder = "Trash";
1537 $sent_folder = "Sent";
1538 $show_prefix_option = true
;
1539 $default_sub_of_inbox = false
;
1540 $show_contain_subfolders_option = true
;
1541 $imap_server_type = "uw";
1543 print " default_folder_prefix = mail/\n";
1544 print " trash_folder = Trash\n";
1545 print " sent_folder = Sent\n";
1546 print " show_prefix_option = true\n";
1547 print " default_sub_of_inbox = false\n";
1548 print "show_contain_subfolders_option = true\n";
1549 print " imap_server_type = uw\n";
1552 } elsif ($server eq "exchange") {
1553 $default_folder_prefix = "INBOX/";
1554 $default_sub_of_inbox = true
;
1555 $trash_folder = "INBOX/Deleted Items";
1556 $sent_folder = "INBOX/Sent Items";
1557 $show_prefix_option = false
;
1558 $show_contain_subfolders_option = false
;
1559 $imap_server_type = "exchange";
1561 print " default_folder_prefix = INBOX/\n";
1562 print " default_sub_of_inbox = true\n";
1563 print " trash_folder = \"INBOX/Deleted Items\"\n";
1564 print " sent_folder = \"INBOX/Sent Items\"\n";
1565 print " show_prefix_option = false\n";
1566 print " show_contain_subfolders_option = false\n";
1567 print " imap_server_type = exchange\n";
1570 } elsif ($server eq "courier") {
1571 $imap_server_type = "courier";
1573 print " imap_server_type = courier\n";
1576 } elsif ($server eq "quit") {
1579 print "Unrecognized server: $server\n";
1583 print "\nPress any key to continue...";