Hello,

I am trying to make POP3 proxy/gateway, I am working linemode ON as it
a CRLF lined protocol so its easier.

But  I  noticed  that  not  all lines are sent back to POP3 client, so
e-mail (especially the ones with attachements) get corrupted.

Each  time I go into OnDataAvailable on server-side socket I loop into
ReceiveStr()  and  call  TWSocketClient.SendStr() on client socket for
each line.

Is  there  something  wrong with this scheme do I overload the WinSock
internal  buffer  ? should I use a man-in-the-middle StringList buffer
and  when  OnDataSend  on  client side I loop SendStr un until no more
lines from StringList buffer ?

Here the actual code sample :

procedure TPOPOut.POPOutDataAvailable(Sender: TObject; ErrCode: Word);
// We get data coming from server
begin
  StringRLine := TPOPOut(sender).ReceiveStr; // Lets get the first line
  while (Length(StringRLine) > 0)
  begin
    // do the filtering part
    // ...
    // ... not yet implemented
    // ...
    // and proceed redirection
    TPOPOut(sender).POPIn.SendStr(StringRLine); // send it back to e-mail 
client side
    StringRLine := TPOPOut(sender).ReceiveStr; // let's get next line
  end;
end;


regards.

--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to