Recent

Author Topic: Synapse mail  (Read 361 times)

ginoo

  • Full Member
  • ***
  • Posts: 141
Synapse mail
« on: November 17, 2025, 05:56:29 am »
When sending emails from Synapse to both external (libero, gmail, etc.) and internal mail servers, sometimes you get this error:
Code: Pascal  [Select][+][-]
  1. Login FAIL with error: "" 0
  2.  


The program runs on Linux. Can anyone explain it?
Thanks.

rvk

  • Hero Member
  • *****
  • Posts: 6908
Re: Synapse mail
« Reply #1 on: November 17, 2025, 12:24:13 pm »
You'll need to provide the (sample) code with which you login or send the mail.

Otherwise... consult the error logs of the server to see if there is more information.

ginoo

  • Full Member
  • ***
  • Posts: 141
Re: Synapse mail
« Reply #2 on: November 17, 2025, 04:20:50 pm »
The problem is that it works 90%, sometimes it gives the problem.

Code: Pascal  [Select][+][-]
  1. SMTP := TSMTPSend.Create;
  2. SMTP.FullSSL := True;
  3. ....
  4.      SMTP.Username := Username;
  5.      SMTP.Password := Password;
  6.  
  7. ..
  8.     if SMTP.Login then
  9.      begin
  10.        if SMTP.AuthDone then
  11.        begin
  12.          if SMTP.MailFrom(GetEmailAddr(Mime.Header.From), Length(Mime.Lines.Text)) then
  13.          begin
  14.                        SMTP.MailData(Mime.Lines);
  15.  
  16.    ....  
  17.  
  18.   smtp.Free;
  19.  
  20.  

It's the classic mail synapse code found in the wiki.

rvk

  • Hero Member
  • *****
  • Posts: 6908
Re: Synapse mail
« Reply #3 on: November 17, 2025, 05:04:18 pm »
The problem is that it works 90%, sometimes it gives the problem.
In that case you might want to log the exact full log of the interaction with the server.
(You could log SMTP.FullResult at several places for this)

It should provide a better message about the reason why login failed.

If you also have access to the log files of the internal mail server, you can look in there too.

I don't see where you provide that error message to the user. But the chances are that the error is 'gone' from the ErrorString by then. That's why you need to log it every step of the way to catch it at the correct moment.


 

TinyPortal © 2005-2018