Made some changes to the way that attachments are downloaded -- changed the
[squirrelmail.git] / config / conf.pl
1 #!/usr/bin/perl
2 # conf.pl
3 # Luke Ehresman (luke@squirrelmail.org)
4 #
5 # A simple configure script to configure squirrelmail
6 ############################################################
7 $WHT = "\x1B[37;1m";
8 $NRM = "\x1B[0m";
9
10 ############################################################
11 # First, lets read in the data already in there...
12 ############################################################
13 if ( -e "config.php") {
14 $config = 1;
15 open (FILE, "config.php");
16 } elsif (-e "config_default.php") {
17 $config = 2;
18 open (FILE, "config_default.php");
19 } else {
20 print "No configuration file found. Please get config_default.php or\n";
21 print "config.php before running this again. This program needs a\n";
22 print "default config file to get default values.\n";
23 exit;
24 }
25
26 # Reads and parses the current configuration file (either
27 # config.php or config_default.php).
28
29 while ($line = <FILE>) {
30 if ($line =~ /^\s+\$/) {
31 $line =~ s/^\s+\$//;
32 $var = $line;
33
34 if ($var =~ /^([a-z]|[A-Z])/) {
35 @options = split(/\s*=\s*/, $var);
36 $options[1] =~ s/[\n|\r]//g;
37 $options[1] =~ s/^"//g;
38 $options[1] =~ s/;\s*$//g;
39 $options[1] =~ s/"$//g;
40
41 if ($options[0] =~ /^theme\[[0-9]+\]\["PATH"\]/) {
42 $sub = $options[0];
43 $sub =~ s/\]\["PATH"\]//;
44 $sub = substr ($sub, @sub-1, 1);
45 $theme_path[$sub] = $options[1];
46 } elsif ($options[0] =~ /^theme\[[0-9]+\]\["NAME"\]/) {
47 $sub = $options[0];
48 $sub =~ s/\]\["NAME"\]//;
49 $sub = substr ($sub, @sub-1, 1);
50 $theme_name[$sub] = $options[1];
51 } elsif ($options[0] =~ /^ldap_server\[[0-9]+\]/) {
52 $sub = $options[0];
53 $sub = substr ($sub, length($sub)-2, 1);
54 $continue = 0;
55 while (($tmp = <FILE>) && ($continue != 1)) {
56 if ($tmp =~ /\);\s*$/) {
57 $continue = 1;
58 }
59
60 if ($tmp =~ /^\s*"host"/i) {
61 $tmp =~ s/^\s*"host"\s*=>\s*"//i;
62 $tmp =~ s/",\s*$//;
63 $tmp =~ s/"\);\s*$//;
64 $host = $tmp;
65 } elsif ($tmp =~ /^\s*"base"/i) {
66 $tmp =~ s/^\s*"base"\s*=>\s*"//i;
67 $tmp =~ s/",\s*$//;
68 $tmp =~ s/"\);\s*$//;
69 $base = $tmp;
70 } elsif ($tmp =~ /^\s*"charset"/i) {
71 $tmp =~ s/^\s*"charset"\s*=>\s*"//i;
72 $tmp =~ s/",\s*$//;
73 $tmp =~ s/"\);\s*$//;
74 $charset = $tmp;
75 } elsif ($tmp =~ /^\s*"port"/i) {
76 $tmp =~ s/^\s*"port"\s*=>\s*"//i;
77 $tmp =~ s/",\s*$//;
78 $tmp =~ s/"\);\s*$//;
79 $port = $tmp;
80 } elsif ($tmp =~ /^\s*"maxrows"/i) {
81 $tmp =~ s/^\s*"maxrows"\s*=>\s*"//i;
82 $tmp =~ s/",\s*$//;
83 $tmp =~ s/"\);\s*$//;
84 $maxrows = $tmp;
85 } elsif ($tmp =~ /^\s*"name"/i) {
86 $tmp =~ s/^\s*"name"\s*=>\s*"//i;
87 $tmp =~ s/",\s*$//;
88 $tmp =~ s/"\);\s*$//;
89 $name = $tmp;
90 }
91 }
92 $ldap_host[$sub] = $host;
93 $ldap_base[$sub] = $base;
94 $ldap_name[$sub] = $name;
95 $ldap_port[$sub] = $port;
96 $ldap_maxrows[$sub] = $maxrows;
97 $ldap_charset[$sub] = $charset;
98 } else {
99 ${$options[0]} = $options[1];
100 }
101 }
102 }
103 }
104 if ($useSendmail ne "true") {
105 $useSendmail = "false";
106 }
107 if (!$sendmail_path) {
108 $sendmail_path = "/usr/sbin/sendmail";
109 }
110
111 #####################################################################################
112
113 while (($command ne "q") && ($command ne "Q")) {
114 system "clear";
115 if ($menu == 0) {
116 print $WHT."SquirrelMail Configuration : ".$NRM;
117 if ($config == 1) { print "Read: config.php"; }
118 elsif ($config == 2) { print "Read: config_default.php"; }
119 print "\n";
120
121 print $WHT."Main Menu --\n".$NRM;
122 print "1. Organization Preferences\n";
123 print "2. Server Settings\n";
124 print "3. Folder Defaults\n";
125 print "4. General Options\n";
126 print "5. Themes\n";
127 print "6. Address Books (LDAP)\n";
128 print "7. Message of the Day (MOTD)\n";
129 print "\n";
130 print "D. Set pre-defined settings for specific IMAP servers\n";
131 print "\n";
132 } elsif ($menu == 1) {
133 print $WHT."Organization Preferences\n".$NRM;
134 print "1. Organization Name : $WHT$org_name$NRM\n";
135 print "2. Organization Logo : $WHT$org_logo$NRM\n";
136 print "3. Organization Title : $WHT$org_title$NRM\n";
137 print "\n";
138 print "R Return to Main Menu\n";
139 } elsif ($menu == 2) {
140 print $WHT."Server Settings\n".$NRM;
141 print "1. Domain : $WHT$domain$NRM\n";
142 print "2. IMAP Server : $WHT$imapServerAddress$NRM\n";
143 print "3. IMAP Port : $WHT$imapPort$NRM\n";
144 print "4. Use Sendmail : $WHT$useSendmail$NRM\n";
145 if ($useSendmail eq "true") {
146 print "5. Sendmail Path : $WHT$sendmail_path$NRM\n";
147 } else {
148 print "6. SMTP Server : $WHT$smtpServerAddress$NRM\n";
149 print "7. SMTP Port : $WHT$smtpPort$NRM\n";
150 }
151 print "8. Server : $WHT$imap_server_type$NRM\n";
152 print "\n";
153 print "R Return to Main Menu\n";
154 } elsif ($menu == 3) {
155 print $WHT."Folder Defaults\n".$NRM;
156 print "1. Default Folder Prefix : $WHT$default_folder_prefix$NRM\n";
157 print "2. Show Folder Prefix Option : $WHT$show_prefix_option$NRM\n";
158 print "3. Trash Folder : $WHT$trash_folder$NRM\n";
159 print "4. Sent Folder : $WHT$sent_folder$NRM\n";
160 print "5. By default, move to trash : $WHT$default_move_to_trash$NRM\n";
161 print "6. By default, move to sent : $WHT$default_move_to_sent$NRM\n";
162 print "7. List Special Folders First : $WHT$list_special_folders_first$NRM\n";
163 print "8. Show Special Folders Color : $WHT$use_special_folder_color$NRM\n";
164 print "9. Auto Expunge : $WHT$auto_expunge$NRM\n";
165 print "10. Default Sub. of INBOX : $WHT$default_sub_of_inbox$NRM\n";
166 print "11. Show 'Contain Sub.' Option : $WHT$show_contain_subfolders_option$NRM\n";
167 print "\n";
168 print "R Return to Main Menu\n";
169 } elsif ($menu == 4) {
170 print $WHT."General Options\n".$NRM;
171 print "1. Default Charset : $WHT$default_charset$NRM\n";
172 print "2. Auto Forward : $WHT$auto_forward$NRM\n";
173 print "3. Data Directory : $WHT$data_dir$NRM\n";
174 print "4. Attachment Directory : $WHT$attachment_dir$NRM\n";
175 print "5. Default Left Size : $WHT$default_left_size$NRM\n";
176 print "\n";
177 print "R Return to Main Menu\n";
178 } elsif ($menu == 5) {
179 print $WHT."Themes\n".$NRM;
180 print "1. Change Themes\n";
181 for ($count = 0; $count <= $#theme_name; $count++) {
182 print " > $theme_name[$count]\n";
183 }
184 print "\n";
185 print "R Return to Main Menu\n";
186 } elsif ($menu == 6) {
187 print $WHT."Address Books (LDAP)\n".$NRM;
188 print "1. Change Servers\n";
189 for ($count = 0; $count <= $#ldap_host; $count++) {
190 print " > $ldap_host[$count]\n";
191 }
192 print "2. Use Javascript Address Book Search : $WHT$default_use_javascript_addr_book$NRM\n";
193 print "\n";
194 print "R Return to Main Menu\n";
195 } elsif ($menu == 7) {
196 print $WHT."Message of the Day (MOTD)\n".$NRM;
197 print "\n$motd\n";
198 print "\n";
199 print "1 Edit the MOTD\n";
200 print "\n";
201 print "R Return to Main Menu\n";
202 }
203 print "S Save data\n";
204 print "Q Quit\n";
205
206 print "\n";
207 print "Command >> ".$WHT;
208 $command = <STDIN>;
209 $command =~ s/[\n|\r]//g;
210 print "$NRM\n";
211
212 # Read the commands they entered.
213 if (($command eq "R") || ($command eq "r")) {
214 $menu = 0;
215 } elsif (($command eq "s") || ($command eq "S")) {
216 save_data ();
217 print "Data saved in config.php\n";
218 print "Press any key to continue...";
219 $tmp = <STDIN>;
220 $saved = 1;
221 } elsif ((($command eq "q") || ($command eq "Q")) && ($saved == 0)) {
222 print "You have not saved your data.\n";
223 print "Save? (y/n) [".$WHT."y".$NRM."]: ";
224 $save = <STDIN>;
225 if (($save =~ /^y/i) || ($save =~ /^\s*$/)) {
226 save_data ();
227 }
228 } elsif (($command eq "d") || ($command eq "D")) {
229 set_defaults ();
230 } else {
231 $saved = 0;
232 if ($menu == 0) {
233 if (($command > 0) && ($command < 8)) {
234 $menu = $command;
235 }
236 } elsif ($menu == 1) {
237 if ($command == 1) { $org_name = command1 (); }
238 elsif ($command == 2) { $org_logo = command2 (); }
239 elsif ($command == 3) { $org_title = command3 (); }
240 } elsif ($menu == 2) {
241 if ($command == 1) { $domain = command11 (); }
242 elsif ($command == 2) { $imapServerAddress = command12 (); }
243 elsif ($command == 3) { $imapPort = command13 (); }
244 elsif ($command == 4) { $useSendmail = command14 (); }
245 elsif ($command == 5) { $sendmail_path = command15 (); }
246 elsif ($command == 6) { $smtpServerAddress = command16 (); }
247 elsif ($command == 7) { $smtpPort = command17 (); }
248 elsif ($command == 8) { $imap_server_type = command18 (); }
249 } elsif ($menu == 3) {
250 if ($command == 1) { $default_folder_prefix = command21 (); }
251 elsif ($command == 2) { $show_prefix_option = command22 (); }
252 elsif ($command == 3) { $trash_folder = command23 (); }
253 elsif ($command == 4) { $sent_folder = command24 (); }
254 elsif ($command == 5) { $default_move_to_trash = command25 (); }
255 elsif ($command == 6) { $default_move_to_sent = command26 (); }
256 elsif ($command == 7) { $list_special_folders_first = command27 (); }
257 elsif ($command == 8) { $use_special_folder_color = command28 (); }
258 elsif ($command == 9) { $auto_expunge = command29 (); }
259 elsif ($command == 10){ $default_sub_of_inbox = command210(); }
260 elsif ($command == 11){ $show_contain_subfolders_option = command211(); }
261 } elsif ($menu == 4) {
262 if ($command == 1) { $default_charset = command31 (); }
263 elsif ($command == 2) { $auto_forward = command32 (); }
264 elsif ($command == 3) { $data_dir = command33 (); }
265 elsif ($command == 4) { $attachment_dir = command34 (); }
266 elsif ($command == 5) { $default_left_size = command35 (); }
267 } elsif ($menu == 5) {
268 if ($command == 1) {
269 command41 ();
270 }
271 } elsif ($menu == 6) {
272 if ($command == 1) { command61(); }
273 elsif ($command == 2) { command62(); }
274 } elsif ($menu == 7) {
275 if ($command == 1) { $motd = command71(); }
276 }
277 }
278 }
279
280 ####################################################################################
281
282 # org_name
283 sub command1 {
284 print "We have tried to make the name SquirrelMail as transparent as\n";
285 print "possible. If you set up an organization name, most places where\n";
286 print "SquirrelMail would take credit will be credited to your organization.\n";
287 print "\n";
288 print "[$WHT$org_name$NRM]: $WHT";
289 $new_org_name = <STDIN>;
290 if ($new_org_name eq "\n") {
291 $new_org_name = $org_name;
292 } else {
293 $new_org_name =~ s/[\r|\n]//g;
294 }
295 return $new_org_name;
296 }
297
298
299 # org_logo
300 sub command2 {
301 print "Your organization's logo is an image that will be displayed at\n";
302 print "different times throughout SquirrelMail. This is asking for the\n";
303 print "literal (/usr/local/squirrelmail/images/logo.jpg) or relative\n";
304 print "(../images/logo.jpg) path to your logo.\n";
305 print "\n";
306 print "[$WHT$org_logo$NRM]: $WHT";
307 $new_org_logo = <STDIN>;
308 if ($new_org_logo eq "\n") {
309 $new_org_logo = $org_logo;
310 } else {
311 $new_org_logo =~ s/[\r|\n]//g;
312 }
313 return $new_org_logo;
314 }
315
316 # org_title
317 sub command3 {
318 print "A title is what is displayed at the top of the browser window in\n";
319 print "the titlebar. Usually this will end up looking something like:\n";
320 print "\"Netscape: $org_title\"\n";
321 print "\n";
322 print "[$WHT$org_title$NRM]: $WHT";
323 $new_org_title = <STDIN>;
324 if ($new_org_title eq "\n") {
325 $new_org_title = $org_title;
326 } else {
327 $new_org_title =~ s/[\r|\n]//g;
328 }
329 return $new_org_title;
330 }
331
332 ####################################################################################
333
334 # domain
335 sub command11 {
336 print "The domain name is the suffix at the end of all email messages. If\n";
337 print "for example, your email address is jdoe\@myorg.com, then your domain\n";
338 print "would be myorg.com.\n";
339 print "\n";
340 print "[$WHT$domain$NRM]: $WHT";
341 $new_domain = <STDIN>;
342 if ($new_domain eq "\n") {
343 $new_domain = $domain;
344 } else {
345 $new_domain =~ s/[\r|\n]//g;
346 }
347 return $new_domain;
348 }
349
350 # imapServerAddress
351 sub command12 {
352 print "This is the address where your IMAP server resides.\n";
353 print "[$WHT$imapServerAddress$NRM]: $WHT";
354 $new_imapServerAddress = <STDIN>;
355 if ($new_imapServerAddress eq "\n") {
356 $new_imapServerAddress = $imapServerAddress;
357 } else {
358 $new_imapServerAddress =~ s/[\r|\n]//g;
359 }
360 return $new_imapServerAddress;
361 }
362
363 # imapPort
364 sub command13 {
365 print "This is the port that your IMAP server is on. Usually this is 143.\n";
366 print "[$WHT$imapPort$NRM]: $WHT";
367 $new_imapPort = <STDIN>;
368 if ($new_imapPort eq "\n") {
369 $new_imapPort = $imapPort;
370 } else {
371 $new_imapPort =~ s/[\r|\n]//g;
372 }
373 return $new_imapPort;
374 }
375
376 # useSendmail
377 sub command14 {
378 print "You now need to choose the method that you will use for sending\n";
379 print "messages in SquirrelMail. You can either connect to an SMTP server\n";
380 print "or use sendmail directly.\n";
381 if ($useSendmail eq "true") {
382 $default_value = "y";
383 } else {
384 $default_value = "n";
385 }
386 print "\n";
387 print "Use Sendmail (y/n) [$WHT$default_value$NRM]: $WHT";
388 $use_sendmail = <STDIN>;
389 if (($use_sendmail =~ /^y\n/i) || (($use_sendmail =~ /^\n/) && ($default_value eq "y"))) {
390 $useSendmail = "true";
391 } else {
392 $useSendmail = "false";
393 }
394 return $useSendmail;
395 }
396
397 # sendmail_path
398 sub command15 {
399 if ($sendmail_path[0] !~ /./) {
400 $sendmail_path = "/usr/sbin/sendmail";
401 }
402 print "Specify where the sendmail executable is located. Usually /usr/sbin/sendmail\n";
403 print "[$WHT$sendmail_path$NRM]: $WHT";
404 $new_sendmail_path = <STDIN>;
405 if ($new_sendmail_path eq "\n") {
406 $new_sendmail_path = $sendmail_path;
407 } else {
408 $new_sendmail_path =~ s/[\r|\n]//g;
409 }
410 return $new_sendmail_path;
411 }
412
413 # smtpServerAddress
414 sub command16 {
415 print "This is the location of your SMTP server.\n";
416 print "[$WHT$smtpServerAddress$NRM]: $WHT";
417 $new_smtpServerAddress = <STDIN>;
418 if ($new_smtpServerAddress eq "\n") {
419 $new_smtpServerAddress = $smtpServerAddress;
420 } else {
421 $new_smtpServerAddress =~ s/[\r|\n]//g;
422 }
423 return $new_smtpServerAddress;
424 }
425
426 # smtpPort
427 sub command17 {
428 print "This is the port to connect to for SMTP. Usually 25.\n";
429 print "[$WHT$smtpPort$NRM]: $WHT";
430 $new_smtpPort = <STDIN>;
431 if ($new_smtpPort eq "\n") {
432 $new_smtpPort = $smtpPort;
433 } else {
434 $new_smtpPort =~ s/[\r|\n]//g;
435 }
436 return $new_smtpPort;
437 }
438 # imap_server_type
439 sub command18 {
440 print "Eash IMAP server has its own quirks. As much as we tried to stick\n";
441 print "to standards, it doesn't help much if the IMAP server doesn't follow\n";
442 print "the same principles. We have made some work-arounds for some of\n";
443 print "these servers. If you would like to use them, please select your\n";
444 print "IMAP server. If you do not wish to use these work-arounds, you can\n";
445 print "set this to \"other\", and none will be used.\n";
446 print " cyrus = Cyrus IMAP server\n";
447 print " uw = University of Washington's IMAP server\n";
448 print " exchange = Microsoft Exchange IMAP server\n";
449 print " courier = Courier IMAP server\n";
450 print "[$WHT$imap_server_type$NRM]: $WHT";
451 $new_imap_server_type = <STDIN>;
452 if ($new_imap_server_type eq "\n") {
453 $new_imap_server_type = $imap_server_type;
454 } else {
455 $new_imap_server_type =~ s/[\r|\n]//g;
456 }
457 return $new_imap_server_type;
458 }
459
460 # MOTD
461 sub command71 {
462 print "\nYou can now create the welcome message that is displayed\n";
463 print "every time a user logs on. You can use HTML or just plain\n";
464 print "text.\n\n(Type @ on a blank line to exit)\n";
465
466 do {
467 print "] ";
468 $line = <STDIN>;
469 $line =~ s/[\r|\n]//g;
470 if ($line ne "@") {
471 $line =~ s/ /\&nbsp;\&nbsp;/g;
472 $line =~ s/\t/\&nbsp;\&nbsp;\&nbsp;\&nbsp;/g;
473 $line =~ s/$/ /;
474 $line =~ s/"/\"/g;
475
476 $new_motd = $new_motd . $line;
477 }
478 } while ($line ne "@");
479 return $new_motd;
480 }
481
482 ################# FOLDERS ###################
483
484 # default_folder_prefix
485 sub command21 {
486 print "Some IMAP servers (UW, for example) store mail and folders in\n";
487 print "your user space in a separate subdirectory. This is where you\n";
488 print "specify what that directory is.\n";
489 print "\n";
490 print "EXAMPLE: mail/";
491 print "\n";
492 print "NOTE: If you use Cyrus, or some server that would not use this\n";
493 print " option, you must set this to 'none'.\n";
494 print "\n";
495 print "[$WHT$default_folder_prefix$NRM]: $WHT";
496 $new_default_folder_prefix = <STDIN>;
497 if ($new_default_folder_prefix eq "\n") {
498 $new_default_folder_prefix = $default_folder_prefix;
499 } else {
500 $new_default_folder_prefix =~ s/[\r|\n]//g;
501 }
502 if (($new_default_folder_prefix =~ /^\s*$/) || ($new_default_folder_prefix =~ /none/i)) {
503 $new_default_folder_prefix = "";
504 } else {
505 $new_default_folder_prefix =~ s/\/*$//g;
506 $new_default_folder_prefix =~ s/$/\//g;
507 }
508 return $new_default_folder_prefix;
509 }
510
511 # Show Folder Prefix
512 sub command22 {
513 print "It is possible to set up the default folder prefix as a user\n";
514 print "specific option, where each user can specify what their mail\n";
515 print "folder is. If you set this to false, they will never see the\n";
516 print "option, but if it is true, this option will appear in the\n";
517 print "'options' section.\n";
518 print "\n";
519 print "NOTE: You set the default folder prefix in option '1' of this\n";
520 print " section. That will be the default if the user doesn't\n";
521 print " specify anything different.\n";
522 print "\n";
523
524 if ($show_prefix_option eq "true") {
525 $default_value = "y";
526 } else {
527 $default_value = "n";
528 }
529 print "\n";
530 print "Show option (y/n) [$WHT$default_value$NRM]: $WHT";
531 $new_show = <STDIN>;
532 if (($new_show =~ /^y\n/i) || (($new_show =~ /^\n/) && ($default_value eq "y"))) {
533 $show_prefix_option = "true";
534 } else {
535 $show_prefix_option = "false";
536 }
537 return $show_prefix_option;
538 }
539
540 # Trash Folder
541 sub command23 {
542 print "You can now specify where the default trash folder is located.\n";
543 print "On servers where you do not want this, you can set it to anything\n";
544 print "and set option 7 to false.\n";
545 print "\n";
546 print "This is relative to where the rest of your email is kept. You do\n";
547 print "not need to worry about their mail directory. If this folder\n";
548 print "would be ~/mail/trash on the filesystem, you only need to specify\n";
549 print "that this is 'trash', and be sure to put 'mail/' in option 1.\n";
550 print "\n";
551
552 print "[$WHT$trash_folder$NRM]: $WHT";
553 $new_trash_folder = <STDIN>;
554 if ($new_trash_folder eq "\n") {
555 $new_trash_folder = $trash_folder;
556 } else {
557 $new_trash_folder =~ s/[\r|\n]//g;
558 }
559 return $new_trash_folder;
560 }
561
562 # Sent Folder
563 sub command24 {
564 print "This is where messages that are sent will be stored. SquirrelMail\n";
565 print "by default puts a copy of all outgoing messages in this folder.\n";
566 print "\n";
567 print "This is relative to where the rest of your email is kept. You do\n";
568 print "not need to worry about their mail directory. If this folder\n";
569 print "would be ~/mail/sent on the filesystem, you only need to specify\n";
570 print "that this is 'sent', and be sure to put 'mail/' in option 1.\n";
571 print "\n";
572
573 print "[$WHT$sent_folder$NRM]: $WHT";
574 $new_sent_folder = <STDIN>;
575 if ($new_sent_folder eq "\n") {
576 $new_sent_folder = $sent_folder;
577 } else {
578 $new_sent_folder =~ s/[\r|\n]//g;
579 }
580 return $new_sent_folder;
581 }
582
583 # default move to trash
584 sub command25 {
585 print "By default, should messages get moved to the trash folder? You\n";
586 print "can specify the default trash folder in option 3. If this is set\n";
587 print "to false, messages will get deleted immediately without moving\n";
588 print "to the trash folder.\n";
589 print "\n";
590 print "Trash folder is currently: $trash_folder\n";
591 print "\n";
592
593 if ($default_move_to_trash eq "true") {
594 $default_value = "y";
595 } else {
596 $default_value = "n";
597 }
598 print "By default, move to trash (y/n) [$WHT$default_value$NRM]: $WHT";
599 $new_show = <STDIN>;
600 if (($new_show =~ /^y\n/i) || (($new_show =~ /^\n/) && ($default_value eq "y"))) {
601 $default_move_to_trash = "true";
602 } else {
603 $default_move_to_trash = "false";
604 }
605 return $default_move_to_trash;
606 }
607
608 # default move to sent
609 sub command26 {
610 print "By default, should messages get moved to the sent folder? You\n";
611 print "can specify the default sent folder in option 4. If this is set\n";
612 print "to false, messages will get deleted immediately without moving\n";
613 print "to the sent folder.\n";
614 print "\n";
615 print "Trash folder is currently: $sent_folder\n";
616 print "\n";
617
618 if ($default_move_to_sent eq "true") {
619 $default_value = "y";
620 } else {
621 $default_value = "n";
622 }
623 print "By default, move to sent (y/n) [$WHT$default_value$NRM]: $WHT";
624 $new_show = <STDIN>;
625 if (($new_show =~ /^y\n/i) || (($new_show =~ /^\n/) && ($default_value eq "y"))) {
626 $default_move_to_sent = "true";
627 } else {
628 $default_move_to_sent = "false";
629 }
630 return $default_move_to_sent;
631 }
632
633 # List special folders first
634 sub command27 {
635 print "SquirrelMail has what we call 'special folders' that are not\n";
636 print "manipulated and viewed like normal folders. Some examples of\n";
637 print "these folders would be INBOX, Trash, Sent, etc. This option\n";
638 print "Simply asks if you want these folders listed first in the folder\n";
639 print "listing.\n";
640 print "\n";
641
642 if ($list_special_folders_first eq "true") {
643 $default_value = "y";
644 } else {
645 $default_value = "n";
646 }
647 print "\n";
648 print "List first (y/n) [$WHT$default_value$NRM]: $WHT";
649 $new_show = <STDIN>;
650 if (($new_show =~ /^y\n/i) || (($new_show =~ /^\n/) && ($default_value eq "y"))) {
651 $list_special_folders_first = "true";
652 } else {
653 $list_special_folders_first = "false";
654 }
655 return $list_special_folders_first;
656 }
657
658 # Show special folders color
659 sub command28 {
660 print "SquirrelMail has what we call 'special folders' that are not\n";
661 print "manipulated and viewed like normal folders. Some examples of\n";
662 print "these folders would be INBOX, Trash, Sent, etc. This option\n";
663 print "wants to know if we should display special folders in a\n";
664 print "color than the other folders.\n";
665 print "\n";
666
667 if ($use_special_folder_color eq "true") {
668 $default_value = "y";
669 } else {
670 $default_value = "n";
671 }
672 print "\n";
673 print "Show color (y/n) [$WHT$default_value$NRM]: $WHT";
674 $new_show = <STDIN>;
675 if (($new_show =~ /^y\n/i) || (($new_show =~ /^\n/) && ($default_value eq "y"))) {
676 $use_special_folder_color = "true";
677 } else {
678 $use_special_folder_color = "false";
679 }
680 return $use_special_folder_color;
681 }
682
683 # Auto expunge
684 sub command29 {
685 print "The way that IMAP handles deleting messages is as follows. You\n";
686 print "mark the message as deleted, and then to 'really' delete it, you\n";
687 print "expunge it. This option asks if you want to just have messages\n";
688 print "marked as deleted, or if you want SquirrelMail to expunge the \n";
689 print "messages too.\n";
690 print "\n";
691
692 if ($auto_expunge eq "true") {
693 $default_value = "y";
694 } else {
695 $default_value = "n";
696 }
697 print "Auto expunge (y/n) [$WHT$default_value$NRM]: $WHT";
698 $new_show = <STDIN>;
699 if (($new_show =~ /^y\n/i) || (($new_show =~ /^\n/) && ($default_value eq "y"))) {
700 $auto_expunge = "true";
701 } else {
702 $auto_expunge = "false";
703 }
704 return $auto_expunge;
705 }
706
707 # Default sub of inbox
708 sub command210 {
709 print "Some IMAP servers (Cyrus) have all folders as subfolders of INBOX.\n";
710 print "This can cause some confusion in folder creation for users when\n";
711 print "they try to create folders and don't put it as a subfolder of INBOX\n";
712 print "and get permission errors. This option asks if you want folders\n";
713 print "to be subfolders of INBOX by default.\n";
714 print "\n";
715
716 if ($default_sub_of_inbox eq "true") {
717 $default_value = "y";
718 } else {
719 $default_value = "n";
720 }
721 print "Default sub of INBOX (y/n) [$WHT$default_value$NRM]: $WHT";
722 $new_show = <STDIN>;
723 if (($new_show =~ /^y\n/i) || (($new_show =~ /^\n/) && ($default_value eq "y"))) {
724 $default_sub_of_inbox = "true";
725 } else {
726 $default_sub_of_inbox = "false";
727 }
728 return $default_sub_of_inbox;
729 }
730
731 # Show contain subfolder option
732 sub command211 {
733 print "Some IMAP servers (UW) make it so that there are two types of\n";
734 print "folders. Those that contain messages, and those that contain\n";
735 print "subfolders. If this is the case for your server, set this to\n";
736 print "true, and it will ask the user whether the folder they are\n";
737 print "creating contains subfolders or messages.\n";
738 print "\n";
739
740 if ($show_contain_subfolders_option eq "true") {
741 $default_value = "y";
742 } else {
743 $default_value = "n";
744 }
745 print "Show option (y/n) [$WHT$default_value$NRM]: $WHT";
746 $new_show = <STDIN>;
747 if (($new_show =~ /^y\n/i) || (($new_show =~ /^\n/) && ($default_value eq "y"))) {
748 $show_contain_subfolders_option = "true";
749 } else {
750 $show_contain_subfolders_option = "false";
751 }
752 return $show_contain_subfolders_option;
753 }
754
755 ############# GENERAL OPTIONS #####################
756
757 # Default Charset
758 sub command31 {
759 print "This option controls what character set is used when sending\n";
760 print "mail and when sending HTML to the browser. Do not set this\n";
761 print "to US-ASCII, use ISO-8859-1 instead. For cyrillic, it is best\n";
762 print "to use KOI8-R, since this implementation is faster than most\n";
763 print "of the alternatives\n";
764 print "\n";
765
766 print "[$WHT$default_charset$NRM]: $WHT";
767 $new_default_charset = <STDIN>;
768 if ($new_default_charset eq "\n") {
769 $new_default_charset = $default_charset;
770 } else {
771 $new_default_charset =~ s/[\r|\n]//g;
772 }
773 return $new_default_charset;
774 }
775
776 # Auto Forward
777 sub command32 {
778 print "There are some places that we will automatically forward the user\n";
779 print "rather than display pointless messages like 'Message sent!' or\n";
780 print "stuff like that. Use this or not?\n";
781 print "\n";
782 print "NOTE: This is not working currently as we are trying to find a\n";
783 print " better way to handle this. This option really doesn't do\n";
784 print " much.\n";
785 print "\n";
786
787 if ($auto_forward eq "true") {
788 $default_value = "y";
789 } else {
790 $default_value = "n";
791 }
792 print "Auto forward (y/n) [$WHT$default_value$NRM]: $WHT";
793 $new_show = <STDIN>;
794 if (($new_show =~ /^y\n/i) || (($new_show =~ /^\n/) && ($default_value eq "y"))) {
795 $auto_forward = "true";
796 } else {
797 $auto_forward = "false";
798 }
799 return $auto_forward;
800 }
801
802 # Data directory
803 sub command33 {
804 print "It is a possible security hole to have a writable directory\n";
805 print "under the web server's root directory (ex: /home/httpd/html).\n";
806 print "For this reason, it is possible to put the data directory\n";
807 print "anywhere you would like. The path name can be absolute or\n";
808 print "relative (to the config directory). It doesn't matter. Here\n";
809 print "are two examples:\n";
810 print " Absolute: /usr/local/squirrelmail/data/\n";
811 print " Relative: ../data/\n";
812 print "\n";
813
814 print "[$WHT$data_dir$NRM]: $WHT";
815 $new_data_dir = <STDIN>;
816 if ($new_data_dir eq "\n") {
817 $new_data_dir = $data_dir;
818 } else {
819 $new_data_dir =~ s/[\r|\n]//g;
820 }
821 if ($new_data_dir =~ /^\s*$/) {
822 $new_data_dir = "";
823 } else {
824 $new_data_dir =~ s/\/*$//g;
825 $new_data_dir =~ s/$/\//g;
826 }
827 return $new_data_dir;
828 }
829
830 # Attachment directory
831 sub command34 {
832 print "Path to directory used for storing attachments while a mail is\n";
833 print "being sent. There are a few security considerations regarding this\n";
834 print "directory:\n";
835 print " 1. It should have the permission 733 (rwx-wx-wx) to make it\n";
836 print " impossible for a random person with access to the webserver\n";
837 print " to list files in this directory. Confidential data might\n";
838 print " be laying around in there.\n";
839 print " 2. Since the webserver is not able to list the files in the\n";
840 print " content is also impossible for the webserver to delete files\n";
841 print " lying around there for too long.\n";
842 print " 3. It should probably be another directory than the data\n";
843 print " directory specified in option 3.\n";
844 print "\n";
845
846 print "[$WHT$attachment_dir$NRM]: $WHT";
847 $new_attachment_dir = <STDIN>;
848 if ($new_attachment_dir eq "\n") {
849 $new_attachment_dir = $attachment_dir;
850 } else {
851 $new_attachment_dir =~ s/[\r|\n]//g;
852 }
853 if ($new_attachment_dir =~ /^\s*$/) {
854 $new_attachment_dir = "";
855 } else {
856 $new_attachment_dir =~ s/\/*$//g;
857 $new_attachment_dir =~ s/$/\//g;
858 }
859 return $new_attachment_dir;
860 }
861
862
863 sub command35 {
864 print "This is the default size (in pixels) of the left folder list.\n";
865 print "Default is 200, but you can set it to whatever you wish. This\n";
866 print "is a user preference, so this will only show up as their default.\n";
867 print "\n";
868 print "[$WHT$default_left_size$NRM]: $WHT";
869 $new_default_left_size = <STDIN>;
870 if ($new_default_left_size eq "\n") {
871 $new_default_left_size = $default_left_size;
872 } else {
873 $new_default_left_size =~ s/[\r|\n]//g;
874 }
875 return $new_default_left_size;
876 }
877
878
879 sub command41 {
880 print "\nNow we will define the themes that you wish to use. If you have added\n";
881 print "a theme of your own, just follow the instructions (?) about how to add\n";
882 print "them. You can also change the default theme.\n";
883 print "[theme] command (?=help) > ";
884 $input = <STDIN>;
885 $input =~ s/[\r|\n]//g;
886 while ($input ne "d") {
887 if ($input =~ /^\s*l\s*/i) {
888 $count = 0;
889 while ($count <= $#theme_name) {
890 if ($count == $theme_default) {
891 print " *";
892 } else {
893 print " ";
894 }
895 $name = $theme_name[$count];
896 $num_spaces = 25 - length($name);
897 for ($i = 0; $i < $num_spaces;$i++) {
898 $name = $name . " ";
899 }
900
901 print " $count. $name";
902 print "($theme_path[$count])\n";
903
904 $count++;
905 }
906 } elsif ($input =~ /^\s*m\s*[0-9]+/i) {
907 $old_def = $theme_default;
908 $theme_default = $input;
909 $theme_default =~ s/^\s*m\s*//;
910 if (($theme_default > $#theme_name) || ($theme_default < 0)) {
911 print "Cannot set default theme to $theme_default. That theme does not exist.\n";
912 $theme_default = $old_def;
913 }
914 } elsif ($input =~ /^\s*\+/) {
915 print "What is the name of this theme: ";
916 $name = <STDIN>;
917 $name =~ s/[\r|\n]//g;
918 $theme_name[$#theme_name+1] = $name;
919 print "Be sure to put ../config/ before the filename.\n";
920 print "What file is this stored in (ex: ../config/default_theme.php): ";
921 $name = <STDIN>;
922 $name =~ s/[\r|\n]//g;
923 $theme_path[$#theme_path+1] = $name;
924 } elsif ($input =~ /^\s*-\s*[0-9]?/) {
925 if ($input =~ /[0-9]+\s*$/) {
926 $rem_num = $input;
927 $rem_num =~ s/^\s*-\s*//g;
928 $rem_num =~ s/\s*$//;
929 } else {
930 $rem_num = $#theme_name;
931 }
932 if ($rem_num == $theme_default) {
933 print "You cannot remove the default theme!\n";
934 } else {
935 $count = 0;
936 @new_theme_name = ();
937 @new_theme_path = ();
938 while ($count <= $#theme_name) {
939 if ($count != $rem_num) {
940 @new_theme_name = (@new_theme_name, $theme_name[$count]);
941 @new_theme_path = (@new_theme_path, $theme_path[$count]);
942 }
943 $count++;
944 }
945 @theme_name = @new_theme_name;
946 @theme_path = @new_theme_path;
947 if ($theme_default > $rem_num) {
948 $theme_default--;
949 }
950 }
951 } elsif ($input =~ /^\s*\?\s*/) {
952 print ".-------------------------.\n";
953 print "| + (add theme) |\n";
954 print "| - N (remove theme) |\n";
955 print "| m N (mark default) |\n";
956 print "| l (list themes) |\n";
957 print "| d (done) |\n";
958 print "`-------------------------'\n";
959 }
960 print "[theme] command (?=help) > ";
961 $input = <STDIN>;
962 $input =~ s/[\r|\n]//g;
963 }
964 }
965
966
967 sub command61 {
968 print "You can now define different LDAP servers.\n";
969 print "[ldap] command (?=help) > ";
970 $input = <STDIN>;
971 $input =~ s/[\r|\n]//g;
972 while ($input ne "d") {
973 if ($input =~ /^\s*l\s*/i) {
974 $count = 0;
975 while ($count <= $#ldap_host) {
976 print "$count. $ldap_host[$count]\n";
977 print " base: $ldap_base[$count]\n";
978 if ($ldap_charset[$count]) {
979 print " charset: $ldap_charset[$count]\n";
980 }
981 if ($ldap_port[$count]) {
982 print " port: $ldap_port[$count]\n";
983 }
984 if ($ldap_name[$count]) {
985 print " name: $ldap_name[$count]\n";
986 }
987 if ($ldap_maxrows[$count]) {
988 print " maxrows: $ldap_maxrows[$count]\n";
989 }
990 print "\n";
991 $count++;
992 }
993 } elsif ($input =~ /^\s*\+/) {
994 $sub = $#ldap_host + 1;
995
996 print "First, we need to have the hostname or the IP address where\n";
997 print "this LDAP server resides. Example: ldap.bigfoot.com\n";
998 print "hostname: ";
999 $name = <STDIN>;
1000 $name =~ s/[\r|\n]//g;
1001 $ldap_host[$sub] = $name;
1002
1003 print "\n";
1004
1005 print "Next, we need the server root (base dn). For this, an empty\n";
1006 print "string is allowed.\n";
1007 print "Example: ou=member_directory,o=netcenter.com\n";
1008 print "base: ";
1009 $name = <STDIN>;
1010 $name =~ s/[\r|\n]//g;
1011 $ldap_base[$sub] = $name;
1012
1013 print "\n";
1014
1015 print "This is the TCP/IP port number for the LDAP server. Default\n";
1016 print "port is 389. This is optional. Press ENTER for default.\n";
1017 print "port: ";
1018 $name = <STDIN>;
1019 $name =~ s/[\r|\n]//g;
1020 $ldap_port[$sub] = $name;
1021
1022 print "\n";
1023
1024 print "This is the charset for the server. Default is utf-8. This\n";
1025 print "is also optional. Press ENTER for default.\n";
1026 print "charset: ";
1027 $name = <STDIN>;
1028 $name =~ s/[\r|\n]//g;
1029 $ldap_charset[$sub] = $name;
1030
1031 print "\n";
1032
1033 print "This is the name for the server, used to tag the results of\n";
1034 print "the search. Default it \"LDAP: hostname\". Press ENTER for default\n";
1035 print "name: ";
1036 $name = <STDIN>;
1037 $name =~ s/[\r|\n]//g;
1038 $ldap_name[$sub] = $name;
1039
1040 print "\n";
1041
1042 print "You can specify the maximum number of rows in the search result.\n";
1043 print "Default is unlimited. Press ENTER for default.\n";
1044 print "maxrows: ";
1045 $name = <STDIN>;
1046 $name =~ s/[\r|\n]//g;
1047 $ldap_maxrows[$sub] = $name;
1048
1049 print "\n";
1050
1051 } elsif ($input =~ /^\s*-\s*[0-9]?/) {
1052 if ($input =~ /[0-9]+\s*$/) {
1053 $rem_num = $input;
1054 $rem_num =~ s/^\s*-\s*//g;
1055 $rem_num =~ s/\s*$//;
1056 } else {
1057 $rem_num = $#ldap_host;
1058 }
1059 $count = 0;
1060 @new_ldap_host = ();
1061 @new_ldap_base = ();
1062 @new_ldap_port = ();
1063 @new_ldap_name = ();
1064 @new_ldap_charset = ();
1065 @new_ldap_maxrows = ();
1066 while ($count <= $#ldap_host) {
1067 if ($count != $rem_num) {
1068 @new_ldap_host = (@new_ldap_host, $ldap_host[$count]);
1069 @new_ldap_base = (@new_ldap_base, $ldap_base[$count]);
1070 @new_ldap_port = (@new_ldap_port, $ldap_port[$count]);
1071 @new_ldap_name = (@new_ldap_name, $ldap_name[$count]);
1072 @new_ldap_charset = (@new_ldap_charset, $ldap_charset[$count]);
1073 @new_ldap_maxrows = (@new_ldap_maxrows, $ldap_maxrows[$count]);
1074 }
1075 $count++;
1076 }
1077 @ldap_host = @new_ldap_host;
1078 @ldap_base = @new_ldap_base;
1079 @ldap_port = @new_ldap_port;
1080 @ldap_name = @new_ldap_name;
1081 @ldap_charset = @new_ldap_charset;
1082 @ldap_maxrows = @new_ldap_maxrows;
1083 } elsif ($input =~ /^\s*\?\s*/) {
1084 print ".-------------------------.\n";
1085 print "| + (add host) |\n";
1086 print "| - N (remove host) |\n";
1087 print "| l (list hosts) |\n";
1088 print "| d (done) |\n";
1089 print "`-------------------------'\n";
1090 }
1091 print "[ldap] command (?=help) > ";
1092 $input = <STDIN>;
1093 $input =~ s/[\r|\n]//g;
1094 }
1095 }
1096
1097 sub command62 {
1098 print "Some of our developers have come up with very good javascript interface\n";
1099 print "for searching through address books, however, our original goals said\n";
1100 print "that we would be 100% HTML. In order to make it possible to use their\n";
1101 print "interface, and yet stick with our goals, we have also written a plain\n";
1102 print "HTML version of the search. Here, you can choose which version to use.\n";
1103 print "\n";
1104 print "This is just the default value. It is also a user option that each\n";
1105 print "user can configure individually\n";
1106 print "\n";
1107
1108 if ($default_use_javascript_addr_book eq "true") {
1109 $default_value = "y";
1110 } else {
1111 $default_use_javascript_addr_book = "false";
1112 $default_value = "n";
1113 }
1114 print "Use javascript version by default (y/n) [$WHT$default_value$NRM]: $WHT";
1115 $new_show = <STDIN>;
1116 if (($new_show =~ /^y\n/i) || (($new_show =~ /^\n/) && ($default_value eq "y"))) {
1117 $default_use_javascript_addr_book = "true";
1118 } else {
1119 $default_use_javascript_addr_book = "false";
1120 }
1121 return $default_use_javascript_addr_book;
1122 }
1123
1124
1125 sub save_data {
1126 open (FILE, ">config.php");
1127
1128 print FILE "<?php\n\t/** SquirrelMail configuration\n";
1129 print FILE "\t ** Created using the configure script, conf.pl\n\t **/\n\n";
1130
1131 print FILE "\t\$org_name = \"$org_name\";\n";
1132 print FILE "\t\$org_logo = \"$org_logo\";\n";
1133 print FILE "\t\$org_title = \"$org_title\";\n";
1134
1135 print FILE "\n";
1136
1137 print FILE "\t\$domain = \"$domain\";\n";
1138 print FILE "\t\$imapServerAddress = \"$imapServerAddress\";\n";
1139 print FILE "\t\$imapPort = $imapPort;\n";
1140 print FILE "\t\$useSendmail = $useSendmail;\n";
1141 print FILE "\t\$smtpServerAddress = \"$smtpServerAddress\";\n";
1142 print FILE "\t\$smtpPort = $smtpPort;\n";
1143 print FILE "\t\$sendmailPath = \"$sendmail_path\";\n";
1144 print FILE "\t\$imap_server_type = \"$imap_server_type\";\n";
1145
1146 print FILE "\n";
1147
1148 print FILE "\t\$default_folder_prefix = \"$default_folder_prefix\";\n";
1149 print FILE "\t\$trash_folder = \"$trash_folder\";\n";
1150 print FILE "\t\$sent_folder = \"$sent_folder\";\n";
1151 print FILE "\t\$default_move_to_trash = $default_move_to_trash;\n";
1152 print FILE "\t\$default_move_to_sent = $default_move_to_sent;\n";
1153 print FILE "\t\$show_prefix_option = $show_prefix_option;\n";
1154 print FILE "\t\$list_special_folders_first = $list_special_folders_first;\n";
1155 print FILE "\t\$use_special_folder_color = $use_special_folder_color;\n";
1156 print FILE "\t\$auto_expunge = $auto_expunge;\n";
1157 print FILE "\t\$default_sub_of_inbox = $default_sub_of_inbox;\n";
1158 print FILE "\t\$show_contain_subfolders_option = $show_contain_subfolders_option;\n";
1159 print FILE "\n";
1160
1161 print FILE "\t\$default_charset = \"$default_charset\";\n";
1162 print FILE "\t\$auto_forward = $auto_forward;\n";
1163 print FILE "\t\$data_dir = \"$data_dir\";\n";
1164 print FILE "\t\$attachment_dir = \"$attachment_dir\";\n";
1165 print FILE "\t\$default_left_size = $default_left_size;\n";
1166
1167 print FILE "\n";
1168
1169 for ($count=0; $count <= $#theme_name; $count++) {
1170 print FILE "\t\$theme[$count][\"PATH\"] = \"$theme_path[$count]\";\n";
1171 print FILE "\t\$theme[$count][\"NAME\"] = \"$theme_name[$count]\";\n";
1172 }
1173
1174 print FILE "\n";
1175
1176 if ($default_use_javascript_addr_book ne "true") {
1177 $default_use_javascript_addr_book = "false";
1178 }
1179 print FILE "\t\$default_use_javascript_addr_book = $default_use_javascript_addr_book;\n";
1180 for ($count=0; $count <= $#ldap_host; $count++) {
1181 print FILE "\t\$ldap_server[$count] = Array(\n";
1182 print FILE "\t\t\t\"host\" => \"$ldap_host[$count]\",\n";
1183 print FILE "\t\t\t\"base\" => \"$ldap_base[$count]\"";
1184 if ($ldap_name[$count]) {
1185 print FILE ",\n\t\t\t\"name\" => \"$ldap_name[$count]\"";
1186 }
1187 if ($ldap_port[$count]) {
1188 print FILE ",\n\t\t\t\"port\" => \"$ldap_port[$count]\"";
1189 }
1190 if ($ldap_charset[$count]) {
1191 print FILE ",\n\t\t\t\"charset\" => \"$ldap_charset[$count]\"";
1192 }
1193 if ($ldap_maxrows[$count]) {
1194 print FILE ",\n\t\t\t\"maxrows\" => \"$ldap_maxrows[$count]\"";
1195 }
1196 print FILE ");\n\n";
1197 }
1198
1199 print FILE "\n";
1200 print FILE "\t\$motd = \"$motd\";\n";
1201
1202 print FILE "?>\n";
1203 close FILE;
1204 }
1205
1206 sub set_defaults {
1207 system "clear";
1208 print "While we have been building SquirrelMail, we have discovered some\n";
1209 print "preferences that work better with some servers that don't work so\n";
1210 print "well with others. If you select your IMAP server, this option will\n";
1211 print "set some pre-defined settings for that server.\n";
1212 print "\n";
1213 print "Please note that you will still need to go through and make sure\n";
1214 print "everything is correct. This does not change everything. There are\n";
1215 print "only a few settings that thils will change.\n";
1216 print "\n";
1217
1218 $continue = 0;
1219 while ($continue != 1) {
1220 print "Please select your IMAP server:\n";
1221 print " cyrus = Cyrus IMAP server\n";
1222 print " uw = University of Washington's IMAP server\n";
1223 print " exchange = Microsoft Exchange IMAP server\n";
1224 print " courier = Courier IMAP server\n";
1225 print " quit = Do not change anything\n";
1226 print "Command >> ";
1227 $server = <STDIN>;
1228 $server =~ s/[\r|\n]//g;
1229
1230 print "\n";
1231 if ($server eq "cyrus") {
1232 $default_folder_prefix = "INBOX";
1233 $trash_folder = "INBOX.Trash";
1234 $sent_folder = "INBOX.Sent";
1235 $show_prefix_option = false;
1236 $default_sub_of_inbox = true;
1237 $show_contain_subfolders_option = false;
1238 $imap_server_type = "cyrus";
1239
1240 print " default_folder_prefix = INBOX\n";
1241 print " trash_folder = INBOX.Trash\n";
1242 print " sent_folder = INBOX.Sent\n";
1243 print " show_prefix_optin = false\n";
1244 print " default_sub_of_inbox = true\n";
1245 print "show_contain_subfolders_option = false\n";
1246 print " imap_server_type = cyrus\n";
1247
1248 $continue = 1;
1249 } elsif ($server eq "uw") {
1250 $default_folder_prefix = "mail/";
1251 $trash_folder = "Trash";
1252 $sent_folder = "Sent";
1253 $show_prefix_option = true;
1254 $default_sub_of_inbox = false;
1255 $show_contain_subfolders_option = true;
1256 $imap_server_type = "uw";
1257
1258 print " default_folder_prefix = mail/\n";
1259 print " trash_folder = Trash\n";
1260 print " sent_folder = Sent\n";
1261 print " show_prefix_option = true\n";
1262 print " default_sub_of_inbox = false\n";
1263 print "show_contain_subfolders_option = true\n";
1264 print " imap_server_type = uw\n";
1265
1266 $continue = 1;
1267 } elsif ($server eq "exchange") {
1268 $default_folder_prefix = "INBOX/";
1269 $default_sub_of_inbox = true;
1270 $trash_folder = "INBOX/Deleted Items";
1271 $sent_folder = "INBOX/Sent Items";
1272 $show_prefix_option = false;
1273 $show_contain_subfolders_option = false;
1274
1275 $imap_server_type = "exchange";
1276
1277 $continue = 1;
1278 } elsif ($server eq "courier") {
1279 $imap_server_type = "courier";
1280
1281 $continue = 1;
1282 } elsif ($server eq "quit") {
1283 $continue = 1;
1284 } else {
1285 print "Unrecognized server: $server\n";
1286 print "\n";
1287 }
1288 }
1289 print "\nPress any key to continue...";
1290 $tmp = <STDIN>;
1291 }