I have never received an email

Hello
I put:

> --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 unable to duplicate this. Could you could show us the log output when this happens?

About --> Show Log --> Live --> Information

It will appear like this:

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?

Hello
Yes I put this in the general duplicate settings.
I have several backups that work well and one backup that does not work

10 déc. 2020 16:39: Échec de l’envoi du message: MailKit.Security.AuthenticationException: 535: 5.7.8 Username and Password not accepted. Learn more at 5.7.8 Can't sign in to your Google Account - Gmail Help 20sm9555000wmk.16 - gsmtp → MailKit.Net.Smtp.SmtpCommandException: 5.7.8 Username and Password not accepted. Learn more at 5.7.8 Can't sign in to your Google Account - Gmail Help 20sm9555000wmk.16 - gsmtp

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

Hello
With gmail or gmx it doesn’t work any more.
Doesn’t anyone else have the same problem?
other ideas?
I’m on ubuntu 20.04

Apps have different security rules than web access (if that’s what you mean).

Did you read at https://support.google.com/mail/?p=BadCredentials
Less secure apps & your Google Account might apply. If not, try the others…

For me, only if I don’t allow less secure apps. Otherwise works both ways like:

Please clarify where you are putting parameters. If not on backup, try there.

OP syntax looks like command line options. What command, on what OS?

Do you run GUI too? If so, how does that work? It avoids CLI quoting issues.

Hello
@ts678
Thank you for being there often to help :slight_smile:

I put the following commands in the general parameters and it works :slight_smile:
--send-mail-from=XX@gmx.fr
–send-mail-password=xxxxxxxx
–send-mail-subject=Duplicati %OPERATIONNAME% report for %backup-name%: %PARSEDRESULT%
--send-mail-to=XX@gmx.fr
–send-mail-url=smtps://mail.gmx.com:465
--send-mail-username=XX@gmx.fr

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?

image

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

    command:
      - /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=xxx@xxx.xxx
      - --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

It results with the following command

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

I see the confusion now.

Duplicati has multiple executables, and there are two at play here:

  • duplicati-server: The server process that hosts a webserver and a runner for performing backups
  • duplicati-cli The commandline client that runs without any webserver or UI

When you wrote via CLI I was reading it as running with duplicati-cli, something like:

docker exec -it duplicati/duplicati:canary /usr/bin/duplicati-cli backup ... --send-mail*

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:

By setting the options here, they will automatically be applied to all backups, unless you override them on the individual backups.

There is currently no simple way to pre-load the settings database, if that is your goal.

If you had done an Export As Command-line, the line produced would have begun like this:

/usr/lib/duplicati/duplicati-cli backup

You didn’t say which help. If you meant duplicati-server help, it’s probably the whole list.

Most options are per job or run, and are on duplicati-cli help which gives subcategories:

  General: example, changelog
  Commands: backup, find, restore, delete, compact, test, compare, purge, vacuum
  Repair: repair, affected, list-broken-files, purge-broken-files
  Debug: debug, logging, create-report, test-filters, system-info, send-mail
  Targets: aliyunoss, aftp, azure, b2, box, cloudfiles, dropbox, ftp, file, gcs, googledrive, e2, jottacloud, mega, msgroup, onedrivev2, openstack, rclone, s3, ssh, od4b, mssp, sharepoint, sia, storj, tahoe, cos, webdav
  Modules: aes, gpg, zip, 7z, console-password-input, http-options, hyperv-options, mssql-options, runscript, sendhttp, sendxmpp, sendmail
  Formats: date, time, size, encryption, compression
  Advanced: mail, advanced, returncodes, filter, filter-groups, <option>

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.

with options organized into groups. It would be better if the manual linked at top to its sections.

Reporting options is a link, but one wouldn’t know unless one scrolled page down. Not as nice.

I don’t know if the descriptions in the manual are short enough, but if you want long info, that’s it.

Storage Providers and individual Commands are other places to read what options are available.

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.

parameters-file is somewhat similar to GUI default options. You can also set options using scripts.

I’m not sure what the goal is, but the current problem is mismatch between command and options.

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.

1 Like

Please look over Duplicati components at the top of the Installation page for a summary of that.

Using Duplicati from the Command Line gets deeper into how one uses that to run backup, etc.

Using the Graphical User Interface talks more about server part, since that’s what Web UI uses.

Forum articles category has Different ways to make a Duplicati backup. Duplicati is very flexible.

EDIT:

… which can make it more confusing than something less so. If you have questions, please ask.