Re: Pop3Server - Component not working?

Giganews Newsgroups
Subject: Re: Pop3Server - Component not working?
Posted by:  Markku Uttula (markku.uttu…@disconova.com)
Date: Mon, 7 Jul 2003

"Niki Bugarcici" <Neik…@web.de> wrote in message
news:4FA9C348C275E240Neik…@web.de...
> But the IdPOP3Server seems to be useless since eg. "Outlook Express"
> will close connection directly after the STAT-command.

Ok, I spent a while with this problem and here's what I figured... HTH :)

unit Unit1;

interface

uses
  Windows, Classes, IdBaseComponent, IdComponent, IdTCPServer, IdPOP3Server;

type
  TForm1 = class(TForm)
    IdPOP3Server1: TIdPOP3Server;
    procedure IdPOP3Server1CheckUser(AThread: TIdPeerThread;
      LThread: TIdPOP3ServerThread);
    procedure IdPOP3Server1STAT(ASender: TIdCommand);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.IdPOP3Server1CheckUser(AThread: TIdPeerThread;
  LThread: TIdPOP3ServerThread);
begin
  LThread.State := Trans;
end;

procedure TForm1.IdPOP3Server1STAT(ASender: TIdCommand);
begin
  ASender.Thread.Connection.WriteLN('+OK 0 0');
  // ASender.Response.Add('+OK 0 0');
  {
    THE COMMENTED LINE IS WHAT PEOPLE USUALLY DO
    AND IS THE CAUSE OF OUTLOOK EXPRESS FAILING.
  }
end;

end.

Replies

In response to

Pop3Server - Component not working? posted by Niki Bugarcici on Fri, 4 Jul 2003