Trouble at setting up email notifications

I’m trying to set up email notifications, but for some reason unknown to me I’m failing. This are my settings (anonymized, don’t worry), I extracted all data from my Outlook settings:
–send-mail-from=name@domain.es
–send-mail-url=smtp://smtp.domain.es:465
–send-mail-password=MyP4ssw0rd
–send-mail-subject=%PARSEDRESULT%: Duplicati %OPERATIONNAME% report for %backup-name%
–send-mail-level=Success,Warning,Error,Fatal
–send-mail-to=name@domain.es
–send-mail-body=%RESULT%

You can see this is the exact same settings Outlook has configured (changed domain, adress and password for the screenshot, don’t worry about it):


However when a backup is run, I get a warning message:
2021-11-05 10:47:52 +01 - [Warning-Duplicati.Library.Modules.Builtin.ReportHelper-ReportSubmitError]: Failed to send message: MailKit.Net.Smtp.SmtpProtocolException: The SMTP server has unexpectedly disconnected.
image

I’ve checked and this happens everytime, however I can send emails without any problem from Outlook, What am I missing here?

It’s probably trying to use a non-SSL connection. Try setting this to:

--send-mail-url=smtps://smtp.domain.es

“smtps” tells it to use SSL, and it will use port 465 automatically so no need to specify it.

@drwtsn32 I got the similar problem. When setting the smtp like you suggested I get this error:

2021-11-09 12:20:00 +01 - [Warning-Duplicati.Library.Modules.Builtin.ReportHelper-ReportSubmitError]: Fehler beim Senden der Nachricht: MailKit.Net.Smtp.SmtpCommandException: 5.7.1 <unknown[87.122.241.64]:12744>: Client host rejected: Access denied

To me it seems the mailserver is connecting but refuses to accept the unknown client. Mailhost ist mailbox.org

Not all mail services allow you to submit mail via SMTP. Does your mailbox.org account allow regular client applications (like Outlook, Thunderbird, etc) to send mail via SMTP? If they do, they almost certainly require authentication. Make sure you set up Duplicati the same way as your email client application.

Yep, smtp via ssl and port 465 is standard.

I’m using Outlook and Thunderbird without probs with it.
grafik

grafik

Details on config here Access your Mailbox.org email with IMAP - November 2021 - Mailbird

Can you show all Duplicati email options you are using? (Redact sensitive information of course.)

Sure, but it’s same as Rodrigos.

--send-mail-from = sendmailfrom@tld.sld
--send-mail-url = smtp://smtp.mailbox.org:465
--send-mail-password = PASSWORD
--send-mail-subject = %PARSEDRESULT%: Duplicati %OPERATIONNAME% report for %backup-name%
--send-mail-level = Success,Warning,Error,Fatal
--send-mail-to = sendmailto@tld.sld
--send-mail-body = %RESULT%

Are you sure your syntax for SMTP server is correct? If I read the help, it is specified : “To enable SMTP over SSL, use the format smtps://example.com.”

Thus I would rather try something like –send-mail-url=smtps://smtp.domain.es

Side note:

My own config is as follows:

smtp://mail.myemailserver.fr:25/?starttls=always

1 Like

Yes as Rajstopy mentioned, please change your “smtp://” to “smtps://”. You can drop the “:465” if you wish as it is implied when using “smtps://”.

TL;DR

Try telling the SMTP server the username it knows when trying to login.

Both configurations give send-mail-password and (is it true that) neither gives send-mail-username?

--send-mail-username (String)
SMTP Username.
The username used to authenticate with the SMTP server if required.

Reading it from the Mailbird site seemed indirect. mailbox.org directions:

Setup other e-mail clients manually

please configure your mailbox using the following settings:

Always enter your full e-mail address (jane.doe@mailbox.org) when logging in on our site.
Password: Your password

Port 465 is never anything but SSL/TLS, so getting the error back says that it got connected:

If you want to see log of the client and server SMTP interaction, log at profiling level has it.
Be careful of what you post (or better yet, don’t quote). You might post something sensitive…

Here’s an example of successful login to an SMTP server on port 587 after doing STARTTLS.
Port 587 (unlike 465) can switch to TLS in the middle of its connection if that’s the preference.
Which SMTP Port Should I Use? Understanding Ports 25, 465, & 587

S: 250-AUTH LOGIN PLAIN
S: 250-STARTTLS
S: 250-8BITMIME
S: 250-PIPELINING
S: 250-HELP
S: 250-CHUNKING
S: 250-BINARYMIME
S: 250 SIZE 52428800
C: STARTTLS
S: 220 Ready to start TLS
C: EHLO [192.168.0.107]
S: 250-hello TLS
S: 250-AUTH LOGIN PLAIN
S: 250-XCLIENT ADDR
S: 250-8BITMIME
S: 250-PIPELINING
S: 250-HELP
S: 250-CHUNKING
S: 250-BINARYMIME
S: 250 SIZE 52428800
C: AUTH PLAIN redacted
S: 235 Authentication successful

Rather than hang around in About → Show log → Live → Profiling for an actual backup email (or setting send-mail-any-operation so other operations send email), above was from Commandline with Command changed to send-mail, Target URL box cleared, and Commandline arguments set to show profiling log:

--console-log-level=profiling

Rest of the usual backup stuff was lazily left and drew some complaints. This was just a way to send an email without having to set up everything again, and it was enough to show what client and server said…

1 Like

Good catch… I missed that one!

As suggested, I changed it to:
–send-mail-url=smtps://smtp.domain.es:465
Now the error shows this (redacted mail address):

2021-11-15 11:38:33 +01 - [Warning-Duplicati.Library.Modules.Builtin.ReportHelper-ReportSubmitError]: Failed to send message: MailKit.Net.Smtp.SmtpCommandException: 5.7.1 <redacted@domain.es>: Relay access denied

Alright, the issue was that I was missing this too:

Thank you for your assistance! I don’t know how I missed that!

2 Likes