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 

POP3 server yet again

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





PostPosted: Sun Mar 20, 2005 8:48 pm    Post subject: POP3 server yet again Reply with quote



Hi,

this is a part of my retrieve event. It works wonderfully with Outlook
and Outlook Express. However, the Opera mailer complains about an
"unknown server response". Opera interprets the mail itself as a server
response. I cannot understand it, because it works so good with Outlook.

I also do exactly what I am supposed to do. I give the number of octets
and "OK". After that I add the mail line by line to the response. The
data is extracted from a database. I noticed that my mails never start
with the standard header, i.e. "From:" or "To:". Could that be the problem?


ASender.Reply.SetReply( OK,
Format( '%d octets', [dmMails.getMailSizeOne(aID)] ) );

body := TStringlist.Create;
body.Text := dmMails.getMail(aID);

for i := 0 to body.Count - 1 do
ASender.Response.Add( body[i] );
// I know, I could use AddStrings instead...

--
Holger
Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Sun Mar 20, 2005 10:33 pm    Post subject: Re: POP3 server yet again Reply with quote




"Holger Flick" <rammbaer.xyz (AT) xyz (DOT) gmx.de> wrote


Quote:
response. I cannot understand it, because it works so good with Outlook.

I doubt it should work, because you are not sending the response back
properly to begin with

Quote:
for i := 0 to body.Count - 1 do
ASender.Response.Add( body[i] );

You should not be using the Response property at all. That turns the OK
reply into a multi-line reply, which it is not supposed to be in the first
place. You need to send the OK reply first, THEN send the message data
afterwards. For example:

body := TStringlist.Create;
try
body.Text := dmMails.getMail(aID);

ASender.Reply.SetReply( OK, Format( '%d octets',
[dmMails.getMailSizeOne(aID)] ) );
ASender.SendReply;

// if using Indy 9:
ASender.Thread.Connection.WriteRFCStrings(body);

// if using Indy 10:
// ASender.Context.Connection.IOHandler.WriteRFCStrings(body);

finally
body.Free;
end;


Gambit



Back to top
Holger Flick
Guest





PostPosted: Mon Mar 21, 2005 12:14 am    Post subject: Re: POP3 server yet again Reply with quote



Hi Remy,

Quote:
I doubt it should work, because you are not sending the response back
properly to begin with

Thanx for your help. I have to say now that the demos are out of date
then. Because I did the exact thing the dems advised me to do :-(

I will adjust my code to yours now...

--
Holger

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.