Programming => Networking and Web Programming => Topic started by: jollytall on September 04, 2021, 12:35:18 pm

Title: Sending e-mail with Indy and Sasl
Post by: jollytall on September 04, 2021, 12:35:18 pm
I am trying to use IdSMTP to send email through my own Postfix server. To relaymessages, my server requires Sasl (simple login for the time being).
So I have IdSMTP created and want to add SASLMechanisms to it. I use FPC so I need it in source code not through Object Inspector. (I found how to do it through the GUI, but not the FPC approach.
I can create an object like tIdSASLLogin.Create() but that is not added to the SMTP.SASLMechanisms collection. I can do SASLMechanisms.Add; but it is not an SASLLogin, but a generic one. How to do it properly?

Something else:
Usually what I do, when cannot figure out how to do something, is that I create a new GUI application, add the components, and see what it creates, but with this particular one I have another problem. When I add a TIdSMTP to my form and in the Object Inspector I click ... next to the SASL Mechanisms I get an error: TGlyphBitmap: Unsupported Resourcetype: XPM Resource Name: DIS_ARROWRIGHT. So I cannot learn from it either.
(I use Debian 10, Gnome)
Title: Re: Sending e-mail with Indy and Sasl
Post by: jollytall on September 05, 2021, 01:19:55 pm
The basic probem I solved:
I did not need to add any authentication, etc. It was enough that my UserName, Password were filled in. Earlier it failed NOT because not properly setting the AuthType or SASLMechanisms, or even the UserName or Password, but because I had on my server a setting allowing authentication only for TLS clients.

That I could not make work (yet) because my openssl is 1.1, while Indy does not support it yet in the main branch and I had no time to compile forks.

The error re "Unsupported resource type" is still there though. I guess it is a bug somewhere in the Component source.
TinyPortal © 2005-2018