Tracker: Bugs

4 conf.pl detect_auth_support SMTP checks - ID: 1727033
Last Update: Comment added ( bouchon )

When detect_auth_support subroutine tests SMTP authentication, it checks
only 535, 502 and 503 error codes. According to RFC 2554 unsupported
authentication mechanisms are rejected with 504 error.

Checked conf.pl in 1.5.2svn (2007-05-28) and 1.4.10. Used hmailserver 4.4
for testing (login is supported, cram-md5 and digest-md5 are not).


Tomas Kuliavas ( tokul ) - 2007-05-28 17:52

4

Closed

Fixed

Antoine Delignat

None

None

Public


Comments ( 7 )

Date: 2007-05-30 09:48
Sender: bouchon


Fixed in SVN (stable=12423 and trunk=12424)



Date: 2007-05-30 09:48
Sender: bouchon


This bug has been resolved.

Please pull the latest version from the appropriate development
tree CVS to fix your bug.

Thank you for your help in resolving this issue.


Date: 2007-05-29 16:17
Sender: tokul


Anonymous test is in different subroutine

From line 1438 ($Id: conf.pl 12346)
----
# Check none by trying to relay to junk@microsoft.com
$host = $smtpServerAddress . ':' . $smtpPort;
my $sock = IO::Socket::INET->new($host);
print "Testing none:\t\t$WHT";
if (!defined($sock)) {
print " ERROR TESTING\n";
close $sock;
} else {
print $sock "HELO $domain\r\n";
----


Date: 2007-05-29 16:05
Sender: bouchon


In 1.5.1, the server's greeting is indeed read :

-----------8<------------- [ config.pl ]----
my $sock=IO::Socket::INET->new($host);
if (!defined($sock)) {
# Connect failed
return undef;
}
my $discard = <$sock>; # Server greeting/banner - who cares..
--------------8<----------------8<---------

Are you sure the problem exists in the 1.5.2 branch ?


Date: 2007-05-29 15:59
Sender: tokul


> I'm not sure how to fix the sync issue however. Not in perl anyway.

Read server's greeting before you issue HELO command. Code samples are
already there several lines below. Code reads other SMTP responses, but
does not read the first one.

RFC821 4.3. Sequencing of commands and replies
---
One important reply is the connection greeting. Normally, a
receiver will send a 220 "Service ready" reply when the connection
is completed. The sender should wait for this greeting message
before sending any commands.
---


Date: 2007-05-29 15:52
Sender: bouchon


You're right, the behaviour is somewhat illogical.
A possible fix would be to check for success instead of failure, because
of the wide range of possible failure codes (imagine 404 for a temporarly
unsupported mechanism).

-----------8<------------- [ config.pl ]----
# So at this point, we have a response, and it is (hopefully) valid.
if ($service eq 'SMTP') {
if (!($response =~ /^334/)) {
# Not supported
print $sock $logout;
close $sock;
return 'NO';
}
} elsif ($service eq 'IMAP') {
-------------8<----------------8<---------

I'm not sure how to fix the sync issue however. Not in perl anyway.


Date: 2007-05-28 18:45
Sender: tokul


qmail-smtp replies with '502 unimplemented (#5.5.1)'

exim replies with '503 AUTH command used when not advertised'

postfix replies with '503 5.5.1 Error: authentication not enabled'

postfix and exim terminate conf.pl on 'none' authentication test. 554
SMTP synchronization error on HELO command. test is too fast and executes
helo command without reading response from smtp server.


Attached File

No Files Currently Attached

Changes ( 5 )

Field Old Value Date By
status_id Open 2007-05-30 09:48 bouchon
resolution_id None 2007-05-30 09:48 bouchon
close_date - 2007-05-30 09:48 bouchon
priority 5 2007-05-29 15:52 bouchon
assigned_to nobody 2007-05-29 15:52 bouchon