|Subject:||Re: How to reply an Error if authentication fails in IdSMTPServer.CheckUser|
|Posted by:||Remy Lebeau (TeamB) (email@example.com)|
|Date:||Tue, 30 Mar 2004|
"Stefan Bartos" <OGKarot…@gmxpro.de.net> wrote in message
> i like to send a response to the Mailclient, if the authentication
> in SMTPServer.CheckUser fails.
You simply set the Accept parameter to false. TIdSMTPServer will send the
response for you automatically after the event handler returns.
> I've tried to set 'Accept' to false if the User is not in my database,
> but all what was happened, is that the Client (MS OE) pops up
> an Login Dialog and if the Pw is incorrect again, it's popsup again
> (and again and again and again...)
That is an issue with OE, not Indy. both Indy and OE are doing exactly what
they are supposed to be doing. Indy is sending login failures, and OE is
simply looping the login until it finally succeeds or the user cancels.
> I've also tried to set 'Accept' in onCommandMAIL to the same Value
> as 'Accept' in .CheckUser. But it is the same as described above. Only
> when i set 'Accept' in .CheckUser to false (even if User/Pw is correct)
> then i get an negative response over commandMAIL, but this one say's:
> '500 xxx Address Error' and not 'authentication failed'.
OnCommandMAIL has nothing to do with login authentication. The user is
already authenticated by that time. The OnCommandMAIL event is for deciding
whether a particular message can be accepted for transmission. The error
you are seeing is the correct error - the OnCommandMAIL event is either
accepting or rejecting the sender's email address, thus if rejected then the
error message indicates the address failed.
How to reply an Error if authentication fails in IdSMTPServer.CheckUser posted by Stefan Bartos on Tue, 30 Mar 2004