> --send-mail-from=alerts@domain.com
> --send-mail-level=Warning,Error,Fatal
> --send-mail-password=xxx
> --send-mail-subject=Duplicati %OPERATIONNAME% report for %backup-name%: %PARSEDRESULT%
> --send-mail-to=myemail@domain.com
> --send-mail-url=smtps://smtp.gmail.com:465
> --send-mail-username=xxx
> ```
I put the same thing as on my thunderbird smtp that works, there is in the thunderbird settings: OAuth2
Is this what can be a problem and if so, how to put it on?
I was able to send emailed reports from Duplicati using both SMTPS on port 465 and SMTP with STARTLS on port 587 using a gmail.com account.
Also, one other thing is that in the settings you have provided you have configured Duplicati not to send emails unless there is an error with the backup job in the “send-mail-level” setting. Are you experiencing errors for which you are expecting to get an email?
Does the one backup job that doesn’t send mail have any mail settings set on it that are different from the ones that are set in the General settings? If it does, the settings on the specific job will override the ones in the General settings:
The log message you included indicates that the message was not sent due to the username and/or password not being correct. I can’t think of another reason why some jobs would work and others would not unless the specific job had different settings on it.
Hello
Strange, the username and password works correctly online.
I put this parameter only in those of duplicate not in a backup parameter.
Strange
Regards
If one day someone understands and solves the problem with gmail, I’ll be a taker because I followed the various comments I understood, without success.
I use the graphical interface under firefox last version with ubunut 20.04
I don’t know what CLI is !
Regards
This doesn’t say much about what was actually attempted, so to pick on one specific thing to confirm:
Is https://myaccount.google.com/lesssecureapps set to this?
Changing to that will probably produce some alert to your gmail, smartphone, etc. to warn you about it.
I’m not clear on your thunderbird result. Did you say it worked with same settings? OAuth2 is different.
How to add Gmail SMTP in Thunderbird describes some steps that you may or may not have followed, however if you followed them, then I think you got OAuth2 authentication which Duplicati email can’t do.
I was configuring mail notifications in my instance and I have found some of the pieces in this thread useful. I realise this is an old one but it might be an important insight for someone in my position.
I am running duplicati in a container (duplicati/duplicati:latest). Initially, I was putting the options in the CLI. I verified within the container that they were passed to the process. Only then did I realise the CLI does not support these options, at least the help prompt does not list them (--send-mail*) as accepted parameters. Specifying the default options in the web GUI got me to the working setup.
TBH, I am not sure whether this is a bug or an intentional change, however, my strong preference would be to define these options via CLI.
Hi @bystrzak14, the code that runs from the UI and the CLI is the same. The email module is set up the same way in both cases, so the output should be the same.
If you set options that are not supported you will get a warning, so if the email module was somehow missing, you should see a warning from the CLI.
Have you tried setting an invalid hostname and checked that you get a warning? This would verify that the options indeed reach the CLI.
Can you see any logs or similar at the email provider?
The help for a command does not list all the generic options which one might want to use.
Admittedly this leaves some things to guess or test, but there are an awful lot of options…
You want to persuade the container to run Duplicati via CLI, by docker exec or somthing?
So for you, GUI works, so maybe you can Export As Command-line to get a command line, properly quoted (quoting issues are a popular shell problem), and ready to run in container.
This is always the best path if trying to match a GUI job, otherwise options may be different.
I guess my assumption based on the help prompt was incorrect. Still, I would have them all listed with a short description, even if it’s long, rather than receiving incomplete information.
To get this out of the way
That is one way to do it, but I don’t. Saying “via CLI” for me is a way to say passing them to the container via docker or docker-compose, which, at a certain level, works the same way.
For some more context, as mentioned I am running my setup using docker-compose, I specify all the parameters there. Here’s what I got now
root@bc042ecb0180:/# ps x | more
PID TTY STAT TIME COMMAND
1 ? Ss 0:00 /usr/sbin/tini -- /usr/bin/duplicati-server --webservice-port=8200 --webservice-interface=any --webservice-allowed-hostnames=* --log-level=Information --log-file=/data/log/duplicati.log --send-mail-from=duplicati-alerts@xxxx.net --send-mail-level=All --send-mail-to=xxxx@xxxx.com --send-mail-url=smtp://smtp.xxxxxxxx.net:587/?starttls=always --send-mail-any-operation=true --send-mail-username=xxxx@xxxx-xxxxxx.xxxx.xxx --send-mail-password=xxxxxxxxx
I tried many combinations already (more options, fewer options, removing special characters etc.) with no luck so far. I would appreciate some help with debugging this
But I can now see that you are running duplicati-server and this does not support passing the --send-mail* arguments as it only accepts options related to hosting the webservice and runner.
You need to instead go into the “Settings” area, and enter these as advanced options. You can click the “Edit as text” to get something where you can copy in the settings:
I estimate that there are over 300 options, and a flat list would get very long. You can look at Advanced Options to see what options a job can have. It’s somewhat similar to the GUI view.
Other Command Line Utilities describes what the Duplicati server start takes. It should be like the build-in help, however the manual is sometimes less up-to-date on everything, compared to help.
There was a misunderstanding as I was unaware of duplicati-cli. Now everything is clear.
To sum up, the --send-mail* (and most likely all --send* commands?) are job-specific, not server-specific. When I think about it now, that makes perfect sense.
I added the default options for my jobs and now everything works as expected. Thank you!
The comments about help were a bit off-topic here, but then, my first assumption about the help prompt was correct, they weren’t listed there so they were not meant to work.
Finally, a suggestion from me. In the documentation, I am still missing a clear distinction between the options for duplicati-cli and the ones for the duplicati-server. Maybe it is worth putting a note somewhere there to avoid similar confusion.