272
if ( lc($useSendmail) ne "true" ) {
273
$useSendmail = "false";
275
if ( !$sendmail_path ) {
276
$sendmail_path = "/usr/sbin/sendmail";
278
if ( !$pop_before_smtp ) {
279
$pop_before_smtp = "false";
281
if ( !$default_unseen_notify ) {
282
$default_unseen_notify = 2;
284
if ( !$default_unseen_type ) {
285
$default_unseen_type = 1;
287
if ( !$config_use_color ) {
288
$config_use_color = 0;
290
if ( !$invert_time ) {
291
$invert_time = "false";
293
if ( !$force_username_lowercase ) {
294
$force_username_lowercase = "false";
296
if ( !$optional_delimiter ) {
297
$optional_delimiter = "detect";
299
if ( !$auto_create_special ) {
300
$auto_create_special = "false";
302
if ( !$default_use_priority ) {
303
$default_use_priority = "true";
305
if ( !$hide_sm_attributions ) {
306
$hide_sm_attributions = "false";
308
if ( !$default_use_mdn ) {
309
$default_use_mdn = "true";
311
if ( !$delete_folder ) {
312
$delete_folder = "false";
314
if ( !$noselect_fix_enable ) {
315
$noselect_fix_enable = "false";
321
if ( !$provider_uri ) {
322
$provider_uri = "http://www.squirrelmail.org/";
325
if ( !$provider_name ) {
326
$provider_name = "SquirrelMail";
329
if ( !$edit_identity ) {
330
$edit_identity = "true";
335
if ( !$allow_thread_sort ) {
336
$allow_thread_sort = 'false';
338
if ( !$allow_server_sort ) {
339
$allow_server_sort = 'false';
341
if ( !$no_list_for_subscribe ) {
342
$no_list_for_subscribe = 'false';
344
if ( !$allow_charset_search ) {
345
$allow_charset_search = 'true';
347
if ( !$prefs_user_field ) {
348
$prefs_user_field = 'user';
350
if ( !$prefs_key_field ) {
351
$prefs_key_field = 'prefkey';
353
if ( !$addrbook_global_table ) {
354
$addrbook_global_table = 'global_abook';
356
if ( !$addrbook_global_writeable ) {
357
$addrbook_global_writeable = 'false';
359
if ( !$addrbook_global_listing ) {
360
$addrbook_global_listing = 'false';
362
if ( !$prefs_val_field ) {
363
$prefs_val_field = 'prefval';
366
if ( !$use_smtp_tls) {
367
$use_smtp_tls= 'false';
370
if ( !$smtp_auth_mech ) {
371
$smtp_auth_mech = 'none';
374
if ( !$use_imap_tls ) {
375
$use_imap_tls = 'false';
378
if ( !$imap_auth_mech ) {
379
$imap_auth_mech = 'login';
382
if (!$session_name ) {
383
$session_name = 'SQMSESSID';
386
if (!$show_alternative_names ) {
387
$show_alternative_names = 'false';
390
if (!$available_languages ) {
391
$available_languages = 'all';
394
if (!$agresive_decoding ) {
395
$agresive_decoding = 'false';
398
if (!$advanced_tree ) {
399
$advanced_tree = 'false';
406
if (!$use_php_recode ) {
407
$use_php_recode = 'false';
410
if (!$use_php_iconv ) {
411
$use_php_iconv = 'false';
276
# Default values used when option is missing
277
$useSendmail = "false" if ( lc($useSendmail) ne "true" );
278
$sendmail_path = "/usr/sbin/sendmail" if ( !$sendmail_path );
279
$pop_before_smtp = "false" if ( !$pop_before_smtp ) ;
280
$default_unseen_notify = 2 if ( !$default_unseen_notify );
281
$default_unseen_type = 1 if ( !$default_unseen_type );
282
$config_use_color = 0 if ( !$config_use_color );
283
$invert_time = "false" if ( !$invert_time );
284
$force_username_lowercase = "false" if ( !$force_username_lowercase );
285
$optional_delimiter = "detect" if ( !$optional_delimiter );
286
$auto_create_special = "false" if ( !$auto_create_special );
287
$default_use_priority = "true" if ( !$default_use_priority );
288
$hide_sm_attributions = "false" if ( !$hide_sm_attributions );
289
$default_use_mdn = "true" if ( !$default_use_mdn );
290
$delete_folder = "false" if ( !$delete_folder );
291
$noselect_fix_enable = "false" if ( !$noselect_fix_enable );
292
$frame_top = "_top" if ( !$frame_top );
294
$provider_uri = "http://www.squirrelmail.org/" if ( !$provider_uri );
295
$provider_name = "SquirrelMail" if ( !$provider_name );
297
$edit_identity = "true" if ( !$edit_identity );
298
$edit_name = "true" if ( !$edit_name );
299
$allow_thread_sort = 'false' if ( !$allow_thread_sort ) ;
300
$allow_server_sort = 'false' if ( !$allow_server_sort );
301
$uid_support = 'true' if ( !$uid_support );
302
$no_list_for_subscribe = 'false' if ( !$no_list_for_subscribe );
303
$allow_charset_search = 'true' if ( !$allow_charset_search );
305
$prefs_user_field = 'user' if ( !$prefs_user_field );
306
$prefs_key_field = 'prefkey' if ( !$prefs_key_field );
307
$prefs_val_field = 'prefval' if ( !$prefs_val_field );
309
$use_smtp_tls= 'false' if ( !$use_smtp_tls);
310
$smtp_auth_mech = 'none' if ( !$smtp_auth_mech );
312
$use_imap_tls = 'false' if ( !$use_imap_tls );
313
$imap_auth_mech = 'login' if ( !$imap_auth_mech );
315
$session_name = 'SQMSESSID' if (!$session_name );
317
$default_use_javascript_addr_book = 'false' if (! $default_use_javascript_addr_book);
320
$lossy_encoding = 'false' if ( !$lossy_encoding );
321
$addrbook_global_table = 'global_abook' if ( !$addrbook_global_table );
322
$addrbook_global_writeable = 'false' if ( !$addrbook_global_writeable );
323
$addrbook_global_listing = 'false' if ( !$addrbook_global_listing );
324
$abook_global_file = '' if ( !$abook_global_file);
325
$abook_global_file_writeable = 'false' if ( !$abook_global_file_writeable);
414
327
if ( $ARGV[0] eq '--install-plugin' ) {
415
328
print "Activating plugin " . $ARGV[1] . "\n";
662
576
print "R Return to Main Menu\n";
663
577
} elsif ( $menu == 10 ) {
664
print $WHT. "Language settings\n" . $NRM;
665
print "1. Default Language : $WHT$squirrelmail_default_language$NRM\n";
666
print "2. Default Charset : $WHT$default_charset$NRM\n";
667
print "3. Show alternative language names : $WHT$show_alternative_names$NRM\n";
668
print "4. Available languages : $WHT$available_languages$NRM\n";
669
print "5. Use agresive decoding : $WHT$agresive_decoding$NRM\n";
671
print "R Return to Main Menu\n";
672
} elsif ( $menu == 11 ) {
673
print $WHT. "Interface tweaks\n" . $NRM;
674
print "1. Advanced tree : $WHT$advanced_tree$NRM\n";
675
print "2. Oldway : $WHT$oldway$NRM\n";
677
print $WHT. "PHP tweaks\n" . $NRM;
678
print "3. Use php recode functions : $WHT$use_php_recode$NRM\n";
679
print "4. Use php iconv functions : $WHT$use_php_iconv$NRM\n";
578
print $WHT. "Language preferences\n" . $NRM;
579
print "1. Default Language : $WHT$squirrelmail_default_language$NRM\n";
580
print "2. Default Charset : $WHT$default_charset$NRM\n";
581
print "3. Enable lossy encoding : $WHT$lossy_encoding$NRM\n";
681
583
print "R Return to Main Menu\n";
683
585
if ( $config_use_color == 1 ) {
684
print "C. Turn color off\n";
586
print "C Turn color off\n";
686
print "C. Turn color on\n";
588
print "C Turn color on\n";
688
590
print "S Save data\n";
689
591
print "Q Quit\n";
783
685
elsif ( $command == 17 ) { $delete_folder = command215(); }
784
686
elsif ( $command == 18 ) { $noselect_fix_enable = command216(); }
785
687
} elsif ( $menu == 4 ) {
786
if ( $command == 1 ) { $data_dir = command33a(); }
787
elsif ( $command == 2 ) { $attachment_dir = command33b(); }
788
elsif ( $command == 3 ) { $dir_hash_level = command33c(); }
789
elsif ( $command == 4 ) { $default_left_size = command35(); }
790
elsif ( $command == 5 ) { $force_username_lowercase = command36(); }
791
elsif ( $command == 6 ) { $default_use_priority = command37(); }
792
elsif ( $command == 7 ) { $hide_sm_attributions = command38(); }
793
elsif ( $command == 8 ) { $default_use_mdn = command39(); }
794
elsif ( $command == 9 ) { $edit_identity = command310(); }
795
elsif ( $command == 10 ) { $allow_thread_sort = command312(); }
796
elsif ( $command == 11 ) { $allow_server_sort = command313(); }
797
elsif ( $command == 12 ) { $allow_charset_search = command314(); }
798
elsif ( $command == 13 ) { $session_name = command316(); }
688
if ( $command == 1 ) { $data_dir = command31(); }
689
elsif ( $command == 2 ) { $attachment_dir = command32(); }
690
elsif ( $command == 3 ) { $dir_hash_level = command33(); }
691
elsif ( $command == 4 ) { $default_left_size = command34(); }
692
elsif ( $command == 5 ) { $force_username_lowercase = command35(); }
693
elsif ( $command == 6 ) { $default_use_priority = command36(); }
694
elsif ( $command == 7 ) { $hide_sm_attributions = command37(); }
695
elsif ( $command == 8 ) { $default_use_mdn = command38(); }
696
elsif ( $command == 9 ) { $edit_identity = command39(); }
697
elsif ( $command == 10 ) { $allow_thread_sort = command310(); }
698
elsif ( $command == 11 ) { $allow_server_sort = command311(); }
699
elsif ( $command == 12 ) { $allow_charset_search = command312(); }
700
elsif ( $command == 13 ) { $uid_support = command313(); }
701
elsif ( $command == 14 ) { $session_name = command314(); }
799
702
} elsif ( $menu == 5 ) {
800
703
if ( $command == 1 ) { command41(); }
801
704
elsif ( $command == 2 ) { $theme_css = command42(); }
802
705
} elsif ( $menu == 6 ) {
803
706
if ( $command == 1 ) { command61(); }
804
707
elsif ( $command == 2 ) { command62(); }
708
elsif ( $command == 3 ) { $abook_global_file=command63(); }
709
elsif ( $command == 4 ) { command64(); }
805
710
} elsif ( $menu == 7 ) {
806
711
if ( $command == 1 ) { $motd = command71(); }
807
712
} elsif ( $menu == 8 ) {
820
725
elsif ( $command == 11 ) { $addrbook_global_listing = command911(); }
821
726
} elsif ( $menu == 10 ) {
822
727
if ( $command == 1 ) { $squirrelmail_default_language = commandA1(); }
823
elsif ( $command == 2 ) { $default_charset = commandA2(); }
824
elsif ( $command == 3 ) { $show_alternative_names = commandA3(); }
825
elsif ( $command == 4 ) { $available_languages = commandA4(); }
826
elsif ( $command == 5 ) { $agresive_decoding = commandA5(); }
827
} elsif ( $menu == 11 ) {
828
if ( $command == 1 ) { $advanced_tree = commandB1(); }
829
elsif ( $command == 2 ) { $oldway = commandB2(); }
830
elsif ( $command == 3 ) { $use_php_recode = commandB3(); }
831
elsif ( $command == 4 ) { $use_php_iconv = commandB4(); }
728
elsif ( $command == 2 ) { $default_charset = commandA2(); }
729
elsif ( $command == 3 ) { $lossy_encoding = commandA3(); }
735
print "\nExiting conf.pl.\n".
736
"You might want to test your configuration by browsing to\n".
737
"http://your-squirrelmail-location/src/configtest.php\n".
738
"Happy SquirrelMailing!\n\n";
836
741
####################################################################################
742
#### Organization preferences ####
840
745
print "We have tried to make the name SquirrelMail as transparent as\n";
1208
1114
return $new_optional_delimiter;
1210
1116
# IMAP authentication type
1211
# Possible values: login, plain, cram-md5, digest-md5
1117
# Possible values: login, cram-md5, digest-md5
1212
1118
# Now offers to detect supported mechs, assuming server & port are set correctly
1214
1120
sub command112a {
1215
1121
if ($use_imap_tls =~ /^true\b/i) {
1216
1122
print "Auto-detection of login methods is unavailable when using TLS.\n";
1218
print "If you have already set the hostname and port number, I can try to\n";
1219
print "detect the mechanisms your IMAP server supports.\n";
1220
print "I will try to detect CRAM-MD5 and DIGEST-MD5 support. I can't test\n";
1221
print "for \"login\" or \"plain\" without knowing a username and password.\n";
1222
print "Auto-detecting is optional - you can safely say \"n\" here.\n";
1223
print "\nTry to detect supported mechanisms? [y/N]: ";
1226
if ($inval =~ /^y\b/i) {
1227
# Yes, let's try to detect.
1228
print "Trying to detect IMAP capabilities...\n";
1229
my $host = $imapServerAddress . ':'. $imapPort;
1230
print "CRAM-MD5:\t";
1231
my $tmp = detect_auth_support('IMAP',$host,'CRAM-MD5');
1232
if (defined($tmp)) {
1233
if ($tmp eq 'YES') {
1234
print "$WHT SUPPORTED$NRM\n";
1236
print "$WHT NOT SUPPORTED$NRM\n";
1124
print "If you have already set the hostname and port number, I can try to\n";
1125
print "detect the mechanisms your IMAP server supports.\n";
1126
print "I will try to detect CRAM-MD5 and DIGEST-MD5 support. I can't test\n";
1127
print "for \"login\" without knowing a username and password.\n";
1128
print "Auto-detecting is optional - you can safely say \"n\" here.\n";
1129
print "\nTry to detect supported mechanisms? [y/N]: ";
1132
if ($inval =~ /^y\b/i) {
1133
# Yes, let's try to detect.
1134
print "Trying to detect IMAP capabilities...\n";
1135
my $host = $imapServerAddress . ':'. $imapPort;
1136
print "CRAM-MD5:\t";
1137
my $tmp = detect_auth_support('IMAP',$host,'CRAM-MD5');
1138
if (defined($tmp)) {
1139
if ($tmp eq 'YES') {
1140
print "$WHT SUPPORTED$NRM\n";
1142
print "$WHT NOT SUPPORTED$NRM\n";
1239
print $WHT . " ERROR DETECTING$NRM\n";
1145
print $WHT . " ERROR DETECTING$NRM\n";
1242
print "DIGEST-MD5:\t";
1243
$tmp = detect_auth_support('IMAP',$host,'DIGEST-MD5');
1244
if (defined($tmp)) {
1245
if ($tmp eq 'YES') {
1246
print "$WHT SUPPORTED$NRM\n";
1248
print "$WHT NOT SUPPORTED$NRM\n";
1251
print $WHT . " ERROR DETECTING$NRM\n";
1256
print "\nWhat authentication mechanism do you want to use for IMAP connections?\n\n";
1257
print $WHT . "login" . $NRM . " - Plaintext. If you can do better, you probably should.\n";
1258
print $WHT . "plain" . $NRM . " - SASL PLAIN. If you need this, you already know it.\n";
1259
print $WHT . "cram-md5" . $NRM . " - Slightly better than plaintext methods.\n";
1260
print $WHT . "digest-md5" . $NRM . " - Privacy protection - better than cram-md5.\n";
1261
print "\n*** YOUR IMAP SERVER MUST SUPPORT THE MECHANISM YOU CHOOSE HERE ***\n";
1262
print "If you don't understand or are unsure, you probably want \"login\"\n\n";
1263
print "login, plain, cram-md5, or digest-md5 [$WHT$imap_auth_mech$NRM]: $WHT";
1148
print "DIGEST-MD5:\t";
1149
$tmp = detect_auth_support('IMAP',$host,'DIGEST-MD5');
1150
if (defined($tmp)) {
1151
if ($tmp eq 'YES') {
1152
print "$WHT SUPPORTED$NRM\n";
1154
print "$WHT NOT SUPPORTED$NRM\n";
1157
print $WHT . " ERROR DETECTING$NRM\n";
1162
print "\nWhat authentication mechanism do you want to use for IMAP connections?\n\n";
1163
print $WHT . "login" . $NRM . " - Plaintext. If you can do better, you probably should.\n";
1164
print $WHT . "cram-md5" . $NRM . " - Slightly better than plaintext methods.\n";
1165
print $WHT . "digest-md5" . $NRM . " - Privacy protection - better than cram-md5.\n";
1166
print "\n*** YOUR IMAP SERVER MUST SUPPORT THE MECHANISM YOU CHOOSE HERE ***\n";
1167
print "If you don't understand or are unsure, you probably want \"login\"\n\n";
1168
print "login, cram-md5, or digest-md5 [$WHT$imap_auth_mech$NRM]: $WHT";
1264
1169
$inval=<STDIN>;
1266
if ( ($inval =~ /^cram-md5\b/i) || ($inval =~ /^digest-md5\b/i) || ($inval =~ /^login\b/i) || ($inval =~ /^plain\b/i)) {
1171
if ( ($inval =~ /^cram-md5\b/i) || ($inval =~ /^digest-md5\b/i) || ($inval =~ /^login\b/i)) {
1267
1172
return lc($inval);
1269
1174
# user entered garbage or default value so nothing needs to be set
1279
1184
print "Auto-detection of login methods is unavailable when using TLS.\n";
1281
1186
print "If you have already set the hostname and port number, I can try to\n";
1282
print "automatically detect some of the mechanisms your SMTP server supports.\n";
1283
print "Auto-detection is *optional* - you can safely say \"n\" here.\n";
1187
print "automatically detect the mechanisms your SMTP server supports.\n";
1188
print "Auto-detection is *optional* - you can safely say \"n\" here.\n";
1284
1189
print "\nTry to detect auth mechanisms? [y/N]: ";
1285
1190
$inval=<STDIN>;
1287
1192
if ($inval =~ /^y\b/i) {
1288
# Yes, let's try to detect.
1289
print "Trying to detect supported methods (SMTP)...\n";
1292
# Check none by trying to relay to junk@microsoft.com
1293
$host = $smtpServerAddress . ':' . $smtpPort;
1295
my $sock = IO::Socket::INET->new($host);
1296
print "Testing none:\t\t$WHT";
1297
if (!defined($sock)) {
1298
print " ERROR TESTING\n";
1301
print $sock "mail from: tester\@squirrelmail.org\n";
1302
$got = <$sock>; # Discard
1303
print $sock "rcpt to: junk\@microsoft.com\n";
1304
$got = <$sock>; # This is the important line
1305
if ($got =~ /^250\b/) { # SMTP will relay without auth
1306
print "SUPPORTED$NRM\n";
1308
print "NOT SUPPORTED$NRM\n";
1310
print $sock "rset\n";
1311
print $sock "quit\n";
1314
# Try login (SquirrelMail default)
1315
print "Testing login:\t\t";
1316
$tmp=detect_auth_support('SMTP',$host,'LOGIN');
1317
if (defined($tmp)) {
1318
if ($tmp eq 'YES') {
1319
print $WHT . "SUPPORTED$NRM\n";
1321
print $WHT . "NOT SUPPORTED$NRM\n";
1324
print $WHT . "ERROR DETECTING$NRM\n";
1193
# Yes, let's try to detect.
1194
print "Trying to detect supported methods (SMTP)...\n";
1197
# Check none by trying to relay to junk@microsoft.com
1198
$host = $smtpServerAddress . ':' . $smtpPort;
1200
my $sock = IO::Socket::INET->new($host);
1201
print "Testing none:\t\t$WHT";
1202
if (!defined($sock)) {
1203
print " ERROR TESTING\n";
1206
print $sock "HELO $domain\r\n";
1207
$got = <$sock>; # Discard
1208
print $sock "MAIL FROM:<tester\@squirrelmail.org>\r\n";
1209
$got = <$sock>; # Discard
1210
print $sock "RCPT TO:<junk\@microsoft.com>\r\n";
1211
$got = <$sock>; # This is the important line
1212
if ($got =~ /^250\b/) { # SMTP will relay without auth
1213
print "SUPPORTED$NRM\n";
1215
print "NOT SUPPORTED$NRM\n";
1217
print $sock "RSET\r\n";
1218
print $sock "QUIT\r\n";
1221
# Try login (SquirrelMail default)
1222
print "Testing login:\t\t";
1223
$tmp=detect_auth_support('SMTP',$host,'LOGIN');
1224
if (defined($tmp)) {
1225
if ($tmp eq 'YES') {
1226
print $WHT . "SUPPORTED$NRM\n";
1228
print $WHT . "NOT SUPPORTED$NRM\n";
1231
print $WHT . "ERROR DETECTING$NRM\n";
1328
1235
print "Testing CRAM-MD5:\t";
1329
1236
$tmp=detect_auth_support('SMTP',$host,'CRAM-MD5');
1330
1237
if (defined($tmp)) {
1379
1285
# This sub is reused for IMAP and SMTP
1380
1286
# Args: service name, default value
1381
1287
sub command113 {
1382
my($default_val,$service,$inval);
1385
print "TLS (Transport Layer Security) encrypts the traffic between server and client.\n";
1386
print "If you're familiar with SSL, you get the idea.\n";
1387
print "To use this feature, your " . $service . " server must offer TLS\n";
1388
print "capability, plus PHP 4.3.x with OpenSSL support.\n";
1389
print "\nIf your " . $service . " server is localhost, you can safely disable this.\n";
1390
print "If it is remote, you may wish to seriously consider enabling this.\n";
1288
my($default_val,$service,$inval);
1291
print "TLS (Transport Layer Security) encrypts the traffic between server and client.\n";
1292
print "If you're familiar with SSL, you get the idea.\n";
1293
print "To use this feature, your " . $service . " server must offer TLS\n";
1294
print "capability, plus PHP 4.3.x with OpenSSL support.\n";
1295
print "\nIf your " . $service . " server is localhost, you can safely disable this.\n";
1296
print "If it is remote, you may wish to seriously consider enabling this.\n";
1391
1297
print "Enable TLS (y/n) [$WHT";
1392
1298
if ($default_val eq "true") {
1850
1756
# Automatically delete folders
1851
1757
sub command215 {
1852
if ( $imap_server_type eq "uw" ) {
1853
print "UW IMAP servers will not allow folders containing mail to also contain folders.\n";
1854
print "Deleting folders will bypass the trash folder and be immediately deleted\n\n";
1758
if ( $imap_server_type == "courier" ) {
1759
print "Courier(or Courier-IMAP) IMAP servers do not support ";
1760
print "subfolders of Trash. \n";
1761
print "Deleting folders will bypass the trash folder and ";
1762
print "be immediately deleted.\n\n";
1763
print "If this is not the correct value for your server,\n";
1764
print "please use option D on the Main Menu to configure your server correctly.\n\n";
1765
print "Press any key to continue...\n";
1766
$new_delete = <STDIN>;
1767
$delete_folder = "true";
1768
} elsif ( $imap_server_type == "uw" ) {
1769
print "UW IMAP servers will not allow folders containing";
1770
print "mail to also contain folders.\n";
1771
print "Deleting folders will bypass the trash folder and";
1772
print "be immediately deleted\n\n";
1855
1773
print "If this is not the correct value for your server,\n";
1856
1774
print "please use option D on the Main Menu to configure your server correctly.\n\n";
1857
1775
print "Press any key to continue...\n";
1858
1776
$new_delete = <STDIN>;
1859
1777
$delete_folder = "true";
1861
if ( $imap_server_type eq "courier" ) {
1862
print "Courier (or Courier-IMAP) IMAP servers may not support ";
1863
print "subfolders of Trash. \n";
1864
print "Specifically, if Courier is set to always move messages to Trash, \n";
1865
print "Trash will be treated by Courier as a special folder that does not \n";
1866
print "allow subfolders. \n\n";
1867
print "Please verify your Courier configuration, and test folder deletion \n";
1868
print "when changing this setting.\n\n";
1871
print "Are subfolders of the Trash supported by your IMAP server?\n";
1872
print "If so, should deleted folders be sent to Trash?\n";
1873
print "If not, say no (deleted folders should not be sent to Trash)\n\n";
1874
# reversal of logic.
1875
# question was: Should folders be automatically deleted instead of sent to trash..
1876
# we've changed the question to make it more clear,
1877
# and are here handling that to avoid changing the answers..
1779
print "Should folders selected for deletion bypass the Trash folder?\n\n";
1878
1780
if ( lc($delete_folder) eq "true" ) {
1781
$default_value = "y";
1879
1783
$default_value = "n";
1881
$default_value = "y";
1883
print "Send deleted folders to Trash? (y/n) [$WHT$default_value$NRM]: $WHT";
1785
print "Auto delete folders? (y/n) [$WHT$default_value$NRM]: $WHT";
1884
1786
$new_delete = <STDIN>;
1885
1787
if ( ( $new_delete =~ /^y\n/i ) || ( ( $new_delete =~ /^\n/ ) && ( $default_value eq "y" ) ) ) {
1788
$delete_folder = "true";
1886
1790
$delete_folder = "false";
1888
$delete_folder = "true";
1891
1793
return $delete_folder;
2629
2532
return $default_use_javascript_addr_book;
2535
# global filebased address book
2537
print "If you want to use global file address book, then you\n";
2538
print "must set this option to a valid value. If option does\n";
2539
print "not have path elements, system assumes that file is\n";
2540
print "stored in data directory. If relative path is set, it is\n";
2541
print "relative to main squirrelmail directory. If value is empty,\n";
2542
print "address book is not enabled.\n";
2545
print "[$WHT$abook_global_file$NRM]: $WHT";
2546
$new_abook_global_file = <STDIN>;
2547
if ( $new_abook_global_file eq "\n" ) {
2548
$new_abook_global_file = $abook_global_file;
2550
$new_abook_global_file =~ s/[\r\n]//g;
2552
return $new_abook_global_file;
2555
# writing into global filebased abook control
2557
print "This setting controls writing into global file address\n";
2558
print "book options. Address book file must be writeable by\n";
2559
print "webserver's user, if you want to enable this option.\n";
2562
if ( lc($abook_global_file_writeable) eq 'true' ) {
2563
$default_value = "y";
2565
$abook_global_file_writeable = 'false';
2566
$default_value = "n";
2568
print "Allow writing into global file address book (y/n) [$WHT$default_value$NRM]: $WHT";
2569
$new_show = <STDIN>;
2570
if ( ( $new_show =~ /^y\n/i ) || ( ( $new_show =~ /^\n/ ) && ( $default_value eq "y" ) ) ) {
2571
$abook_global_file_writeable = 'true';
2573
$abook_global_file_writeable = 'false';
2575
return $abook_global_file_writeable;
2578
####################################################################################
2632
2580
sub command91 {
2633
2581
print "If you want to store your users address book details in a database then\n";
2634
2582
print "you need to set this DSN to a valid value. The format for this is:\n";
2839
2790
print "language. Please use the code for the desired language.\n";
2841
2792
print "[$WHT$squirrelmail_default_language$NRM]: $WHT";
2842
$new_squirrelmail_default_language = <STDIN>;
2843
if ( $new_squirrelmail_default_language eq "\n" ) {
2844
$new_squirrelmail_default_language = $squirrelmail_default_language;
2793
$new_language = <STDIN>;
2794
if ( $new_language eq "\n" ) {
2795
$new_language = $squirrelmail_default_language;
2846
$new_squirrelmail_default_language =~ s/[\r|\n]//g;
2847
$new_squirrelmail_default_language =~ s/^\s+$//g;
2797
$new_language =~ s/[\r|\n]//g;
2798
$new_language =~ s/^\s+$//g;
2849
return $new_squirrelmail_default_language;
2800
return $new_language;
2851
2803
# Default Charset
2852
2804
sub commandA2 {
2853
# print "This option controls what character set is used when sending\n";
2854
# print "mail and when sending HTML to the browser. Do not set this\n";
2855
# print "to US-ASCII, use ISO-8859-1 instead. For cyrillic, it is best\n";
2856
# print "to use KOI8-R, since this implementation is faster than most\n";
2857
# print "of the alternatives\n";
2858
print "This option is obsolate. Default charset depends on language\n";
2859
print "you have selected in \"Default language\" option.\n";
2805
print "This option controls what character set is used when sending\n";
2806
print "mail and when sending HTML to the browser.\n";
2808
print "This option is used only when default language is 'en_US'.\n";
2862
2811
print "[$WHT$default_charset$NRM]: $WHT";
2869
2818
return $new_default_charset;
2871
# Alternative language names
2872
2822
sub commandA3 {
2873
print "Enable this option if you want to see localized language names in\n";
2874
print "language selection box. Note, that if don't limit list of available\n";
2875
print "languages, this option can trigger installation of foreign language\n";
2876
print "support modules in some browsers.\n";
2879
if ( lc($show_alternative_names) eq "true" ) {
2880
$default_value = "y";
2882
$default_value = "n";
2884
print "Show alternative language names? (y/n) [$WHT$default_value$NRM]: $WHT";
2885
$show_alternative_names = <STDIN>;
2886
if ( ( $show_alternative_names =~ /^y\n/i ) || ( ( $show_alternative_names =~ /^\n/ ) && ( $default_value eq "y" ) ) ) {
2887
$show_alternative_names = "true";
2889
$show_alternative_names = "false";
2891
return $show_alternative_names;
2893
# Available languages
2895
print "This option allows to limit number of languages available in\n";
2896
print "language selection box. You can enter as code of every language that\n";
2897
print "you want to enable. Language codes should be separated by space. If you\n";
2898
print "enter name unsupported by SquirrelMail, it will be ignored. If you enter\n";
2899
print "special key \'all\' - all languages available in SquirrelMail will be\n";
2900
print "listed. If you enter special key \'none\' - user won't be able to change";
2901
print "language and interface will use language set it \"Default language\" option.\n";
2903
print "Valid language names are:\n";
2904
print " ar (Arabic), bg_BG (Bulgarian), ca_ES (Catalan), cy_GB (Welsh)\n";
2905
print " cs_CZ (Chech), da_DK (Danish), de_DE (German), el_GR (Greek),\n";
2906
print " en_US (English), es_ES (Spanish), et_EE (Estonian), fi_FI (Finnish),\n";
2907
print " fo_FO (Faroese), fr_FR (French), he_IL (Hebrew), hr_HR (Croatian),\n";
2908
print " hu_HU (Hungarian), id_ID (Indonesian), is_IS (Icelandic), it_IT (Italian),\n";
2909
print " ja_JP (Japanese), ko_KR (Korean), lt_LT (Lithuanian), ms_MY (Malay),\n";
2910
print " nl_NL (Dutch), nn_NO (Norwegian (Nynorsk)), no_NO (Norwegian (Bokmal)),\n";
2911
print " pl_PL (Polish), pt_BR (Portuguese (Brazil)), pt_PT (Portuguese (Portugal)),\n";
2912
print " ro_RO (Romanian), ru_RU (Russian), sk_SK (Slovak), sl_SI (Slovenian),\n";
2913
print " sr_YU (Serbian), sv_SE (Swedish), th_TH (Thai), tr_TR (Turkish),\n";
2914
print " zh_CN (Chinese Simplified), zh_TW (Chinese Traditional).\n";
2916
print "[$WHT$available_languages$NRM]: $WHT";
2917
$new_available_languages = <STDIN>;
2918
if ( $new_available_languages eq "\n" ) {
2919
$new_available_languages = $available_languages;
2921
$new_available_languages =~ s/[\r|\n]//g;
2922
$new_available_languages =~ s/^\s+$//g;
2924
return $new_available_languages;
2928
print "Enable this option if you want to use CPU and memory intensive decoding\n";
2929
print "functions. This option allows reading multibyte charset, that are used\n";
2930
print "in Eastern Asia. SquirrelMail will try to use recode functions here,\n";
2931
print "even when you have disabled use of recode in Tweaks section.\n";
2934
if ( lc($agresive_decoding) eq "true" ) {
2935
$default_value = "y";
2937
$default_value = "n";
2939
print "Use agresive decoding? (y/n) [$WHT$default_value$NRM]: $WHT";
2940
$agresive_decoding = <STDIN>;
2941
if ( ( $agresive_decoding =~ /^y\n/i ) || ( ( $agresive_decoding =~ /^\n/ ) && ( $default_value eq "y" ) ) ) {
2942
$agresive_decoding = "true";
2944
$agresive_decoding = "false";
2946
return $agresive_decoding;
2951
print "Enable this option if you want to use DHTML based folder listing.\n";
2952
print "Code is experimental, works only with some browsers and there might\n";
2953
print "be some glitches.\n";
2956
if ( lc($advanced_tree) eq "true" ) {
2957
$default_value = "y";
2959
$default_value = "n";
2961
print "Use advanced tree in folder listing? (y/n) [$WHT$default_value$NRM]: $WHT";
2962
$advanced_tree = <STDIN>;
2963
if ( ( $advanced_tree =~ /^y\n/i ) || ( ( $advanced_tree =~ /^\n/ ) && ( $default_value eq "y" ) ) ) {
2964
$advanced_tree = "true";
2966
$advanced_tree = "false";
2968
return $advanced_tree;
2972
print "Setting \$oldway to false causes left_main.php to use the new\n";
2973
print "experimental way of getting the mailbox-tree.\n";
2976
if ( lc($oldway) eq "true" ) {
2977
$default_value = "y";
2979
$default_value = "n";
2981
print "Use old way of folder list display? (y/n) [$WHT$default_value$NRM]: $WHT";
2983
if ( ( $oldway =~ /^y\n/i ) || ( ( $oldway =~ /^\n/ ) && ( $default_value eq "y" ) ) ) {
2992
print "Enable this option if you want to use php recode functions to read\n";
2993
print "emails written in charset that differs from the one that is set in\n";
2994
print "translation selected by user. Code is experimental, it might cause\n";
2995
print "errors, if email contains charset unsupported by recode or if your\n";
2996
print "php does not have recode support.\n";
2999
if ( lc($use_php_recode) eq "true" ) {
3000
$default_value = "y";
3002
$default_value = "n";
3004
print "Use php recode functions? (y/n) [$WHT$default_value$NRM]: $WHT";
3005
$use_php_recode = <STDIN>;
3006
if ( ( $use_php_recode =~ /^y\n/i ) || ( ( $use_php_recode =~ /^\n/ ) && ( $default_value eq "y" ) ) ) {
3007
$use_php_recode = "true";
3009
$use_php_recode = "false";
3011
return $use_php_recode;
3015
print "Enable this option if you want to use php iconv functions to read\n";
3016
print "emails written in charset that differs from the one that is set in\n";
3017
print "translation selected by user. Code is experimental, it works only\n";
3018
print "with translations that use utf-8 charset. Code might cause errors,\n";
3019
print "if email contains charset unsupported by iconv or if your php does\n";
3020
print "not have iconv support.\n";
3023
if ( lc($use_php_iconv) eq "true" ) {
3024
$default_value = "y";
3026
$default_value = "n";
3028
print "Use php iconv functions? (y/n) [$WHT$default_value$NRM]: $WHT";
3029
$use_php_iconv = <STDIN>;
3030
if ( ( $use_php_iconv =~ /^y\n/i ) || ( ( $use_php_iconv =~ /^\n/ ) && ( $default_value eq "y" ) ) ) {
3031
$use_php_iconv = "true";
3033
$use_php_iconv = "false";
3035
return $use_php_iconv;
2823
print "Enable this option if you want to allow lossy charset encoding in message\n";
2824
print "composition pages. This option allows charset conversions when output\n";
2825
print "charset does not support all symbols used in original charset. Symbols\n";
2826
print "unsupported by output charset will be replaced with question marks.\n";
2829
if ( lc($lossy_encoding) eq 'true' ) {
2830
$default_value = "y";
2832
$default_value = "n";
2834
print "Enable lossy encoding? (y/n) [$WHT$default_value$NRM]: $WHT";
2835
$lossy_encoding = <STDIN>;
2836
if ( ( $lossy_encoding =~ /^y\n/i ) || ( ( $lossy_encoding =~ /^\n/ ) && ( $default_value eq "y" ) ) ) {
2837
$lossy_encoding = 'true';
2839
$lossy_encoding = 'false';
2841
return $lossy_encoding;
2844
#### End of menu functions
2845
####################################################################################
3039
2847
sub save_data {
3080
2888
print CF "\$provider_name = '$provider_name';\n";
3083
# string that can contain variables
2891
# string that can contain variables
3084
2892
print CF "\$motd = \"$motd\";\n";
2895
# Language preferences
3088
2897
print CF "\$squirrelmail_default_language = '$squirrelmail_default_language';\n";
3090
print CF "\$default_charset = '$default_charset';\n";
3092
print CF "\$show_alternative_names = $show_alternative_names;\n";
3094
print CF "\$available_languages = '$available_languages';\n";
3096
print CF "\$agresive_decoding = $agresive_decoding;\n";
2899
print CF "\$default_charset = '$default_charset';\n";
2901
print CF "\$lossy_encoding = $lossy_encoding;\n";
3100
if ($domain =~ /^implode\(/) {
3101
print CF "\$domain = $domain;\n";
3103
print CF "\$domain = '$domain';\n";
2906
if ($domain =~ /^(implode|trim)\(/) {
2907
print CF "\$domain = $domain;\n";
2909
print CF "\$domain = '$domain';\n";
3106
2912
print CF "\$imapServerAddress = '$imapServerAddress';\n";
3108
2914
print CF "\$imapPort = $imapPort;\n";
3110
2916
print CF "\$useSendmail = $useSendmail;\n";
3112
2918
print CF "\$smtpServerAddress = '$smtpServerAddress';\n";
3114
2920
print CF "\$smtpPort = $smtpPort;\n";
3116
2922
print CF "\$sendmail_path = '$sendmail_path';\n";
3118
2924
# print CF "\$use_authenticated_smtp = $use_authenticated_smtp;\n";
3120
2926
print CF "\$pop_before_smtp = $pop_before_smtp;\n";
3122
2928
print CF "\$imap_server_type = '$imap_server_type';\n";
3124
2930
print CF "\$invert_time = $invert_time;\n";
3126
2932
print CF "\$optional_delimiter = '$optional_delimiter';\n";
3130
2936
print CF "\$default_folder_prefix = '$default_folder_prefix';\n";
3132
2938
print CF "\$trash_folder = '$trash_folder';\n";
3134
2940
print CF "\$sent_folder = '$sent_folder';\n";
3136
2942
print CF "\$draft_folder = '$draft_folder';\n";
3138
2944
print CF "\$default_move_to_trash = $default_move_to_trash;\n";
3140
2946
print CF "\$default_move_to_sent = $default_move_to_sent;\n";
3142
2948
print CF "\$default_save_as_draft = $default_save_as_draft;\n";
3144
2950
print CF "\$show_prefix_option = $show_prefix_option;\n";
3146
2952
print CF "\$list_special_folders_first = $list_special_folders_first;\n";
3148
2954
print CF "\$use_special_folder_color = $use_special_folder_color;\n";
3150
2956
print CF "\$auto_expunge = $auto_expunge;\n";
3152
2958
print CF "\$default_sub_of_inbox = $default_sub_of_inbox;\n";
3154
2960
print CF "\$show_contain_subfolders_option = $show_contain_subfolders_option;\n";
3156
2962
print CF "\$default_unseen_notify = $default_unseen_notify;\n";
3158
2964
print CF "\$default_unseen_type = $default_unseen_type;\n";
3160
2966
print CF "\$auto_create_special = $auto_create_special;\n";
3162
2968
print CF "\$delete_folder = $delete_folder;\n";
3164
2970
print CF "\$noselect_fix_enable = $noselect_fix_enable;\n";
3169
2976
print CF "\$data_dir = " . &change_to_SM_path($data_dir) . ";\n";
3170
# string that can contain a variable
2977
# string that can contain a variable
3171
2978
print CF "\$attachment_dir = " . &change_to_SM_path($attachment_dir) . ";\n";
3173
2980
print CF "\$dir_hash_level = $dir_hash_level;\n";
3175
2982
print CF "\$default_left_size = '$default_left_size';\n";
3177
2984
print CF "\$force_username_lowercase = $force_username_lowercase;\n";
3179
2986
print CF "\$default_use_priority = $default_use_priority;\n";
3181
2988
print CF "\$hide_sm_attributions = $hide_sm_attributions;\n";
3183
2990
print CF "\$default_use_mdn = $default_use_mdn;\n";
3185
2992
print CF "\$edit_identity = $edit_identity;\n";
3187
2994
print CF "\$edit_name = $edit_name;\n";
3189
2996
print CF "\$allow_thread_sort = $allow_thread_sort;\n";
3191
2998
print CF "\$allow_server_sort = $allow_server_sort;\n";
3193
3000
print CF "\$allow_charset_search = $allow_charset_search;\n";
3002
print CF "\$uid_support = $uid_support;\n";
3196
# all plugins are strings
3005
# all plugins are strings
3197
3006
for ( $ct = 0 ; $ct <= $#plugins ; $ct++ ) {
3198
3007
print CF "\$plugins[$ct] = '$plugins[$ct]';\n";
3203
3012
print CF "\$theme_css = " . &change_to_SM_path($theme_css) . ";\n";
3204
if ( $theme_default eq '' ) { $theme_default = '0'; }
3013
if ( $theme_default eq '' ) { $theme_default = '0'; }
3205
3014
print CF "\$theme_default = $theme_default;\n";
3207
3016
for ( $count = 0 ; $count <= $#theme_name ; $count++ ) {
3208
3017
print CF "\$theme[$count]['PATH'] = " . &change_to_SM_path($theme_path[$count]) . ";\n";
3209
print CF "\$theme[$count]['NAME'] = '$theme_name[$count]';\n";
3018
# escape theme name so it can contain single quotes.
3019
$esc_name = $theme_name[$count];
3020
$esc_name =~ s/\\/\\\\/g;
3021
$esc_name =~ s/'/\\'/g;
3022
print CF "\$theme[$count]['NAME'] = '$esc_name';\n";
3213
if ( $default_use_javascript_addr_book ne "true" ) {
3214
$default_use_javascript_addr_book = "false";
3218
3028
print CF "\$default_use_javascript_addr_book = $default_use_javascript_addr_book;\n";
3219
3029
for ( $count = 0 ; $count <= $#ldap_host ; $count++ ) {
3220
3030
print CF "\$ldap_server[$count] = array(\n";
3222
3032
print CF " 'host' => '$ldap_host[$count]',\n";
3224
3034
print CF " 'base' => '$ldap_base[$count]'";
3225
3035
if ( $ldap_name[$count] ) {
3226
3036
print CF ",\n";
3228
3038
print CF " 'name' => '$ldap_name[$count]'";
3230
3040
if ( $ldap_port[$count] ) {
3231
3041
print CF ",\n";
3233
3043
print CF " 'port' => $ldap_port[$count]";
3235
3045
if ( $ldap_charset[$count] ) {
3236
3046
print CF ",\n";
3238
3048
print CF " 'charset' => '$ldap_charset[$count]'";
3240
3050
if ( $ldap_maxrows[$count] ) {
3241
3051
print CF ",\n";
3243
3053
print CF " 'maxrows' => $ldap_maxrows[$count]";
3245
3055
if ( $ldap_binddn[$count] ) {
3255
3065
if ( $ldap_protocol[$count] ) {
3256
3066
print CF ",\n";
3258
3068
print CF " 'protocol' => $ldap_protocol[$count]";
3261
3071
print CF ");\n";
3075
print CF "\$abook_global_file = '$abook_global_file';\n";
3077
print CF "\$abook_global_file_writeable = $abook_global_file_writeable;\n\n";
3266
3081
print CF "\$addrbook_dsn = '$addrbook_dsn';\n";
3268
3083
print CF "\$addrbook_table = '$addrbook_table';\n\n";
3270
3085
print CF "\$prefs_dsn = '$prefs_dsn';\n";
3272
3087
print CF "\$prefs_table = '$prefs_table';\n";
3274
3089
print CF "\$prefs_user_field = '$prefs_user_field';\n";
3276
3091
print CF "\$prefs_key_field = '$prefs_key_field';\n";
3278
print CF "\$prefs_val_field = '$prefs_val_field';\n\n";
3093
print CF "\$prefs_val_field = '$prefs_val_field';\n";
3280
3095
print CF "\$addrbook_global_dsn = '$addrbook_global_dsn';\n";
3282
3097
print CF "\$addrbook_global_table = '$addrbook_global_table';\n";
3284
print CF "\$addrbook_global_writeable = $addrbook_global_writeable;\n\n";
3099
print CF "\$addrbook_global_writeable = $addrbook_global_writeable;\n";
3286
3101
print CF "\$addrbook_global_listing = $addrbook_global_listing;\n\n";
3288
print CF "\$no_list_for_subscribe = $no_list_for_subscribe;\n";
3291
print CF "\$smtp_auth_mech = '$smtp_auth_mech';\n";
3292
print CF "\$imap_auth_mech = '$imap_auth_mech';\n";
3294
print CF "\$use_imap_tls = $use_imap_tls;\n";
3295
print CF "\$use_smtp_tls = $use_smtp_tls;\n";
3297
print CF "\$session_name = '$session_name';\n";
3302
print CF "\$advanced_tree = $advanced_tree;\n";
3305
print CF "\$oldway = $oldway;\n";
3308
print CF "\$use_php_recode = $use_php_recode;\n";
3311
print CF "\$use_php_iconv = $use_php_iconv;\n";
3314
print CF "\@include SM_PATH . 'config/config_local.php';\n";
3103
print CF "\$no_list_for_subscribe = $no_list_for_subscribe;\n";
3106
print CF "\$smtp_auth_mech = '$smtp_auth_mech';\n";
3107
print CF "\$imap_auth_mech = '$imap_auth_mech';\n";
3109
print CF "\$use_imap_tls = $use_imap_tls;\n";
3110
print CF "\$use_smtp_tls = $use_smtp_tls;\n";
3112
print CF "\$session_name = '$session_name';\n";
3115
print CF "\@include SM_PATH . 'config/config_local.php';\n";
3317
print CF " * Make sure there are no characters after the PHP closing\n";
3318
print CF " * tag below (including newline characters and whitespace).\n";
3319
print CF " * Otherwise, that character will cause the headers to be\n";
3320
print CF " * sent and regular output to begin, which will majorly screw\n";
3321
print CF " * things up when we try to send more headers later.\n";
3118
print CF " * Make sure there are no characters after the PHP closing\n";
3119
print CF " * tag below (including newline characters and whitespace).\n";
3120
print CF " * Otherwise, that character will cause the headers to be\n";
3121
print CF " * sent and regular output to begin, which will majorly screw\n";
3122
print CF " * things up when we try to send more headers later.\n";
3327
print "Data saved in config.php\n";
3128
print "Data saved in config.php\n";
3329
3130
print "Error saving config.php: $!\n";
3562
3360
# Called by 'command112a' and 'command112b'
3563
3361
# ARGS: service-name (IMAP or SMTP), host:port, mech-name (ie. CRAM-MD5)
3567
my $service = shift;
3571
if ((!defined($service)) or (!defined($host)) or (!defined($mech))) {
3572
# Error - wrong # of args
3573
print "BAD ARGS!\n";
3577
if ($service eq 'SMTP') {
3578
$cmd = "AUTH $mech\n";
3580
} elsif ($service eq 'IMAP') {
3581
$cmd = "A01 AUTHENTICATE $mech\n";
3582
$logout = "C01 LOGOUT\n";
3584
# unknown service - whoops.
3365
my $service = shift;
3369
if ((!defined($service)) or (!defined($host)) or (!defined($mech))) {
3370
# Error - wrong # of args
3371
print "BAD ARGS!\n";
3375
if ($service eq 'SMTP') {
3376
$cmd = "AUTH $mech\r\n";
3377
$logout = "QUIT\r\n";
3378
} elsif ($service eq 'IMAP') {
3379
$cmd = "A01 AUTHENTICATE $mech\n";
3380
$logout = "C01 LOGOUT\n";
3382
# unknown service - whoops.
3588
# Get this show on the road
3386
# Get this show on the road
3589
3387
my $sock=IO::Socket::INET->new($host);
3590
3388
if (!defined($sock)) {
3591
3389
# Connect failed
3594
my $discard = <$sock>; # Server greeting/banner - who cares..
3596
if ($service eq 'SMTP') {
3598
print $sock "helo $domain\n";
3599
$discard = <$sock>; # Yeah yeah, you're happy to see me..
3603
my $response = <$sock>;
3605
if (!defined($response)) {
3609
# So at this point, we have a response, and it is (hopefully) valid.
3610
if ($service eq 'SMTP') {
3611
if (($response =~ /^535/) or ($response =~/^502/)) {
3615
} elsif ($response =~ /^503/) {
3616
#Something went wrong
3619
} elsif ($service eq 'IMAP') {
3620
if ($response =~ /^A01/) {
3626
# Unknown service - this shouldn't be able to happen.
3631
# If it gets here, the mech is supported
3632
print $sock "*\n"; # Attempt to cancel authentication
3633
print $sock $logout; # Try to log out, but we don't really care if this fails
3392
my $discard = <$sock>; # Server greeting/banner - who cares..
3394
if ($service eq 'SMTP') {
3396
print $sock "HELO $domain\r\n";
3397
$discard = <$sock>; # Yeah yeah, you're happy to see me..
3401
my $response = <$sock>;
3403
if (!defined($response)) {
3407
# So at this point, we have a response, and it is (hopefully) valid.
3408
if ($service eq 'SMTP') {
3409
if (($response =~ /^535/) or ($response =~/^502/)) {
3411
print $sock $logout;
3414
} elsif ($response =~ /^503/) {
3415
#Something went wrong
3418
} elsif ($service eq 'IMAP') {
3419
if ($response =~ /^A01/) {
3425
# Unknown service - this shouldn't be able to happen.
3430
# If it gets here, the mech is supported
3431
print $sock "*\n"; # Attempt to cancel authentication
3432
print $sock $logout; # Try to log out, but we don't really care if this fails
3638
3437
sub clear_screen() {