Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2021-05

Dependency of OpenSSL 1.0.2 still in FPC 3.2.0 on some platforms?

44 messages · 11 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bo Berglund

I have an application which is ported from Delphi to FreePascal and will be used on Raspberry Pi (Debian based Linux).
It uses Indy10 components. Indy is installed using OnLinePackageManager in Lazarus.

The problem I have is that when I run the application it gets an exception when trying to send an email via an SSL encrypted SMTP mail server.

The exception log I have shows this:
ERROR: Exception during email send: Could not load SSL library.

When searching for this problem I found a Lazarus forum thread dealing in the same, where a openssl version clash is the reason: https://forum.lazarus.freepascal.org/index.php/topic,48974.msg354212.html#msg354212

This post states that the problem is solved in FPC 3.2.0

The core of the problem seems to be the openssl version clash...

Any ideas on how to solve this on Pi-OS Linux?

Bo Berglund Developer in Sweden
Michael Van Canneyt
to Bo Berglund
Bo Berglund wrote 16 lines
I have an application which is ported from Delphi to FreePascal and will be used on Raspberry Pi (Debian based Linux). It uses Indy10 components. Indy is installed using OnLinePackageManager in Lazarus. The problem I have is that when I run the application it gets an exception when trying to send an email via an SSL encrypted SMTP mail server. The exception log I have shows this: ERROR: Exception during email send: Could not load SSL library. When searching for this problem I found a Lazarus forum thread dealing in the same, where a openssl version clash is the reason: https://forum.lazarus.freepascal.org/index.php/topic,48974.msg354212.html#msg354212 This post states that the problem is solved in FPC 3.2.0

If you are using Indy, it is not.

The core of the problem seems to be the openssl version clash... Any ideas on how to solve this on Pi-OS Linux?

You can't. Indy does not work with openssl 1.1.
You must install an older openssl library if you wish to work with Indy.

Michael.

Nico Neumann
to Michael Van Canneyt

Indy has support for OpenSSL 1.1.1, just not officially (yet). See https://github.com/IndySockets/Indy/pull/299

Am Mi., 5. Mai 2021 um 16:38 Uhr schrieb Michael Van Canneyt via fpc-pascal :

Show quoted text 41 lines
On Wed, 5 May 2021, Bo Berglund via fpc-pascal wrote: > I have an application which is ported from Delphi to FreePascal and will be used > on Raspberry Pi (Debian based Linux). > It uses Indy10 components. Indy is installed using OnLinePackageManager in > Lazarus. > > The problem I have is that when I run the application it gets an exception when > trying to send an email via an SSL encrypted SMTP mail server. > > The exception log I have shows this: > ERROR: Exception during email send: Could not load SSL library. > > When searching for this problem I found a Lazarus forum thread dealing in the > same, where a openssl version clash is the reason: > https://forum.lazarus.freepascal.org/index.php/topic,48974.msg354212.html#msg354212 > > This post states that the problem is solved in FPC 3.2.0 If you are using Indy, it is not. > > The core of the problem seems to be the openssl version clash... > > Any ideas on how to solve this on Pi-OS Linux? You can't. Indy does not work with openssl 1.1. You must install an older openssl library if you wish to work with Indy. Michael. _______________________________________________ fpc-pascal maillist - https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Bo Berglund
to Michael Van Canneyt
Michael Van Canneyt wrote 12 lines
On Wed, 5 May 2021, Nico Neumann via fpc-pascal wrote: > Indy has support for OpenSSL 1.1.1, just not officially (yet). > See https://github.com/IndySockets/Indy/pull/299 I am aware of this. Good luck getting that to work on linux. It's a total mess and not nearly ready for production use. In the end I simply installed an older version of openssl.

Any directions on how to accomplish this?

Or is there some other way in Lazaus for Linux to add a function to send an email containing attachments (files with monitoring result data)? THe SMTP server I use requires SSL on port 465.
I have only ever used Indy for things like this.

Bo Berglund Developer in Sweden
Michael Van Canneyt
to Bo Berglund
Bo Berglund wrote 22 lines
On Wed, 5 May 2021 16:51:06 +0200 (CEST), Michael Van Canneyt via fpc-pascal wrote: > > > On Wed, 5 May 2021, Nico Neumann via fpc-pascal wrote: > >> Indy has support for OpenSSL 1.1.1, just not officially (yet). >> See https://github.com/IndySockets/Indy/pull/299 > > I am aware of this. Good luck getting that to work on linux. > It's a total mess and not nearly ready for production use. > > In the end I simply installed an older version of openssl. > Any directions on how to accomplish this? Or is there some other way in Lazaus for Linux to add a function to send an email containing attachments (files with monitoring result data)? THe SMTP server I use requires SSL on port 465. I have only ever used Indy for things like this.

Use package laz_synapse (in online package manager), unit smtpsend.

I'm using it in FPC and Delphi even today.
In general, it works a lot easier/simpler than Indy.

Unless you need some weird/outdated protocols,
I highly recommend Synapse over Indy.

Michael.

Bo Berglund
to Michael Van Canneyt
Michael Van Canneyt wrote 35 lines
On Wed, 5 May 2021, Bo Berglund via fpc-pascal wrote: > On Wed, 5 May 2021 16:51:06 +0200 (CEST), Michael Van Canneyt via fpc-pascal > wrote: > >> >> >> On Wed, 5 May 2021, Nico Neumann via fpc-pascal wrote: >> >>> Indy has support for OpenSSL 1.1.1, just not officially (yet). >>> See https://github.com/IndySockets/Indy/pull/299 >> >> I am aware of this. Good luck getting that to work on linux. >> It's a total mess and not nearly ready for production use. >> >> In the end I simply installed an older version of openssl. >> > > Any directions on how to accomplish this? > > Or is there some other way in Lazaus for Linux to add a function to send an > email containing attachments (files with monitoring result data)? > THe SMTP server I use requires SSL on port 465. > I have only ever used Indy for things like this. Use package laz_synapse (in online package manager), unit smtpsend. I'm using it in FPC and Delphi even today. In general, it works a lot easier/simpler than Indy. Unless you need some weird/outdated protocols, I highly recommend Synapse over Indy.

I had great troubles a year or so ago when I tried using some serial packages based on synapse because they brought in GUI stuff that made it impossible to compile a simple program aimed at running as a service on a server style linux box...

And this application is precisely the one I am working on now (after having replaced the LazSerial and SynSerial etc packages with a serial class I wrote myself using the FPC built-in serial unit. And using Indy10 for the networking parts since I have used that for some 20 years or so.

So only if the emailing synapse is guaranteed GUI-free can I use it.

I may even use some external program for mailing by using TProcess to run it.... But what? THere used to be something called sendmail or similar in Linux but right now I cannot see it on my boxes. And I am uncertain if it can do SSL logins and accept attachment files.

Anyway, I received a reply from Remy L concerning Indy and that there is a fix for the oipenssl version available, which he has not tested. I will try to do that test in the near future. It would (if working) require no extra coding in my application just an update of Indy10 itself. :)

Bo Berglund Developer in Sweden
Michael Van Canneyt
to Bo Berglund
Bo Berglund wrote 7 lines
> I highly recommend Synapse over Indy. > I had great troubles a year or so ago when I tried using some serial packages based on synapse because they brought in GUI stuff that made it impossible to compile a simple program aimed at running as a service on a server style linux box...

Yes, because you were using the wrong package.

If you use the correct package (laz_synapse.lpk), there will be no issue.

See e.g. here:

https://sourceforge.net/p/synalist/code/HEAD/tree/trunk/

But you can install it using the Online package manager.

In the online package manager, DO NOT use the pl_synapsevs package.

You myst use the laz_synapse (Synapse 40.1) package. It does not have GUI dependencies.

I use it myself in a headless FPC-created server running on linux, since many many years, and use it in a Delphi-created server also running on linux, so I'm very confident it works as described :-)

Michael.

Bo Berglund
to Michael Van Canneyt
Michael Van Canneyt wrote 30 lines
On Thu, 6 May 2021, Bo Berglund via fpc-pascal wrote: >> I highly recommend Synapse over Indy. >> > > I had great troubles a year or so ago when I tried using some serial packages > based on synapse because they brought in GUI stuff that made it impossible to > compile a simple program aimed at running as a service on a server style linux > box... Yes, because you were using the wrong package. If you use the correct package (laz_synapse.lpk), there will be no issue. See e.g. here: https://sourceforge.net/p/synalist/code/HEAD/tree/trunk/ But you can install it using the Online package manager. In the online package manager, DO NOT use the pl_synapsevs package. You myst use the laz_synapse (Synapse 40.1) package. It does not have GUI dependencies. I use it myself in a headless FPC-created server running on linux, since many many years, and use it in a Delphi-created server also running on linux, so I'm very confident it works as described :-) Michael.

Thanks, I will have a look!

Bo Berglund Developer in Sweden
Arne Hanssen
to Bo Berglund: On Wed, 5 May 2021 23:20:08 +0200 (CEST), Michael Van Canneyt via fpc-pascal I had great…

Den 06.05.2021 13:54, skreiv Bo Berglund via fpc-pascal:

Show quoted text 5 lines
[..] I may even use some external program for mailing by using TProcess to run it.... But what? THere used to be something called sendmail or similar in Linux but right now I cannot see it on my boxes. And I am uncertain if it can do SSL logins and accept attachment files.

There is 'msmtp':

https://marlam.de/msmtp/

If everything else fails...?

[..]
Best regards Arne Hanssen
Travis Siegel
to Bo Berglund: On Wed, 5 May 2021 23:20:08 +0200 (CEST), Michael Van Canneyt via fpc-pascal I had great…
Bo Berglund wrote 23 lines
>>> On Wed, 5 May 2021, Nico Neumann via fpc-pascal wrote: >>> >>>> Indy has support for OpenSSL 1.1.1, just not officially (yet). >>>> See https://github.com/IndySockets/Indy/pull/299 >>> >>> THe SMTP server I use requires SSL on port 465. >>> I have only ever used Indy for things like this. > Use package laz_synapse (in online package manager), unit smtpsend. > > I'm using it in FPC and Delphi even today. > In general, it works a lot easier/simpler than Indy. > > Unless you need some weird/outdated protocols, > I highly recommend Synapse over Indy. > So only if the emailing synapse is guaranteed GUI-free can I use it. I may even use some external program for mailing by using TProcess to run it.... But what? THere used to be something called sendmail or similar in Linux but right now I cannot see it on my boxes. And I am uncertain if it can do SSL logins and accept attachment files.

For some reason, sendmail has fallen out of favor, (likely because of it's conceived difficult setup), and most linux distros now use postfix, which in my opinion isn't any easier to configure, but it does allow for a wider range of options.

If you check your linux boxes, you'll probably see postfix as the mta, and it can indeed be called to transfer mail from programs. I don't have any examples of this, but the documentation says it can be done.  I don't know if there's another program application programmers use, but with some digging, you should be able to get it to work.

Bo Berglund
to Michael Van Canneyt: Yes, because you were using the wrong package. If you use the correct package…
Michael Van Canneyt wrote 24 lines
On Thu, 6 May 2021, Bo Berglund via fpc-pascal wrote: >> I highly recommend Synapse over Indy. >> > > I had great troubles a year or so ago when I tried using some serial packages > based on synapse because they brought in GUI stuff that made it impossible to > compile a simple program aimed at running as a service on a server style linux > box... Yes, because you were using the wrong package. If you use the correct package (laz_synapse.lpk), there will be no issue. See e.g. here: https://sourceforge.net/p/synalist/code/HEAD/tree/trunk/ But you can install it using the Online package manager. In the online package manager, DO NOT use the pl_synapsevs package. You myst use the laz_synapse (Synapse 40.1) package. It does not have GUI dependencies.

I have now installed Synapse 40.1 in LKazarus 2.0.12 with Fpc 3.2.0

I use it myself in a headless FPC-created server running on linux, since many many years, and use it in a Delphi-created server also running on linux, so I'm very confident it works as described :-)

I have also read your document (pdf):
http://www.freepascal.org/~michael/articles/lazmail/lazmail-en.pdf

But it seems like I still need an example showing how to enable the SSL (port
465) *without* modifying Synapse itself...
This is not mentioned there (also not mentioned are the uses entries for the example code to work...).

I found this thread in the forum stating that it is written to help for this problem:
https://forum.lazarus.freepascal.org/index.php?topic=27222.msg168067#msg168067

But the solution here seems to *modify* Synapse package code itself, which I think is a very bad idea, especially for code that needs to build on "out of the box" Lazarus installations only specifying which packages to install.

It is very strange to me.
So a working SSL SMTP sending example (with file attachments)would help a lot because my mail server demands such validation to allow sending.

Bo Berglund Developer in Sweden
Michael Van Canneyt
to Bo Berglund
Bo Berglund wrote 26 lines
I have now installed Synapse 40.1 in LKazarus 2.0.12 with Fpc 3.2.0 > I use it myself in a headless FPC-created server running on linux, since many many > years, and use it in a Delphi-created server also running on linux, so I'm very > confident it works as described :-) I have also read your document (pdf): http://www.freepascal.org/~michael/articles/lazmail/lazmail-en.pdf But it seems like I still need an example showing how to enable the SSL (port 465) *without* modifying Synapse itself... This is not mentioned there (also not mentioned are the uses entries for the example code to work...). I found this thread in the forum stating that it is written to help for this problem: https://forum.lazarus.freepascal.org/index.php?topic=27222.msg168067#msg168067 But the solution here seems to *modify* Synapse package code itself, which I think is a very bad idea, especially for code that needs to build on "out of the box" Lazarus installations only specifying which packages to install. It is very strange to me. So a working SSL SMTP sending example (with file attachments)would help a lot because my mail server demands such validation to allow sending.

You don't need to change Synapse ?

My setup is basically:

     FSMTP.TargetHost:=MailCfg.HostName;
     FSMTP.TargetPort:=IntToStr(MailCfg.Port);
     FSMTP.AutoTLS:=MailCfg.UseTLS;
     FSMTP.FullSSL:=MailCfg.FullSSL;
     FSMTP.Username:=MailCfg.SMTPUserName;
     FSMTP.Password:=MailCfg.SMTPPassword;

You need these properties:

     {:If is set to true, then upgrade to SSL/TLS mode if remote server support it.}
     property AutoTLS: Boolean read FAutoTLS Write FAutoTLS;
     {:SSL/TLS mode is used from first contact to server. Servers with full
      SSL/TLS mode usualy using non-standard TCP port!}
     property FullSSL: Boolean read FFullSSL Write FFullSSL;
That's it. From your story, it seems you just need to set
   FSMTP.TargetPort:=465;
   FSMTP.FullSSL:=True;

Michael.

Bo Berglund
to Michael Van Canneyt
Michael Van Canneyt wrote 54 lines
On Mon, 10 May 2021, Bo Berglund via fpc-pascal wrote: > > I have now installed Synapse 40.1 in LKazarus 2.0.12 with Fpc 3.2.0 > >> I use it myself in a headless FPC-created server running on linux, since many many >> years, and use it in a Delphi-created server also running on linux, so I'm very >> confident it works as described :-) > > I have also read your document (pdf): > http://www.freepascal.org/~michael/articles/lazmail/lazmail-en.pdf > > But it seems like I still need an example showing how to enable the SSL (port > 465) *without* modifying Synapse itself... > This is not mentioned there (also not mentioned are the uses entries for the > example code to work...). > > I found this thread in the forum stating that it is written to help for this > problem: > https://forum.lazarus.freepascal.org/index.php?topic=27222.msg168067#msg168067 > > But the solution here seems to *modify* Synapse package code itself, which I > think is a very bad idea, especially for code that needs to build on "out of the > box" Lazarus installations only specifying which packages to install. > > It is very strange to me. > So a working SSL SMTP sending example (with file attachments)would help a lot > because my mail server demands such validation to allow sending. You don't need to change Synapse ? My setup is basically: FSMTP.TargetHost:=MailCfg.HostName; FSMTP.TargetPort:=IntToStr(MailCfg.Port); FSMTP.AutoTLS:=MailCfg.UseTLS; FSMTP.FullSSL:=MailCfg.FullSSL; FSMTP.Username:=MailCfg.SMTPUserName; FSMTP.Password:=MailCfg.SMTPPassword; You need these properties: {:If is set to true, then upgrade to SSL/TLS mode if remote server support it.} property AutoTLS: Boolean read FAutoTLS Write FAutoTLS; {:SSL/TLS mode is used from first contact to server. Servers with full SSL/TLS mode usualy using non-standard TCP port!} property FullSSL: Boolean read FFullSSL Write FFullSSL; That's it. From your story, it seems you just need to set FSMTP.TargetPort:=465; FSMTP.FullSSL:=True;

Not so simple when you read scores of Internet pages on the subject... Maybe I am reading an old version (from 2012) of your document lazmail-en.pdf? The example I have found for the attachments handling uses a call to SendToRaw inside Synapse where I cannot get at the SSL handling (without changing the Synapse package code).

Here is where I am at now trying to make a function to send email with a plaintext message plus at least one file attachment. I started with the simple example from the wiki page and next I need to expand it with code from the pdf regarding the attachments (once tyhe plain text function works):

(*******************************************************************************
* This function is based on the examples in:
* https://wiki.freepascal.org/Synapse#Sending_email
* and
* https://www.freepascal.org/~michael/articles/lazmail/lazmail-en.pdf
********************************************************************************)
function SendSSLMail(const Subject, MailTo, MailFrom: string; Body, Attachments:
TStrings): boolean;
var
  SMTP: TSMTPSend;
begin
  SMTP:=TSMTPSend.Create;
  try
    SMTP.UserName := FSmtpUser;
    SMTP.Password := FSmtpPasswd;
    SMTP.TargetHost:= FSmtpHost;
    SMTP.TargetPort := FSmtpPort; //465
    SMTP.AutoTLS := true;
    SMTP.FullSSL:=true;
    if SMTP.Login then
    begin
      //What is happening here? 3 SMTP calls in a boolean expression?
      Result:=SMTP.MailFrom(MailFrom, Length(Body.Text)) and
         SMTP.MailTo(MailTo) and
         SMTP.MailData(Body);
      SMTP.Logout;
    end;
  finally
    SMTP.Free;
  end;
end;

Where is the actual sending of the email happening? And how do I add the attachments?

Bo Berglund Developer in Sweden
Michael Van Canneyt
to Bo Berglund: On Mon, 10 May 2021 10:08:53 +0200 (CEST), Michael Van Canneyt via fpc-pascal Not so…
Bo Berglund wrote
Not so simple when you read scores of Internet pages on the subject...

99% of what is written on internet is junk or outdated.

OK, maybe it's only 98%.

Check the synapse sources, that's all you need.
The handling of attachments is well explained on the synapse homepage/wiki.

http://www.ararat.cz/synapse/doku.php/public:howto http://www.ararat.cz/synapse/doku.php/public:howto:mimeparts

Where is the actual sending of the email happening? And how do I add the attachments?

It is explained in my article. Nothing has changed in this regard. Didn't you read the section on attachments ?

in the below, aMailData is a record with MailBody, MailHTML strings, and a list of recipients 'Recipients' and attachment filenames in Attachments.

var
   Msg: TMimeMess;
   Body,Html : TStringList;
   H,PM,P,Rel,Alt : TMimePart;
   Recips : TArray<String>;
begin
     Msg.Header.From := FSMTP.Username;
     Msg.Header.Subject:=aMailData.Subject;
     for S in Recips do
       Msg.Header.ToList.Add(S);
     if (aMailData.MailBody'') and (aMailData.MailHTMl'') then
       begin
       PM:=Msg.AddPartMultipart('mixed',Nil);
       Rel := Msg.AddPartMultipart('related', P);
       Alt := Msg.AddPartMultipart('alternative', Rel);
       P:=Alt;
       end;
     if aMailData.MailBody'' then
       begin
       Body:=TStringList.Create;
       Body.Text:=aMailData.MailBody;
       Body.WriteBOM:=False;
       Msg.AddPartText(Body,P);
     end;
     if aMailData.MailHTMl'' then
     begin
       HTML:=TStringList.Create;
       HTML.WriteBOM:=False;
       HTML.Text:=aMailData.MailHTMl;
       H:=Msg.AddPartHTML(HTML,P);
       H.ConvertCharset:=False;
       // H.EncodingCode:=ME_BASE64;
       H.EncodePart;
       H.EncodePartHeader;
     end;
     // Todo : attachments
     // Add all attachments, assume Attachments is a stringlist with
     // filenames
     For I:=0 to aMailData.Attachments.Count-1 do
        Msg.AddPartBinaryFromFile(Attachments[I],PM);
     // Compose message
     Msg.EncodeMessage;
     if not FSMTP.Login then
       Raise EDaemon.CreateFmt(SErrLoginFailed,[Fsmtp.EnhCodeString]);
     //If you successfully pass authorization to the remote server
     If Not FSMTP.AuthDone Then
       Raise EDaemon.CreateFmt(SErrLoginFailed,[Fsmtp.EnhCodeString]);
     //Send MAIL FROM SMTP command to set sender’s e-mail address.
     If Not FSMTP.MailFrom('', Length(Msg.Lines.text)) then
       Raise EDaemon.CreateFmt(SErrMailFromFailed,[Fsmtp.EnhCodeString]);
     For S in aMailData.Recipients do
       begin
       If Not FSMTP.MailTo(S) Then
         Raise EDaemon.CreateFmt(SMailtoFailed,[Fsmtp.EnhCodeString]);
       if not FSMTP.MailData(Msg.Lines) Then
         Raise EDaemon.CreateFmt(SMailDataFailed,[Fsmtp.EnhCodeString]);
       end;

The above is actual code from a program currently in production. This together with the sample from the article should be plenty to create your own code.

Michael.

Bo Berglund
to Michael Van Canneyt
Michael Van Canneyt wrote 12 lines
On Mon, 10 May 2021, Bo Berglund via fpc-pascal wrote: > > Not so simple when you read scores of Internet pages on the subject... 99% of what is written on internet is junk or outdated. OK, maybe it's only 98%. Check the synapse sources, that's all you need.

Yes it really looks like the SendToRaw, SendToEx and SendTo functions at the bottom are intended as examples...
I wonder if this is the structure elsewhere too...

Show quoted text 10 lines
The handling of attachments is well explained on the synapse homepage/wiki. http://www.ararat.cz/synapse/doku.php/public:howto http://www.ararat.cz/synapse/doku.php/public:howto:mimeparts > Where is the actual sending of the email happening? > And how do I add the attachments? It is explained in my article. Nothing has changed in this regard. Didn't you read the section on attachments ?

Yes I did but it involved calling the SendToRaw function inside Synapse at the end and therefore hiding the SMTP object where the SSL stuff has to be set...

Show quoted text 67 lines
in the below, aMailData is a record with MailBody, MailHTML strings, and a list of recipients 'Recipients' and attachment filenames in Attachments. var Msg: TMimeMess; Body,Html : TStringList; H,PM,P,Rel,Alt : TMimePart; Recips : TArray<String>; begin Msg.Header.From := FSMTP.Username; Msg.Header.Subject:=aMailData.Subject; for S in Recips do Msg.Header.ToList.Add(S); if (aMailData.MailBody'') and (aMailData.MailHTMl'') then begin PM:=Msg.AddPartMultipart('mixed',Nil); Rel := Msg.AddPartMultipart('related', P); Alt := Msg.AddPartMultipart('alternative', Rel); P:=Alt; end; if aMailData.MailBody'' then begin Body:=TStringList.Create; Body.Text:=aMailData.MailBody; Body.WriteBOM:=False; Msg.AddPartText(Body,P); end; if aMailData.MailHTMl'' then begin HTML:=TStringList.Create; HTML.WriteBOM:=False; HTML.Text:=aMailData.MailHTMl; H:=Msg.AddPartHTML(HTML,P); H.ConvertCharset:=False; // H.EncodingCode:=ME_BASE64; H.EncodePart; H.EncodePartHeader; end; // Todo : attachments // Add all attachments, assume Attachments is a stringlist with // filenames For I:=0 to aMailData.Attachments.Count-1 do Msg.AddPartBinaryFromFile(Attachments[I],PM); // Compose message Msg.EncodeMessage; if not FSMTP.Login then Raise EDaemon.CreateFmt(SErrLoginFailed,[Fsmtp.EnhCodeString]); //If you successfully pass authorization to the remote server If Not FSMTP.AuthDone Then Raise EDaemon.CreateFmt(SErrLoginFailed,[Fsmtp.EnhCodeString]); //Send MAIL FROM SMTP command to set sender’s e-mail address. If Not FSMTP.MailFrom('', Length(Msg.Lines.text)) then Raise EDaemon.CreateFmt(SErrMailFromFailed,[Fsmtp.EnhCodeString]); For S in aMailData.Recipients do begin If Not FSMTP.MailTo(S) Then Raise EDaemon.CreateFmt(SMailtoFailed,[Fsmtp.EnhCodeString]); if not FSMTP.MailData(Msg.Lines) Then Raise EDaemon.CreateFmt(SMailDataFailed,[Fsmtp.EnhCodeString]); end; The above is actual code from a program currently in production. This together with the sample from the article should be plenty to create your own code. Michael.

Thanks! Much obliged!

Seems like FSMTP is a globally available object managed somewhere else... And that is where the SSL handling is defined too. So it is set up to send a lot of emails.
In my case the mail sending is done in the end of the life of a task execution thread so it will not live on further.

Slowly wrapping my head around Synapse, never used it before. I have used Indy on Delphi since 20 years or so and continued that path on FreePascal/Lazarus. But it does not handle openssl above 1.0.2.... :(

Bo Berglund Developer in Sweden
Bo Berglund
to Bo Berglund
Bo Berglund wrote
Slowly wrapping my head around Synapse, never used it before. I have used Indy on Delphi since 20 years or so and continued that path on FreePascal/Lazarus. But it does not handle openssl above 1.0.2.... :(

I have now sent test emails successfully both from my Windows 10 PC where I test the Synapse system and an RPi4 system where I develop the server side code. (Using the exact same source code just building on Windows vs Linux)

I used the SendToRaw() example function in smtpsend as a template for my scaled down test function
It somehow found OpenSSL by itself even though I have not supplied any dll:s as needed with the Indy10 SSL emailing on Windows.
On Linux I expect it used the standard ways to find Openssl and used that.

So I will continue down this path, next thing is to supply an attachment file too...

Question on Synapse SMTP:
Is there any way Synapse will generate an exception if something goes wrong, or is the boolean Result the only way to see if something bad happened? Can one see some error message if it fails?

Bo Berglund Developer in Sweden
Bo Berglund
to Virgo Pärna: Also ssl_openssl must be in uses somewhere in program to include openssl support for…
Virgo Pärna wrote 9 lines
On Mon, 10 May 2021 10:08:53 +0200 (CEST), Michael Van Canneyt via fpc-pascal wrote: > > That's it. From your story, it seems you just need to set > FSMTP.TargetPort:=465; > FSMTP.FullSSL:=True; > Also ssl_openssl must be in uses somewhere in program to include openssl support for Synapse.

Of course, but as I said the basic mail sending is working I just have a hard time understanding how to add file attachments.
It would not have worked unless the proper uses are added to the pas file and also the laz_synapse package set as required for the project.

The only attachment example I have (from Michael) brings in mime, which I don't understand much of and the synapse docs are very hard reading too. So right now I try to read up on how to actually handle the mime object here...

And I had an additional question:

Does Synapse throw exceptions when errors happen? It does not look like that in the code I have examined so far but I have only looked in two units..

That is what Indy does so one must have try-except in order not to get a total app failure.

Bo Berglund Developer in Sweden
Unknown author
to Bo Berglund
Bo Berglund wrote 6 lines
Of course, but as I said the basic mail sending is working I just have a hard time understanding how to add file attachments. It would not have worked unless the proper uses are added to the pas file and also the laz_synapse package set as required for the project. The only attachment example I have (from Michael) brings in mime

mime encoding is the modern way of attaching binary files to email messages... we used to use uu and xx encoding... in all three cases, the bytes of the attached file are converted into 7 bit bytes for transmission... the internet, in all its glory still doesn't know how to attach files in their raw binary format... it would rather make the messages (~1/3rd) larger than to save space and speed but oh well...

FWIW: my only experience with synapse and file attachments was writing a DOS and OS/2 tool to extract all the parts of a message into separate files so they could be weeded out and only the real meat of the message used in further processing and transmission... i've not done anything with creating messages with mime in them or having attached files... only ripping them apart into their individual parts...

NOTE: No off-list assistance is given without prior approval. *Please keep mailing list traffic on the list where it belongs!*
Michael Van Canneyt
to Bo Berglund: On Mon, 10 May 2021 09:24:37 -0000 (UTC), Virgo Pärna via fpc-pascal Of course, but as I…
Bo Berglund wrote 17 lines
On Mon, 10 May 2021 09:24:37 -0000 (UTC), Virgo Pärna via fpc-pascal wrote: > On Mon, 10 May 2021 10:08:53 +0200 (CEST), Michael Van Canneyt via fpc-pascal wrote: >> >> That's it. From your story, it seems you just need to set >> FSMTP.TargetPort:=465; >> FSMTP.FullSSL:=True; >> > > Also ssl_openssl must be in uses somewhere in program to include > openssl support for Synapse. Of course, but as I said the basic mail sending is working I just have a hard time understanding how to add file attachments. It would not have worked unless the proper uses are added to the pas file and also the laz_synapse package set as required for the project.

That is always so, for every package you use out there.

The only attachment example I have (from Michael) brings in mime, which I don't understand much of and the synapse docs are very hard reading too.

I guess we have a different understanding of "hard reading", then.

Show quoted text 6 lines
So right now I try to read up on how to actually handle the mime object here... And I had an additional question: Does Synapse throw exceptions when errors happen? It does not look like that in the code I have examined so far but I have only looked in two units..

Yes, it does.

You should always assume exceptions. Maybe synapse itself does not throw one, but e.g. underlying file IO routines might.

Michael.

Jean SUZINEAU
to Bo Berglund: On Mon, 10 May 2021 09:24:37 -0000 (UTC), Virgo Pärna via fpc-pascal Of course, but as I…

I do not guarantee anything, I didn't use this recently, but I have a function for sending mail with attachments using Synapse.

It's the function MailTo_SMTP in this unit :
https://github.com/jsuzineau/pascal_o_r_mapping/blob/master/pascal_o_r_mapping/3_Data/uMailTo.pas (my code is under LGPL, you can extract and reuse freely)

Normally the version of Synapse used in this code is here : https://github.com/jsuzineau/pascal_o_r_mapping/tree/master/pascal_o_r_mapping/7_sources_externes/synapse

Bo Berglund
to Michael Van Canneyt: That is always so, for every package you use out there. I guess we have a different…
Michael Van Canneyt wrote 6 lines
> The only attachment example I have (from Michael) brings in mime, which I don't > understand much of and the synapse docs are very hard reading too. I guess we have a different understanding of "hard reading", then. > So right now I try to read up on how to actually handle the mime object here...

I found more reading and now I am a bit confused again: When using MIME, why do you need to also set the recipient, sender etc for the SMTP object when it is already part of the MIME object? Or does SMTP discard its own properties if a MIME package comes along?

Bo Berglund Developer in Sweden
gebylist
to Bo Berglund

Dne 13.05.2021 v 12:38 Bo Berglund via fpc-pascal napsal(a):

Show quoted text 5 lines
I found more reading and now I am a bit confused again: When using MIME, why do you need to also set the recipient, sender etc for the SMTP object when it is already part of the MIME object? Or does SMTP discard its own properties if a MIME package comes along?

Because MIME and SMTP is not same. Synapse's MimePart just get RFC2822 raw plaintext and decompose it into tree object structure representing MIME parts. And/or compose it back to plaintext. But where you got mail raw plaintext? SMTP, IMAP4, POP3, database, file,... (you can use it for HTTP forms too!)

So, SMTP is just one of many options. MIME is independent.

SMTP deliver messages by SMTP envelope, it ignoring message headers. Look at for any raw message from this conference. You are not written as recepient in "To" header, however you got it. You have been written as recepient in SMTP envelope only, not in message text.

Lukas.

Michael Van Canneyt
to Bo Berglund: On Wed, 12 May 2021 12:42:14 +0200 (CEST), Michael Van Canneyt via fpc-pascal I found…
Bo Berglund wrote 13 lines
On Wed, 12 May 2021 12:42:14 +0200 (CEST), Michael Van Canneyt via fpc-pascal wrote: >> The only attachment example I have (from Michael) brings in mime, which I don't >> understand much of and the synapse docs are very hard reading too. > > I guess we have a different understanding of "hard reading", then. > >> So right now I try to read up on how to actually handle the mime object here... I found more reading and now I am a bit confused again: When using MIME, why do you need to also set the recipient, sender etc for the SMTP object when it is already part of the MIME object?

Recipient and sender are part of the SMTP protocol.

But they are totally independent from the headers that can appear in the message. This is how lots of people are caught with phishing.

Or does SMTP discard its own properties if a MIME package comes along?

No, it does not.

Just set both.

Michael.

Bo Berglund
to Michael Van Canneyt: That is always so, for every package you use out there. I guess we have a different…
Michael Van Canneyt wrote 12 lines
> So right now I try to read up on how to actually handle the mime object here... > > And I had an additional question: > > Does Synapse throw exceptions when errors happen? It does not look like that in > the code I have examined so far but I have only looked in two units.. Yes, it does. You should always assume exceptions. Maybe synapse itself does not throw one, but e.g. underlying file IO routines might.

So I have succeeded in sending a zip file as attachment using Synapse code snippets from your pdf and also the smtp source examples.

However, when I send to 3 of my email addresses (one To and two Cc addresses) I get the email only to one of them. It does not matter if I place that address first or in the middle of the address list, it will get the email in any case.

But the two other accounts (my company email managed by Google and my private Gmail) do not get the messages.

Apart from reordering the 3 mail addresses I have also tried to replace the attached zipfile with another non-zip binary file, and then the emails to Gmail accounts are received.

This is baffling and makes it hard to move on. Our monitoring system packages measured data into a zipfile in order for it to be reduced in size and because the data set consists of several files which need to be together.

Is there some kind of blocking for emails with zip attachments which stops them from being delivered to GMail accounts?

If so, is there some other type of compressed format I can use which is allowed by GMail?

Bo Berglund Developer in Sweden
Tomas Hajny
to Bo Berglund
Bo Berglund wrote 53 lines
On Wed, 12 May 2021 12:42:14 +0200 (CEST), Michael Van Canneyt via fpc-pascal wrote: >> So right now I try to read up on how to actually handle the mime >> object here... >> >> And I had an additional question: >> >> Does Synapse throw exceptions when errors happen? It does not look >> like that in >> the code I have examined so far but I have only looked in two units.. > > Yes, it does. > > You should always assume exceptions. Maybe synapse itself does not > throw > one, but e.g. underlying file IO routines might. > So I have succeeded in sending a zip file as attachment using Synapse code snippets from your pdf and also the smtp source examples. However, when I send to 3 of my email addresses (one To and two Cc addresses) I get the email only to one of them. It does not matter if I place that address first or in the middle of the address list, it will get the email in any case. But the two other accounts (my company email managed by Google and my private Gmail) do not get the messages. Apart from reordering the 3 mail addresses I have also tried to replace the attached zipfile with another non-zip binary file, and then the emails to Gmail accounts are received. This is baffling and makes it hard to move on. Our monitoring system packages measured data into a zipfile in order for it to be reduced in size and because the data set consists of several files which need to be together. Is there some kind of blocking for emails with zip attachments which stops them from being delivered to GMail accounts? If so, is there some other type of compressed format I can use which is allowed by GMail?

Probably a silly question, but have you checked the Spam folder in GMail? In general, you can certainly send ZIP files to GMail. Also, what was the size of those attachments? The e-mail used as sender address didn't get any SMTP error message, did it? Personally, I'd guess for some other difference in your sending apart from the attachment type.

Tomas

Bo Berglund
to Tomas Hajny
Tomas Hajny wrote 13 lines
> Is there some kind of blocking for emails with zip attachments which > stops them > from being delivered to GMail accounts? > > If so, is there some other type of compressed format I can use which > is allowed > by GMail? Probably a silly question, but have you checked the Spam folder in GMail? In general, you can certainly send ZIP files to GMail. Also, what was the size of those attachments? The e-mail used as sender address didn't get any SMTP error message, did it? Personally, I'd guess for some other difference in your sending apart from the attachment type.

It is not a size problem, the test mail contains just a very small zipfile sample (5 kb in size).
And the mail is not in the spam folder either, it is simply silently rejected by GMail... No error message.

It turns out that GMail inspects the *content* of the zipfile and if it discovers "dangerous" constituent files it blocks delivery altogether. https://support.google.com/mail/answer/6590?hl=en#zippy=%2Cmessages-that-have-attachments%2Cmessages-that-dont-have-attachments

In my case there is a small text file inside named <something>.cmd which is NOT a Windows command file (similar to a batch file) but a file with a set of equipment commands and geometry information....

So I tested by changing the extension from .cmd to ,cmd.txt and then delivery started working...
So now I have to modify the automatic server so it will rename this particular file using a different extension.
But that is easier than dealing with the OpenSSL incompatibility of Indy10 in any case.

Bo Berglund Developer in Sweden
Michael Van Canneyt
to Bo Berglund
Bo Berglund wrote 20 lines
It is not a size problem, the test mail contains just a very small zipfile sample (5 kb in size). And the mail is not in the spam folder either, it is simply silently rejected by GMail... No error message. It turns out that GMail inspects the *content* of the zipfile and if it discovers "dangerous" constituent files it blocks delivery altogether. https://support.google.com/mail/answer/6590?hl=en#zippy=%2Cmessages-that-have-attachments%2Cmessages-that-dont-have-attachments In my case there is a small text file inside named <something>.cmd which is NOT a Windows command file (similar to a batch file) but a file with a set of equipment commands and geometry information.... So I tested by changing the extension from .cmd to ,cmd.txt and then delivery started working... So now I have to modify the automatic server so it will rename this particular file using a different extension. But that is easier than dealing with the OpenSSL incompatibility of Indy10 in any case.

Glad you got it working.

I worked for some time for a mass mailing company.

From that experience I assure you that delivering mail is NOT easy.

Meanwhile, there are a lot of safety mechanisms installed on all "big" mail platforms, and getting a mail delivered becomes more and more difficult.

Michael.

Bo Berglund
to Michael Van Canneyt
Michael Van Canneyt wrote 7 lines
Glad you got it working. I worked for some time for a mass mailing company. From that experience I assure you that delivering mail is NOT easy. Meanwhile, there are a lot of safety mechanisms installed on all "big" mail platforms, and getting a mail delivered becomes more and more difficult.

Well, after a few more tests two of my test recipients again did not receive the emails. Both are handled by GMail (of course). Now the reason is that GMail determined that the recipient had gotten too many "similar" emails so it stopped accepting them.
And I also saw that it is getting suspicious of the "non-validated" sender...

All of this is a PITA since I am working on porting an automatic environment monitoring system from Delphi to FreePascal and Linux. Here the results will be emailed packaged in a zipfile several times a day to a few recipients and it is not acceptable that the recipient's mail server blocks these emails.

The body of the message is fixed at the moment, I could add a timestamp string to it but not much more to make it "new" every time. ... :(

Bo Berglund Developer in Sweden
Michael Van Canneyt
to Bo Berglund
Bo Berglund wrote 21 lines
On Sat, 15 May 2021 09:00:08 +0200 (CEST), Michael Van Canneyt via fpc-pascal wrote: > Glad you got it working. > > I worked for some time for a mass mailing company. > From that experience I assure you that delivering mail is NOT easy. > > Meanwhile, there are a lot of safety mechanisms installed on all "big" mail > platforms, and getting a mail delivered becomes more and more difficult. Well, after a few more tests two of my test recipients again did not receive the emails. Both are handled by GMail (of course). Now the reason is that GMail determined that the recipient had gotten too many "similar" emails so it stopped accepting them. And I also saw that it is getting suspicious of the "non-validated" sender... All of this is a PITA since I am working on porting an automatic environment monitoring system from Delphi to FreePascal and Linux. Here the results will be emailed packaged in a zipfile several times a day to a few recipients and it is not acceptable that the recipient's mail server blocks these emails.

Welcome to the world of mailing.
I wish I could say it gets better, but it does not.

The body of the message is fixed at the moment, I could add a timestamp string to it but not much more to make it "new" every time. ... :(

It might be better not to mail this, but to upload results to a server using http, which puts everything in a database, and make a small frontend for your database.

Michael.

Bo Berglund
to Michael Van Canneyt
Michael Van Canneyt wrote 10 lines
Welcome to the world of mailing. I wish I could say it gets better, but it does not. > > The body of the message is fixed at the moment, I could add a timestamp string > to it but not much more to make it "new" every time. > ... :( It might be better not to mail this, but to upload results to a server using http, which puts everything in a database, and make a small frontend for your database.

Well, then we would have to supply a website too...

Bo Berglund Developer in Sweden
Bo Berglund
to Michael Van Canneyt: Glad you got it working. I worked for some time for a mass mailing company. Meanwhile,…
Michael Van Canneyt wrote 10 lines
Glad you got it working. I worked for some time for a mass mailing company. From that experience I assure you that delivering mail is NOT easy. Meanwhile, there are a lot of safety mechanisms installed on all "big" mail platforms, and getting a mail delivered becomes more and more difficult. Michael.

Well, now I got stuck again...
I did all of my code testing on Windows because that is my normal environment.

When all was done I had created a mailsupport unit encapsulating the stuff I need for my emailings and I used that in a command line mailer to verify that everything worked OK.
Which it did on Windows except for some fussy mailservers who would not receive the emails (my GMail account), but the email was in any case sent.

But then when I moved to Linux (on Raspberry Pi3) I always got errors on mail send. So no outgoing email.

So I have now finally traced the execution using the Lazarus debugger and it seems like Synapse does not connect using SSL after all.. :(

I have set it up as well as I have understood the documentation with the smtp switches for SSL and TLS active (set to true) and the port and user is set as on Windows (after all I copied the source files over to the Linux box and opened the project in Lazarus over there). The test emailer has all of the logon etc info built into the executable (just for testing of course) but failed.

So when I single-step in the code I reach the following location after starting on SMTP.Connect:

function TSMTPSend.Connect: Boolean;
begin
  FSock.CloseSocket;
  FSock.Bind(FIPInterface, cAnyPort);
  if FSock.LastError = 0 then
    FSock.Connect(FTargetHost, FTargetPort);
  if FSock.LastError = 0 then
    if FFullSSL then
      FSock.SSLDoConnect;  //<= I get to here
  Result := FSock.LastError = 0;
end;
procedure TTCPBlockSocket.SSLDoConnect;
begin
  ResetLastError;
  if not FSSL.Connect then  //<=This goes to no action....
    FLastError := WSASYSNOTREADY;
  ExceptCheck;
end;
function TCustomSSL.Connect: boolean; //<= To here!
begin
  ReturnError;
  Result := False;
end;

Then I traced over into the ExceptCheck function:

procedure TBlockSocket.ExceptCheck;
var
  e: ESynapseError;
begin
  FLastErrorDesc := GetErrorDescEx;  // <== HERE
  if (LastError  0) and (LastError  WSAEINPROGRESS)
    and (LastError  WSAEWOULDBLOCK) then
  begin
    DoStatus(HR_Error, IntToStr(FLastError) + ',' + FLastErrorDesc);
    if FRaiseExcept then
    begin
      e := ESynapseError.Create(Format('Synapse TCP/IP Socket error %d: %s',
        [FLastError, FLastErrorDesc]));
      e.ErrorCode := FLastError;
      e.ErrorMessage := FLastErrorDesc;
      raise e;
    end;
  end;
end;

FLastErrorDesc gets set to "SSL/TLS support is not compiled"

So now I do not know what to do, is this indicating that I need to change some Synapse config to get it working or is it a platform problem (Linux)???

What could I do in order to make SSL/TLS support "compiled" In the documentation
http://www.ararat.cz/synapse/doku.php/public:howto:sslplugin

they write:
First you must explicitly select what plugin you wish to use. You can do it simply by adding unit with SSL plugin to your project sources. You can add only one from SSL plugins in one project! When you wish to use OpenSSL, then add /ssl_openssl/ to your project uses, for example.

And that is what I have done, it is listed in uses of my mailsupport source file as:
uses
Classes,
SysUtils,
smtpsend,
ssl_openssl, //<= Here
synautil,
mimemess,

  mimepart;

Yet it is "not compiled"...

Very confusing.

Bo Berglund Developer in Sweden
gebylist
to Bo Berglund

Dne 17.05.2021 v 22:06 Bo Berglund via fpc-pascal napsal(a):

Show quoted text 16 lines
And that is what I have done, it is listed in uses of my mailsupport source file as: uses Classes, SysUtils, smtpsend, ssl_openssl, //<= Here synautil, mimemess, mimepart; Yet it is "not compiled"... Very confusing.

It is because loading of ssl_openssl plugin failed. Have you installed OpenSSL libraries on your RPi?

Check function |InitSSLinterface in ssl_openssl_lib unit. I personally never test ssl_openssl on RPi, maybe some error is here.|

|Lukas.
|

Bo Berglund
to gebylist
gebylist wrote 19 lines
?Dne 17.05.2021 v 22:06 Bo Berglund via fpc-pascal napsal(a): > > And that is what I have done, it is listed in uses of my mailsupport source file > as: > uses > Classes, > SysUtils, > smtpsend, > ssl_openssl, //<= Here > synautil, > mimemess, > mimepart; > > Yet it is "not compiled"... > > Very confusing. > It is because loading of ssl_openssl plugin failed. Have you installed OpenSSL libraries on your RPi?

How is that done?
Is not openssl part of the Debian and derivatives Linux distros?

Well, I Googled and found a suggested remedy:
sudo apt install libssl-dev

After this was done I ran the exact same code in Lazarus debugger and this time it got through and the emails were delivered!

Check function |InitSSLinterface in ssl_openssl_lib unit. I personally never test ssl_openssl on RPi, maybe some error is here.|

Follow-on question:
Do I have to install dev packages like this on the target system as well (one where the application is not going to be built on?

Or is it only needed to be on the *development* system?

Bo Berglund Developer in Sweden
Michael Van Canneyt
to Bo Berglund
Bo Berglund wrote 41 lines
On Mon, 17 May 2021 23:20:16 +0200, gebylist via fpc-pascal wrote: > ?Dne 17.05.2021 v 22:06 Bo Berglund via fpc-pascal napsal(a): >> >> And that is what I have done, it is listed in uses of my mailsupport source file >> as: >> uses >> Classes, >> SysUtils, >> smtpsend, >> ssl_openssl, //<= Here >> synautil, >> mimemess, >> mimepart; >> >> Yet it is "not compiled"... >> >> Very confusing. >> > It is because loading of ssl_openssl plugin failed. Have you installed > OpenSSL libraries on your RPi? How is that done? Is not openssl part of the Debian and derivatives Linux distros? Well, I Googled and found a suggested remedy: sudo apt install libssl-dev After this was done I ran the exact same code in Lazarus debugger and this time it got through and the emails were delivered! > Check function |InitSSLinterface in ssl_openssl_lib unit. I personally > never test ssl_openssl on RPi, maybe some error is here.| > Follow-on question: Do I have to install dev packages like this on the target system as well (one where the application is not going to be built on? Or is it only needed to be on the *development* system?

It is always needed.

Basically, this package installs a symlink from libssl.so to libssl.so.x.y.z;
you can make this symlink yourself if you prefer.

Michael.

Travis Siegel
to Bo Berglund: On Mon, 17 May 2021 23:20:16 +0200, gebylist via fpc-pascal How is that done? Is not…

The -dev part of the package is necessary for the headers used for compiling, any target system running the finished product will not require the -dev version of the packages to be installed, since they won't be using the header files directly.

Bo Berglund wrote 40 lines
On Mon, 17 May 2021 23:20:16 +0200, gebylist via fpc-pascal wrote: > ?Dne 17.05.2021 v 22:06 Bo Berglund via fpc-pascal napsal(a): >> And that is what I have done, it is listed in uses of my mailsupport source file >> as: >> uses >> Classes, >> SysUtils, >> smtpsend, >> ssl_openssl, //<= Here >> synautil, >> mimemess, >> mimepart; >> >> Yet it is "not compiled"... >> >> Very confusing. >> > It is because loading of ssl_openssl plugin failed. Have you installed > OpenSSL libraries on your RPi? How is that done? Is not openssl part of the Debian and derivatives Linux distros? Well, I Googled and found a suggested remedy: sudo apt install libssl-dev After this was done I ran the exact same code in Lazarus debugger and this time it got through and the emails were delivered! > Check function |InitSSLinterface in ssl_openssl_lib unit. I personally > never test ssl_openssl on RPi, maybe some error is here.| > Follow-on question: Do I have to install dev packages like this on the target system as well (one where the application is not going to be built on? Or is it only needed to be on the *development* system?
Michael Van Canneyt
to Travis Siegel
Travis Siegel wrote
The -dev part of the package is necessary for the headers used for compiling, any target system running the finished product will not require the -dev version of the packages to be installed, since they won't be using the header files directly.

This is not correct for synapse. The name of the library that synapse loads (it loads dynamically) is the dev name (.so), without version number.

Michael.

Bo Berglund
to Michael Van Canneyt: It is always needed. Basically, this package installs a symlink from libssl.so to…
Michael Van Canneyt wrote 11 lines
> Follow-on question: > Do I have to install dev packages like this on the target system as well (one > where the application is not going to be built on? > > Or is it only needed to be on the *development* system? It is always needed. Basically, this package installs a symlink from libssl.so to libssl.so.x.y.z; you can make this symlink yourself if you prefer.

So if I don't install the dev stuff the libssl.so is not present but the libssl.so.1.1 is.

I tried find it below /usr:

$ find /usr/ -name libssl*
/usr/lib/arm-linux-gnueabihf/libssl.a
/usr/lib/arm-linux-gnueabihf/libssl.so #<== here! /usr/lib/arm-linux-gnueabihf/libssl.so.1.1 #<== here! /usr/lib/arm-linux-gnueabihf/pkgconfig/libssl.pc
/usr/lib/arm-linux-gnueabihf/libssl3.so
/usr/share/doc/libssl1.1
/usr/share/doc/libssl-dev

And then:

$ ll /usr/lib/arm-linux-gnueabihf/libssl.so
lrwxrwxrwx 1 root root 13 2021-03-25 11:22
/usr/lib/arm-linux-gnueabihf/libssl.so -> libssl.so.1.1 #<== here!

I have now checked that this link is not present on an RPi3 where the dev package is not installed. So I guess I have to make a note about this too.

Bo Berglund Developer in Sweden
Bo Berglund
Dennis Lee Bieber wrote
Okay, slipping in late and you may have solved your problem by now but...

Yes, I ditched Indy10 for smtp emailing and instead used Synapse 40.1 from the OnLinePackageManager in Lazarus.
Took a while to understand how it worked but then I could finish the report emailing part of the application.

Bo Berglund Developer in Sweden
gebylist
to Bo Berglund

Dne 05.06.2021 v 22:04 Bo Berglund via fpc-pascal napsal(a):

Yes, I ditched Indy10 for smtp emailing and instead used Synapse 40.1 from the OnLinePackageManager in Lazarus.

I am not sure what is mean by "Synapse 40.1" and how OnlinePackageManager working, because Synapse itself leave this numbering before years and most recent version of Synapse is available on SVN only. And this most recent version have new SSL plugin called ssl_openssl11 with support for OpenSSL 1.1.1.

Remark: Synapse is not component and not need to be installed by OnlinePakageManager/GetIt in Lazarus/Delphi. Just place Synapse's sources somewhere, where your project "see it".

Lukas

Bo Berglund
to gebylist
gebylist wrote 5 lines
?Dne 05.06.2021 v 22:04 Bo Berglund via fpc-pascal napsal(a): > Yes, I ditched Indy10 for smtp emailing and instead used Synapse 40.1 > from the OnLinePackageManager in Lazarus. I am not sure what is mean by "Synapse 40.1" and how

This is a package containing networking objects

OnlinePackageManager working, because Synapse itself leave this

I use Lazarus as my dev IDE and in Lazarus menu:
Package/OnLinePackageManager you can select from a number of available packages that are not installed by default. Here you will find Synapse 40.1, which is what I referred to.

numbering before years and most recent version of Synapse is available on SVN only. And this most recent version have new SSL plugin called ssl_openssl11 with support for OpenSSL 1.1.1.

The OLPM version has SSL support that works well in Linux. I don't care much for Windows where I suppose you need to get some dll files too. In Linux openssl is nearly always available and works without any extra coding.

Remark: Synapse is not component and not need to be installed by OnlinePakageManager/GetIt in Lazarus/Delphi. Just place Synapse's sources somewhere, where your project "see it".

As I stated it is not installed by default (as a package) but available in a very simple way through OnLine PackageManager.
OLPM can "install" any package and if it has GUI components it will also compile that into Lazarus. Not needed for Synapse.

Bo Berglund Developer in Sweden