SMTPServer -> CommandAUTH (Indy9)

Giganews Newsgroups
Subject: SMTPServer -> CommandAUTH (Indy9)
Posted by:  Stefan Bartos (s…@gmxpro.de)
Date: Tue, 16 Mar 2004

Hello together,
at first sorry for my poor english...

I'm trying to write an Mailserver for internal use. Together with the
SMTPServer-Demo i wrote a little test prog.
I tried to force / use a authentication (Mailsender was MS OE) and was a
little bit confused:

1. I can't get any (SMTPServer)-authentification method (like CommandAUTH or
CheckUser) to work (Procedure's seems never used during receiving an Mail).
How do I implement an authentification?

2. The Params for 'OnCommandAUTH' are quite different between the Demo and
the 'auto put in procedure' (doubleclicking on the event). Also the Help
doesn't match the Procedure used in the Demo. So, where is the procedure
coming from or where i can find any description?

Used code:
(the memo is only to see which procedure is used during receiving a mail
from MS OE):

...
procedure TForm1.Button1Click(Sender: TObject);
begin
IdSMTPServer.Active := true;
memo1.lines.add ('Aktive...');
idsmtpserver.AuthMode := true;
end;

procedure TForm1.IdSMTPServerCommandMAIL(const ASender: TIdCommand;
  var Accept: Boolean; EMailAddress: String);
begin
  accept := True;  // only while testing
  memo1.Lines.add('From (CmdMail): ' + EMailAddress);

end;

procedure TForm1.IdSMTPServerCommandRCPT(const ASender: TIdCommand;
  var Accept, ToForward: Boolean; EMailAddress: String;
  var CustomError: String);
begin
  memo1.Lines.add('To (CmdRcpt): ' + EMailAddress);
  accept := true; // only while testing
end;

procedure TForm1.IdSMTPServerCheckUser(ASender: TIdCommand;
  var Accept: Boolean; Username, Password: String);
begin
  // result: does'nt fire; why or when ???
  memo1.Lines.add('CkkUser');
  accept := true;
end;

procedure TForm1.IdSMTPServerCommandAUTH(AThread: TIdPeerThread;
  const CmdStr: String);
begin
  // result: does'nt fire; why or when ???
  memo1.Lines.add('CmdAuth');
end;

...

Can any one help me ???

TIA

Stefan

Replies