Re: Authorisation

Giganews Newsgroups
Subject: Re: Authorisation
Posted by:  Remy Lebeau \(Indy Team\) (
Date: Wed, 22 Apr 2009

"Mark Williams" <mark@{removethis}> wrote in message

> I am not entirely sure how I deal with different servers different
> authorisation processes.

The best option would be to set the TIdSMTP.AuthType property to satSASL and
the TIdSMTP.UseEhlo property to True, and then fill in the
TIdSMTP.SASLMechanisms property with all the various authentication
algorithms you want to support (CRAM-MD5, CRAM-SHA1, NTLM, Login, etc).
That way, TIdSMTP can negotiate with the server based on which algorithms
the server reports to TIdSMTP that it supports.

> At the moment I am only asking for the host name and assuming a
> port of 25. Is it safe to assume the port is 25.


> If it require log in then I presumably need to get my users to enter
> the username and password and to store this if they don't want to
> enter it each time.

Yes.  And then you can put them into a TIdUserPassProvider that you can hook
up to all the entries in the TIdSMTP.SASLMechanism property, so that you
only have to specify the login values in one place (the TIdSMTP.Username and
TIdSMTP.Password properties are only used when TIdSMTP.AuthType is set to

> If the authentication method is other than login is there someway I
> can generally handle this within my app

That is what the TIdSMTP.SASLMechanisms property is for.

Remy Lebeau (TeamB)


In response to

Authorisation posted by Mark Williams on Wed, 22 Apr 2009