Setting up notifications using SMTP

I have installed Duplicati 2 and it is working now. Now I want to set up notifications. Normally I put in the SMTP server information but this time it is about a “URL” and I can not seem to get it working properly. Here are the option settings I have:

–send-mail-any-operation=true
–send-mail-body=%RESULT%
–send-mail-level=all
–send-mail-subject=YNA Duplicati %OPERATIONNAME% report for %backup-name%
–send-mail-to=backup@digitaldomain.ca
–send-http-result-output-format=Duplicati
–send-mail-url=smtps://relay.ddom.ca I am using SSL notes say if port is blank, 465 is assumed.****
–send-mail-username=notificationsmtp
–send-mail-password= removed*

I am using SSL on port 465.

Am I missing a setting or did I set up the URL incorrectly?

Thanks

What you have for the url looks like mine. I have a “send-mail-from=” as I don’t have a no-reply user and it would fail with that default. I also tried it without the 465 port in the address and it worked fine.

I did not try putting in your ‘subject=’, ‘body=’ or ‘format=’ settings. I don’t use them but I could test them later. Or you could remove them to keep it simple for troubleshooting.

Do you get an error after a backup is run?

This is what mine is set to:

--send-mail-from=me@myplace.com
–send-mail-password=MyPassword
--send-mail-to=me@myotherplace.com
--send-mail-username=mymailusername@myemailprovider.com
–send-mail-url=smtps://mail.myplace.com:465
–send-mail-log-level=Warning

1 Like

Does that mean nothing was removed from --send-mail-username? I thought this was typically a full email address, but if you can find a way to find what the server needs, maybe a simple username is acceptable?

On this one, maybe http should be smtp but I’d be surprised if that had anything to do with any smtp failure.

This could be clarified. Is it working somewhat, but not as you wish? Is nothing at all getting to the recipient?

About → Show log → Live → Profiling can watch the SMTP send attempt, but don’t post lines here because some of them might be your authentication. If it’s failing, you might get some clue as to what is going wrong.

  1. I have no idea if it is working, I do not get an email and I do not get an error that one could not be sent.

  2. the send -http-reults-output-format=Duplicati, was removed to simplify it as per another reply.from edavis

  3. the send-mail-username is the username required for the SMTP server I am using to send these. The worked “removed” in the password just meant I removed the password so as not to give out information.

and so on is the next step. If it simplifies experimenting, there’s also The SEND-MAIL command for CLI. Perhaps trimming the options down to a minimum would remove some questions about non-essentials.
Personally I’m sending into port 587 with starttls=always, but port 465 should work if it’s implicit TLS.
How far is it getting? That’s what looking at the log output is for.

I have simplified the script to this:

–send-mail-to=backup@digitaldomain.ca
–send-mail-username=notificationsmtp@relay.ddom.ca
–send-mail-from=backup@digitaldomain.ca
––send-mail-password=*******************************
––send-mail-url=smtps://relay.ddom.ca:465
––send-mail-log-level=Warning

and I still do not get an email. When I check the log there isn’t even a note about the option being triggered. Am I missing something that tells it to run these options after the job or something?

Chris

You might have an extra character (0x96) in front of your last three options.

Is this test by script, not web UI? Scripts have other needs such as quoting.

What log? Now I’m thinking this is either web UI or maybe you set up log-file.

Maybe script does not mean computer script, just script as in procedure?

Have you tried using advised profiling log or send-mail command yet? How?

EDIT:

Windows command line program is Duplicati.CommandLine.exe. On Linux, it’s duplicati-cli. With options

send-mail --send-mail-url=smtp://myispsmtp:587/?starttls=always --send-mail-username=myfullemail --send-mail-password=mypassword --send-mail-to=myfullemail

it conveniently shows me the Whole SMTP communication: without my having to ask for the profiling log.

I started in GUI Commandline, clicked Edit as text, copied Advanced options into editor, and thinned.
Export As Command-line would have been an alternative if I had wanted one long line to do my thinning in.

1 Like
  1. I went back and removed the extra character
  2. By script I meant when you edit the options as text
  3. the log that is available after a job runs. It shows all the steps and the errors and I do not see anything in there for the emails triggers.

I appreciate all the help, but I think you are overthinking my words. Please accept that I am working at a very basic level and may not use the terminology that you are completely familiar with.

Thanks

Chris

I fixed the extra characters and ran another test run. it was completed with 15 warnings (normal during the day) but when you look at the complete log there is no reference to it emailing anything.

If you mean Options screen 5, and three dot menu, that’s very much like what I was doing in Commandline which you can use for a test at a Command Prompt per Using Duplicati from the Command Line, or use GUI Commandline and trim things off (maybe more potential for error compared to just picking out four options).

I just tested this in GUI Commandline, changing the Command dropdown to send-mail, emptying both boxes, and hitting X on the Advanced options until I had only the four left that I showed in my earlier test suggestion. In another tab (e.g. a duplicate of the first one), I clicked through About → Show log → Live, then Profiling.

Running commandline entry
Finished!

            
Whole SMTP communication:

appeared, and showed the SMTP just like Command Prompt did. Profiling log is reverse-chronological:

image

but here the log is squashed into one line, so is hard to read compared to the true or GUI Commandline)

I really need you to do some testing on your setup, otherwise there’s no information to guess at problem.

I don’t think it’s logged in that log. It needs a different log, and at profiling log level.
Complete log doesn’t mean everything, but more complete than summary data:

EDIT:

Assuming you got the Connected, some key non-private SMTP server messages to look for would be:

S: 220 Welcome to
S: 235 Authentication successful
S: 250 2.6.0 Message accepted
S: 221 Goodbye

If it got that far, your server accepted the mail message, and beyond that there’s no visibility to Duplicati.
The name of your server suggests a mail relay, and sometimes mail relays have policies about relaying.

Thanks for all this. I got the Profile Log and it tells me the issue is SSL related. At least now I have something to work with.

Chris

1 Like

What’s the Difference Between Ports 465 and 587? explains conventions, but your server could differ.

If this were Linux, I’d wonder if it’s a certificate issue (they’re going around). Less likely if it’s Windows.

Port 465 is a default port for SSL. Port 587 we usually use just so it is not port 25 for non-SSL. The SMTP is on a non-windows device but not necessarily a Linux device. But the certificate is self-published so it can not be validated and I am going to start with that.

The question is what CA is it from? See Old Let’s Encrypt Root Certificate Expiration and OpenSSL 1.0.2