I believe this code worked by chance, redefining it from string to array and
[squirrelmail.git] / config / conf.pl
index 13b6a70ab5a3a2ecc4aacc4a3bb290334a0d7d55..2a208f121b7e0d76a3be78d689b3ee6532fd1fb7 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
@@ -5090,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]";