 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Holger Flick Guest
|
Posted: Sun Mar 20, 2005 8:48 pm Post subject: POP3 server yet again |
|
|
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
|
Posted: Sun Mar 20, 2005 10:33 pm Post subject: Re: POP3 server yet again |
|
|
"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
|
Posted: Mon Mar 21, 2005 12:14 am Post subject: Re: POP3 server yet again |
|
|
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 |
|
 |
|
|
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
|
|