Sendmail exception "Operation on non-blocking socket would block"

Hi,

Duplicati 2.0.5.1_beta_2020-01-18 on macOS 10.13

Sendmail config:

      {
        "Filter": "",
        "Name": "--send-mail-url",
        "Value": "smtp://smtp.mail.ru:465/?starttls=when-available",
        "Argument": null
      },
      {
        "Filter": "",
        "Name": "--send-mail-username",
        "Value": "<me>@mail.ru",
        "Argument": null
      },
      {
        "Filter": "",
        "Name": "--send-mail-password",
        "Value": "<password>",
        "Argument": null
      },
      {
        "Filter": "",
        "Name": "--send-mail-to",
        "Value": "<me>@mail.ru",
        "Argument": null
      }

Log:

2020-12-17 21:07:45 +11 - [Warning-Duplicati.Library.Modules.Builtin.ReportHelper-ReportSubmitError]: Failed to send message: System.IO.IOException: Operation on non-blocking socket would block
--> System.Net.Sockets.SocketException: Operation on non-blocking socket would block

System.IO.IOException: Operation on non-blocking socket would block ---> System.Net.Sockets.SocketException: Operation on non-blocking socket would block
  at System.Net.Sockets.Socket.Receive (System.Byte[] buffer, System.Int32 offset, System.Int32 size, System.Net.Sockets.SocketFlags socketFlags) [0x00016] in <d6a60aa59c7e453abe17968d3649bb29>:0 
  at MailKit.Net.NetworkStream.Read (System.Byte[] buffer, System.Int32 offset, System.Int32 count) [0x00000] in <044c7cb38b61487086ccf0eae49cb447>:0 
   --- End of inner exception stack trace ---
  at MailKit.Net.NetworkStream.Read (System.Byte[] buffer, System.Int32 offset, System.Int32 count) [0x0001f] in <044c7cb38b61487086ccf0eae49cb447>:0 
  at MailKit.Net.Smtp.SmtpStream.ReadAheadAsync (System.Boolean doAsync, System.Threading.CancellationToken cancellationToken) [0x0025a] in <044c7cb38b61487086ccf0eae49cb447>:0 
  at MailKit.Net.Smtp.SmtpStream.ReadResponseAsync (System.Boolean doAsync, System.Threading.CancellationToken cancellationToken) [0x000bd] in <044c7cb38b61487086ccf0eae49cb447>:0 
  at MailKit.Net.Smtp.SmtpStream.ReadResponse (System.Threading.CancellationToken cancellationToken) [0x0000e] in <044c7cb38b61487086ccf0eae49cb447>:0 
  at (wrapper remoting-invoke-with-check) MailKit.Net.Smtp.SmtpStream.ReadResponse(System.Threading.CancellationToken)
  at MailKit.Net.Smtp.SmtpClient.ConnectAsync (System.String host, System.Int32 port, MailKit.Security.SecureSocketOptions options, System.Boolean doAsync, System.Threading.CancellationToken cancellationToken) [0x0068a] in <044c7cb38b61487086ccf0eae49cb447>:0 
  at Duplicati.Library.Modules.Builtin.SendMail.SendMessage (System.String subject, System.String body) [0x00581] in <04c2b0910a9b45e2b6ef4f090eeb7063>:0 
  at Duplicati.Library.Modules.Builtin.ReportHelper.OnFinish (System.Object result) [0x00135] in <04c2b0910a9b45e2b6ef4f090eeb7063>:0 

Ideas?

Thank you

For STARTTLS you generally use port 25 or 587. The initial connection is not encrypted, but it can switch.
Port 465 is generally encrypted implicitly, so maybe the mismatched setup is producing socket confusion.

You could try smtps://smtp.mail.ru:465 or
smtp://smtp.mail.ru:587/?starttls=when-available (or always if you want to insist on encryption)

Yeah, those multipli SMTP(S) connection options ARE frustrating…
Anyway, this worked: smtp://smtp.mail.ru:587/?starttls=when-available
Thank you very much!