Re: IdPOP3Server onDELE response

Giganews Newsgroups
Subject: Re: IdPOP3Server onDELE response
Posted by:  Gerrit Hulleman (hullem…@lupus-delta.tmfweb.nl)
Date: Mon, 15 Mar 2004

Found a solution:
    Not using ASender.Response, but ASender.Thread.Connection.WriteLn to
write directly to the socket.

Perhaps a note for in the help file.

"Gerrit Hulleman" <hullem…@lupus-delta.tmfweb.nl> wrote in message
news:34C2C820A895E240hullem…@lupus-delta.tmfweb.nl...
> I am running into the following problem (bug?):
> It seems like the the ondele handler adds a dubble response '.' to the
> responses. This response is send as a response to the next command, off by
> 1. (see code & output noted below). As far as I can tell, my code is fine.
> My onList works the same, no problems there. Is there a way to clear the
> response buffer (not the ASender.Response.Clear, since I allready do
that)?
> Anyone comments welcome.
>
> Also send to the bugsgeneral newgroup, cause it said so on the indy site.
> Yes, my list function is not working properly, the messages are returned
> after being deleted. Working on it.
>
> G
>
> Indy 9.00.14
>
> in the onDele event I have the following code:
> ----------------------------------
>  ASender.Response.Clear;
>  MessageArray :=
> TUser(Asender.Thread.Data).getMessageManager.getMessageDrop;
>  if (AMessageNum > 0) and (AMessageNum <= high(MessageArray)) then
>  begin
>    if not (MessageArray[AMessageNum].deleted) then
>    begin
>      ASender.Response.Add('+OK message '+inttostr(AMessageNum)+'
deleted');
>      MessageArray[AMessageNum].deleted := true;
>    end else
>      ASender.Response.Add('-ERR message '+inttostr(AMessageNum)+'
allready
> deleted');
>  end else
>      ASender.Response.Add('-ERR no such message');
> -----------------------------------
>
> When I telnet my app, the response (after logging in etc.) is:
> -----------------------------------
> dele 1
> +OK message 1 deleted
> dele 1
> .
> dele 2
> -ERR message 1 allready deleted
> dele 2
> .
> dele 2
> +OK message 2 deleted
> list
> .
> -ERR message 2 allready deleted
> .
> list
> -ERR message 2 allready deleted
> list
> .
> +OK 6 messages (7866 octets)
> 1 1311
> 2 1311
> 3 1311
> 4 1311
> 5 1311
> 6 1311
> .
> ----------------------------------

Replies

None

In response to

IdPOP3Server onDELE response posted by Gerrit Hulleman on Mon, 15 Mar 2004