BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

SMTP qmail bare LF problem with Indy 9: 10054 Connection res

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock
View previous topic :: View next topic  
Author Message
Johannes Geyer
Guest





PostPosted: Thu Jan 13, 2005 6:41 pm    Post subject: SMTP qmail bare LF problem with Indy 9: 10054 Connection res Reply with quote



When sending some html emails to a qmail server, I received a socket error
10054 Connection reset by peer. Sometimes the qmail server sent me the
message:
451 See http://pobox.com/~djb/docs/smtplf.html
You can find here that bare LF are not allowed for SMTP.

After some debugging I found out that the problem was in the quotedprintable
encoding (Indy 9.0.18 IdCoderQuotedPrintable line 250):
if Length(Line) > 71 then
begin
NewLine;
end; //if Length(Line > 71 then

When there was a #13 character at Buffer[71] then the new line was inserted
between the #13 and #10 characters. That leaded to #13#13#10#10 which is
prohibited for SMTP. So I fixed it:
if (Length(Line) > 71) and
not(Buffer[i] in [#10,#13]) then // JG 13.01.05
begin
NewLine;
end; //if Length(Line > 71 then

Now it's working fine for me. I don't know if this problem is fixed in Indy
10.
Regards
Johannes Geyer


Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.