- Make the SMTP auth detection more RFC-compliant (send HELO, enclose
authorkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 13 Sep 2004 09:40:49 +0000 (09:40 +0000)
committerkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 13 Sep 2004 09:40:49 +0000 (09:40 +0000)
MAIL FROM and RCPT TO addresses in brackets); this makes it work better
with stricter MTA's.
- Use example.com as the example domain as per RFC 2606.

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@8062 7612ce4b-ef26-0410-bec9-ea0150e637f0

ChangeLog
config/conf.pl
config/config_default.php

index e34b72c1c27459828bc3a32a027a669d87f8208b..b93f2fe1d26fd04bd2d69940d5f08cc914b6bef1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -104,6 +104,7 @@ Version 1.5.1 -- CVS
     of a paginated view (provides fix for #1014612)
   - Added MySQL password/UNIX crypt support to mysql backend in the
     change_password plugin
     of a paginated view (provides fix for #1014612)
   - Added MySQL password/UNIX crypt support to mysql backend in the
     change_password plugin
+  - Make SMTP Authentication detection in conf.pl more RFC-compliant.
 
 Version 1.5.0
 --------------------
 
 Version 1.5.0
 --------------------
index e3eda2a223b0baf2bbe6118d1a5b9bbe51425655..73781d56c5a08dc74b86b8db427df999104eeb4a 100755 (executable)
@@ -788,7 +788,7 @@ sub command2 {
     print "    to use the default logo, use ../images/sm_logo.png\n";
     print "  - To specify a logo defined outside the SquirrelMail source tree\n";
     print "    use the absolute URL the webserver would use to include the file\n";
     print "    to use the default logo, use ../images/sm_logo.png\n";
     print "  - To specify a logo defined outside the SquirrelMail source tree\n";
     print "    use the absolute URL the webserver would use to include the file\n";
-    print "    e.g. http://some.host.com/images/mylogo.gif or /images/mylogo.jpg\n";
+    print "    e.g. http://www.example.com/images/mylogo.gif or /images/mylogo.jpg\n";
     print "\n";
     print "[$WHT$org_logo$NRM]: $WHT";
     $new_org_logo = <STDIN>;
     print "\n";
     print "[$WHT$org_logo$NRM]: $WHT";
     $new_org_logo = <STDIN>;
@@ -919,8 +919,8 @@ sub command8 {
 # domain
 sub command11 {
     print "The domain name is the suffix at the end of all email addresses.  If\n";
 # domain
 sub command11 {
     print "The domain name is the suffix at the end of all email addresses.  If\n";
-    print "for example, your email address is jdoe\@myorg.com, then your domain\n";
-    print "would be myorg.com.\n";
+    print "for example, your email address is jdoe\@example.com, then your domain\n";
+    print "would be example.com.\n";
     print "\n";
     print "[$WHT$domain$NRM]: $WHT";
     $new_domain = <STDIN>;
     print "\n";
     print "[$WHT$domain$NRM]: $WHT";
     $new_domain = <STDIN>;
@@ -1218,17 +1218,19 @@ sub command112b {
                 print " ERROR TESTING\n";
                 close $sock;
             } else {
                 print " ERROR TESTING\n";
                 close $sock;
             } else {
-                print $sock "mail from: tester\@squirrelmail.org\n";
+                print $sock "HELO $domain\r\n";
                 $got = <$sock>;  # Discard
                 $got = <$sock>;  # Discard
-                print $sock "rcpt to: junk\@microsoft.com\n";
+                print $sock "MAIL FROM:<tester\@squirrelmail.org>\r\n";
+                $got = <$sock>;  # Discard
+                print $sock "RCPT TO:<junk\@microsoft.com\r\n";
                 $got = <$sock>;  # This is the important line
                 if ($got =~ /^250\b/) {  # SMTP will relay without auth
                     print "SUPPORTED$NRM\n";
                 } else {
                   print "NOT SUPPORTED$NRM\n";
                 }
                 $got = <$sock>;  # This is the important line
                 if ($got =~ /^250\b/) {  # SMTP will relay without auth
                     print "SUPPORTED$NRM\n";
                 } else {
                   print "NOT SUPPORTED$NRM\n";
                 }
-                print $sock "rset\n";
-                print $sock "quit\n";
+                print $sock "RSET\r\n";
+                print $sock "QUIT\r\n";
                 close $sock;
             }
             # Try login (SquirrelMail default)
                 close $sock;
             }
             # Try login (SquirrelMail default)
@@ -3555,8 +3557,8 @@ sub detect_auth_support {
     }
     
     if ($service eq 'SMTP') {
     }
     
     if ($service eq 'SMTP') {
-        $cmd = "AUTH $mech\n";
-        $logout = "QUIT\n";
+        $cmd = "AUTH $mech\r\n";
+        $logout = "QUIT\r\n";
     } elsif ($service eq 'IMAP') {
         $cmd = "A01 AUTHENTICATE $mech\n";
         $logout = "C01 LOGOUT\n";
     } elsif ($service eq 'IMAP') {
         $cmd = "A01 AUTHENTICATE $mech\n";
         $logout = "C01 LOGOUT\n";
@@ -3575,7 +3577,7 @@ sub detect_auth_support {
 
     if ($service eq 'SMTP') {
         # Say hello first..
 
     if ($service eq 'SMTP') {
         # Say hello first..
-        print $sock "helo $domain\n";
+        print $sock "HELO $domain\r\n";
         $discard = <$sock>; # Yeah yeah, you're happy to see me..
     }
     print $sock $cmd;
         $discard = <$sock>; # Yeah yeah, you're happy to see me..
     }
     print $sock $cmd;
@@ -3590,6 +3592,7 @@ sub detect_auth_support {
     if ($service eq 'SMTP') {
         if (($response =~ /^535/) or ($response =~/^502/)) {
             # Not supported
     if ($service eq 'SMTP') {
         if (($response =~ /^535/) or ($response =~/^502/)) {
             # Not supported
+            print $sock $logout;
             close $sock;
             return 'NO';
         } elsif ($response =~ /^503/) {
             close $sock;
             return 'NO';
         } elsif ($response =~ /^503/) {
@@ -3599,6 +3602,7 @@ sub detect_auth_support {
     } elsif ($service eq 'IMAP') {
         if ($response =~ /^A01/) {
             # Not supported
     } elsif ($service eq 'IMAP') {
         if ($response =~ /^A01/) {
             # Not supported
+            print $sock $logout;
             close $sock;
             return 'NO';
         }
             close $sock;
             return 'NO';
         }
index 3f0cd7e94f2ddc58f871b64138e3d17db7857926..6a6676e4f214afb776f796271d1fee57d0ad11bb 100644 (file)
@@ -104,7 +104,7 @@ $provider_uri = 'http://www.squirrelmail.org/';
  * The domain part of local email addresses.
  *   This is for all messages sent out from this server.
  *   Reply address is generated by $username@$domain
  * The domain part of local email addresses.
  *   This is for all messages sent out from this server.
  *   Reply address is generated by $username@$domain
- * Example: In bob@foo.com, foo.com is the domain.
+ * Example: In bob@example.com, example.com is the domain.
  * @global string $domain
  */
 $domain = 'example.com';
  * @global string $domain
  */
 $domain = 'example.com';
@@ -945,4 +945,4 @@ $config_use_color = 2;
  * sent and regular output to begin, which will majorly screw
  * things up when we try to send more headers later.
  */
  * sent and regular output to begin, which will majorly screw
  * things up when we try to send more headers later.
  */
-?>
\ No newline at end of file
+?>