XMailer + Synapse smtp TLS mail in Fedora 36 x86_64 lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- reneve59 · 2022-09-22 03:05 Hi, I'm working on a project that requires to send automatically a mail to webmaster every time a specific event happens on the web server. I've developed an external web monitor in Lazarus using XMailer - Synapse packages to create and send the mail message using SMTP and TLS It works without problems under Windows 10 (64 bits) but not in Linux (Fedora 36 x86_64). Lazarus compiles the application without errors,  but when trying to send the mail the application reports an error I found the problem, it is on synapse's ssl_openssl unit (it does not find openssl version under fedora) but I do not have any idea on how to fix it. I try to find the solution in the internet without luck. Must of it is outdated Any idea?. The application : Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i unit msend_main; {$mode objfpc}{$H+} interface uses  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, Buttons,  StdCtrls, LCLType,  xmailer; type   { TForm1 }   TForm1 = class(TForm)    Bevel1: TBevel;    btn_send: TBitBtn;    btn_Exit: TBitBtn;    Label1: TLabel;    lbl_subject: TLabel;    m_message: TMemo;    m_subject: TEdit;    m_sender: TEdit;    lbl_to: TLabel;    lbl_from: TLabel;    m_recipient: TEdit;    procedure btn_ExitClick(Sender: TObject);    procedure btn_sendClick(Sender: TObject);  private   public   end; var  Form1: TForm1; implementation {$R *.lfm} { TForm1 } procedure TForm1.btn_ExitClick(Sender: TObject);begin  Close;end; procedure TForm1.btn_sendClick(Sender: TObject);var Mail : TSendMail;    emsg : string;begin  Mail := TSendMail.Create;  try    //    // Mail data section    //    Mail.Sender        :=  m_sender.Text;    Mail.Receivers.Add(m_recipient.Text);    Mail.Subject       :=  m_subject.Text;    Mail.Message.AddStrings(m_message.Lines);    //    // Authentication section    //    Mail.Smtp.UserName := 'username';    Mail.Smtp.Password := 'userpswd';    //    // Mail parameters section    //    Mail.Smtp.Host     := 'server.example.com';    Mail.Smtp.Port   := '587';    Mail.Smtp.FullSSL  := False;    Mail.Smtp.TLS      := true;    //    // Semd mail    //    try      Mail.Send;      emsg := 'Mail processed correctly';      Application.MessageBox(@emsg[1],'Mail Sent',MB_OK + MB_ICONEXCLAMATION);      except        on e : exception do               begin                 emsg := 'Error: ' + e.Message;                 Application.MessageBox(@emsg[1],'Meil Error',MB_OK + MB_ICONERROR);               end;    end;  finally    Mail.Free;  end; end; end.  [Edited to add code tags - Please use tags in future] ---------------------------------------------------------------------- reneve59 · 2022-09-22 12:40 Hi, I have found a solution and now the program runs on Fedora 36 x86_64. I share the solution in case somebody has the same problem. The solution: Xmailer tests if openssl is available using a function called IsAvailableOpenSSL (starting at line 105 of XMailer's source file) and returns True if version string is not empty. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i {$IFDEF OPEN_SSL}function IsAvailableOpenSSL: Boolean;var  VOpenSSL: TSSLOpenSSL;begin  VOpenSSL := TSSLOpenSSL.Create(nil);  try    Result := VOpenSSL.LibVersion <> '';  finally    VOpenSSL.Free;  end;end;{$ENDIF}  As I'm sure that openssl library is installed in Fedora, I  modified Xmailer's code as follows Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i function IsAvailableOpenSSL: Boolean;var  VOpenSSL: TSSLOpenSSL;begin  VOpenSSL := TSSLOpenSSL.Create(nil);  try//    Result := VOpenSSL.LibVersion <> '';    Result := True;  finally    VOpenSSL.Free;  end;end;{$ENDIF}  I rebuilt the application an now is running. ---------------------------------------------------------------------- zeljko · 2022-09-22 13:49 Fedora 36 uses openssl-3, so you should include openssl3 from synapse or install compat-openssl ---------------------------------------------------------------------- trev · 2022-09-23 14:12 [Apropos of bypassing the library version check...] The latest OpenSSL stable version is the 3.0 series which is supported until 7th September 2026. This is also a Long Term Support (LTS) version. The previous LTS version OpenSSL 1.1.1 is on life support until 11th September 2023 (at which point all support ceases, so no bug fixes for security problems) as OpenSSL moves to version 3 (now at 3.02) which has even more significant ABI changes. All older OpenSSL versions (including 1.1.0, 1.0.2, 1.0.0, 0.9.8 and 0.9.7) are now out of support, contain multiple security vulnerabilities and should not be used if you value security and your reputation. ---------------------------------------------------------------------- ThomasK · 2025-05-29 11:07 I did the same on a Raspi, it works. I failed so to use SSL3 because Xmailer is not made for it. I upgraded my old Lazarus 2.2.0 to 4 and now even SSL did not work anymore. The Raspi application works, so there is no problem with the servers. Never rouch a running system.