Re: [twsocket] Fw: TCustomSmtpClient.AuthGetType

2005-11-05 Thread Francois PIETTE
 fixed in the code below as well.

Did you test this code ? Can I simply copy it to the official source code 
and make an update ?
Have you ssen the other message from Stephane ?
btw: I asked Stephane to subscribe to the support mailing list but I'm not 
sure he can speak english :-( Until then I will relay/translate.

--
[EMAIL PROTECTED]
http://www.overbyte.be

- Original Message - 
From: Arno Garrels [EMAIL PROTECTED]
To: ICS support mailing twsocket@elists.org
Sent: Saturday, November 05, 2005 9:45 AM
Subject: Re: [twsocket] Fw: TCustomSmtpClient.AuthGetType


 DZ-Jay wrote:
 Perhaps someone can verify this bug (or
 maybe Stephane already did?)

 You and Stephane are totaly right, it has to be fixed!
 Also empty strings could have been added to FAuthTypesSupported,
 fixed in the code below as well.


 procedure TCustomSmtpClient.AuthGetType;
 var
I  : Integer;
S  : String;
aEntry : String;
 begin
{ A typical EHLO response:
250-AUTH=LOGIN CRAM-MD5 PLAIN
250-AUTH CRAM-MD5 LOGIN PLAIN  }
S := UpperCase(Trim(FLastResponse));
if Length(S)  10 then
Exit;
Delete(S, 1, 4);
if (CompareText(Copy(S, 1, 5), 'AUTH ') = 0) or
   (CompareText(Copy(S, 1, 5), 'AUTH=') = 0) then begin
S := Copy(S, 6, Length(S));
for I := 1 to Length(S) do begin
if S[I] = '=' then
S[I] := ' ';
end;
while Length(S)  0 do begin
I := Pos(' ', S);
if I = 0 then begin
aEntry := Trim(S);
if Length(aEntry)  0 then
if FAuthTypesSupported.IndexOf(aEntry) = -1 then
FAuthTypesSupported.Add(aEntry);
Break;
end
else begin
aEntry := Trim(Copy(S, 1, I - 1));
if Length(aEntry)  0 then
if FAuthTypesSupported.IndexOf(aEntry) = -1 then
FAuthTypesSupported.Add(aEntry);
Delete(S, 1, I);
end;
end;
end;
 end;
 -- 
 To unsubscribe or change your settings for TWSocket mailing list
 please goto http://www.elists.org/mailman/listinfo/twsocket
 Visit our website at http://www.overbyte.be 

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Fw: TCustomSmtpClient.AuthGetType

2005-11-04 Thread Arno Garrels
 From: Vander Clock Stephane
[..]
 I think you must replace
 S := Copy(S, 5, Length(S));
 
 by
 S := Copy(S, 6, Length(S));

I don't know why,  length of both strings is 5 not 6.

Typically the lines in question of a EHLO response look like
250-AUTH=LOGIN CRAM-MD5 PLAIN
250-AUTH CRAM-MD5 LOGIN PLAIN

---
Arno Garrels [TeamICS]
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Fw: TCustomSmtpClient.AuthGetType

2005-11-04 Thread DZ-Jay
DZ-Jay wrote:
 since the CompareText calls Copy() with an Index of 
 1, which means that it starts to delete at the second character, not to 
 mention the call to Delete() uses an Index of 1 also.

This should have been:

  which means that it starts to copy at the second character...

Sorry,
dZ.
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be