From 5d28b77e398848e69a395a89814d5eeec6cafce6 Mon Sep 17 00:00:00 2001 From: kink Date: Mon, 13 Sep 2004 09:40:49 +0000 Subject: [PATCH] - Make the SMTP auth detection more RFC-compliant (send HELO, enclose 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 | 1 + config/conf.pl | 24 ++++++++++++++---------- config/config_default.php | 4 ++-- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index e34b72c1..b93f2fe1 100644 --- 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 + - Make SMTP Authentication detection in conf.pl more RFC-compliant. Version 1.5.0 -------------------- diff --git a/config/conf.pl b/config/conf.pl index e3eda2a2..73781d56 100755 --- a/config/conf.pl +++ b/config/conf.pl @@ -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 " 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 = ; @@ -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"; - 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 = ; @@ -1218,17 +1218,19 @@ sub command112b { print " ERROR TESTING\n"; close $sock; } else { - print $sock "mail from: tester\@squirrelmail.org\n"; + print $sock "HELO $domain\r\n"; $got = <$sock>; # Discard - print $sock "rcpt to: junk\@microsoft.com\n"; + print $sock "MAIL FROM:\r\n"; + $got = <$sock>; # Discard + print $sock "RCPT TO:; # 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) @@ -3555,8 +3557,8 @@ sub detect_auth_support { } 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"; @@ -3575,7 +3577,7 @@ sub detect_auth_support { 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; @@ -3590,6 +3592,7 @@ sub detect_auth_support { if ($service eq 'SMTP') { if (($response =~ /^535/) or ($response =~/^502/)) { # Not supported + print $sock $logout; close $sock; return 'NO'; } elsif ($response =~ /^503/) { @@ -3599,6 +3602,7 @@ sub detect_auth_support { } elsif ($service eq 'IMAP') { if ($response =~ /^A01/) { # Not supported + print $sock $logout; close $sock; return 'NO'; } diff --git a/config/config_default.php b/config/config_default.php index 3f0cd7e9..6a6676e4 100644 --- a/config/config_default.php +++ b/config/config_default.php @@ -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 - * 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'; @@ -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. */ -?> \ No newline at end of file +?> -- 2.25.1