Re: IdMappedPOP3 bugged?

Giganews Newsgroups
Subject: Re: IdMappedPOP3 bugged?
Posted by:  Remy Lebeau (TeamB) (gambit…
Date: Thu, 31 Jul 2003

"Joe Cocker" <j…> wrote in message

> I tried to use the CommandHandlers, which worked fine
> with IdPOP3Server, but they seem to be ignored with
> IdMappedPOP3.

CommandsHandlers are not used for the TIdMapped... components.

> I also tried to listen to the OnOutboundData event,
> this works but it doesn't tell me which command was
> triggered, so I don't know if it's a RETR or not.

OnOutboundData is raw data being transmitted by the original client.  You
have to parse the data manually.  Even then, it is not guaranteed to be
complete packets each time, either, so you may have to implement your own
caching system.  However, that will not allow you to prevent the original
data from being sent to the destination server as-is, unless you block the
event handler from returning control back to the TIdMapped... component, in
which case you will have to read the socket manually until your cache
contains a full command, then parse the data and adjust the thread's NetData
property to reflect the new data before then returning control back to the

> OnBeforeCommand and OnAfterCommand are also
> completely ignored, and so is OnNoCommandHandler.

Again, because CommandHandlers are not being used at all.

> 1. How to detect which command was called by the user
> in the OnOutboundData event? (or any other alternative)

Parse the data manually.

Otherwise, I would suggest not using TIdMappedPop3, but instead use
TIdPop3Server instead.  That way, you get all of the parsing done for you,
and then you can use a separate TIdPop3 to relay the parsed commands to the
real server.

> 2. How to change the output before it reaches the client?
> (Would changing NetData be alright?)

Yes.  NetData is what is sent to the server



In response to

IdMappedPOP3 bugged? posted by Joe Cocker on Thu, 31 Jul 2003