findAddress() can return FALSE as well as zero
[squirrelmail.git] / config / conf.pl
index 65966aab54a3673508012b28e5415fb9b2f342c2..09e568756e1f19f65202d03d79d1462c72046ebb 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/env perl
 # conf.pl
 #
-# Copyright (c) 1999-2010 The SquirrelMail Project Team
+# Copyright (c) 1999-2012 The SquirrelMail Project Team
 # Licensed under the GNU GPL. For full terms see COPYING.
 #
 # A simple configure script to configure SquirrelMail
@@ -1525,7 +1525,7 @@ sub command112a {
 
 
 # SMTP authentication type
-# Possible choices: none, plain, cram-md5, digest-md5
+# Possible choices: none, login, plain, cram-md5, digest-md5
 sub command112b {
     if ($use_smtp_tls ne "0") {
         print "Auto-detection of login methods is unavailable when using TLS or STARTTLS.\n";
@@ -1566,6 +1566,7 @@ sub command112b {
                 print $sock "QUIT\r\n";
                 close $sock;
             }
+
             # Try login (SquirrelMail default)
             print "Testing login:\t\t";
             $tmp=detect_auth_support('SMTP',$host,'LOGIN');
@@ -1579,6 +1580,19 @@ sub command112b {
                   print $WHT . "ERROR DETECTING$NRM\n";
               }
 
+            # Try plain
+            print "Testing plain:\t\t";
+            $tmp=detect_auth_support('SMTP',$host,'PLAIN');
+            if (defined($tmp)) {
+                if ($tmp eq 'YES') {
+                    print $WHT . "SUPPORTED$NRM\n";
+                } else {
+                    print $WHT . "NOT SUPPORTED$NRM\n";
+                }
+              } else {
+                  print $WHT . "ERROR DETECTING$NRM\n";
+              }
+
             # Try CRAM-MD5
             print "Testing CRAM-MD5:\t";
             $tmp=detect_auth_support('SMTP',$host,'CRAM-MD5');
@@ -1609,12 +1623,12 @@ sub command112b {
     print "\nWhat authentication mechanism do you want to use for SMTP connections?\n";
     print $WHT . "none" . $NRM . " - Your SMTP server does not require authorization.\n";
     print $WHT . "login" . $NRM . " - Plaintext. If you can do better, you probably should.\n";
-    print $WHT . "plain" . $NRM . " - SASL PLAIN.  You already know it if you need this.\n";
+    print $WHT . "plain" . $NRM . " - SASL PLAIN. Plaintext. If you can do better, you probably should.\n";
     print $WHT . "cram-md5" . $NRM . " - Slightly better than plaintext.\n";
     print $WHT . "digest-md5" . $NRM . " - Privacy protection - better than cram-md5.\n";
     print $WHT . "\n*** YOUR SMTP SERVER MUST SUPPORT THE MECHANISM YOU CHOOSE HERE ***\n" . $NRM;
     print "If you don't understand or are unsure, you probably want \"none\"\n\n";
-    print "none, login, cram-md5, or digest-md5 [$WHT$smtp_auth_mech$NRM]: $WHT";
+    print "none, login, plain, cram-md5, or digest-md5 [$WHT$smtp_auth_mech$NRM]: $WHT";
     $inval=<STDIN>;
     chomp($inval);
     if ($inval =~ /^none\b/i) {
@@ -2574,15 +2588,15 @@ sub command311 {
 
 sub command311b {
     print "$NRM";
-    print "\n  SquirrelMail adds username information to every outgoing
-  email in order to prevent possible sender forging when users are
-  allowed to change their email and/or full name.
+    print "\n  SquirrelMail adds username information to every outgoing email in
+  order to prevent possible sender forging by users that are allowed
+  to change their email and/or full name.
 
-  You can remove user information from this header (y) if you think that
-  it violates privacy or security.
+  You can remove user information from this header (y) if you think
+  that it violates privacy or security.
 
-  Note: If users are allowed to change their email addresses,
-  this setting will make it difficult to determine who sent what where.
+  Note: If users are allowed to change their email addresses, this
+  setting will make it difficult to determine who sent what where.
   Use at your own risk.
 
   Note: If you have defined a header encryption key in your SMTP or
@@ -4096,7 +4110,7 @@ sub command91 {
     print "[$WHT$addrbook_dsn$NRM]: $WHT";
     $new_dsn = <STDIN>;
     if ( $new_dsn eq "\n" ) {
-        $new_dsn = "";
+        $new_dsn = $addrbook_dsn;
     } else {
         $new_dsn =~ s/[\r\n]//g;
         $new_dsn =~ s/^\s+$//g;
@@ -4138,7 +4152,7 @@ sub command93 {
     print "[$WHT$prefs_dsn$NRM]: $WHT";
     $new_dsn = <STDIN>;
     if ( $new_dsn eq "\n" ) {
-        $new_dsn = "";
+        $new_dsn = $prefs_dsn;
     } else {
         $new_dsn =~ s/[\r\n]//g;
         $new_dsn =~ s/^\s+$//g;
@@ -4162,9 +4176,7 @@ sub command94 {
 
 sub command95 {
     print "This is the name of the field in which you want to store the\n";
-    print "username of the person the prefs are for. It default to 'user'\n";
-    print "which clashes with a reserved keyword in PostgreSQL so this\n";
-    print "will need to be changed for that database at least\n";
+    print "username of the person the prefs are for. It defaults to 'user'\n";
     print "\n";
     print "[$WHT$prefs_user_field$NRM]: $WHT";
     $new_field = <STDIN>;
@@ -4243,7 +4255,7 @@ sub command98 {
     print "[$WHT$addrbook_global_dsn$NRM]: $WHT";
     $new_dsn = <STDIN>;
     if ( $new_dsn eq "\n" ) {
-        $new_dsn = "";
+        $new_dsn = $addrbook_global_dsn;
     } else {
         $new_dsn =~ s/[\r\n]//g;
         $new_dsn =~ s/^\s+$//g;
@@ -4629,12 +4641,12 @@ sub commandB8 {
         print "1     " . ($sm_debug_mode & 1 ? "y" : " ")
             . "      Simple debugging (PHP E_ERROR)\n";
         print "2     " . ($sm_debug_mode & 512 ? "y" : " ")
-            . "      Moderate debugging (PHP E_ALL)\n";
+            . "      Moderate debugging (PHP E_ALL without E_STRICT)\n";
         print "3     " . ($sm_debug_mode & 524288 ? "y" : " ")
-            . "      Advanced debugging (PHP E_ALL plus log errors\n";
-        print "             intentionally suppressed)\n";
+            . "      Advanced debugging (PHP E_ALL (without E_STRICT) plus\n";
+        print "             log errors intentionally suppressed)\n";
         print "4     " . ($sm_debug_mode & 536870912 ? "y" : " ")
-            . "      Strict debugging (PHP E_STRICT)\n";
+            . "      Strict debugging (PHP E_ALL and E_STRICT)\n";
         print "\n";
     
         print "SquirrelMail debug mode (0,1,2,3,4) or d when done? : $WHT";
@@ -5092,7 +5104,7 @@ sub save_data {
                 # integer
                 print CF "    'search_tree' => $ldap_search_tree[$count]";
             }
-            if ( $ldap_listing[$count] ) {
+            if ( $ldap_starttls[$count] ) {
                 print CF ",\n";
                 # boolean
                 print CF "    'starttls' => $ldap_starttls[$count]";