How to configure automatic email notifications via gmail for every backup job

Good to hear that solved the problem. I’ll updated the docs to mention the “dash problem.”

Check the displaymessages=, displaywarnings=, and displayerrors= options in the [report] section of the .rc file. If any of those are set to “false” they won’t show up in the report.

Pushed this fix up to GitHub as part of the pre_prod branch.

Hi, I don´t read anything about configuring email notifications if we have 2fa in our gmail accounts.

I try it with this fantastic thread, and it works. Maybe most of you have a gmail account with 2fa and know how to configure it.

We have to create a new password application in our account preferences and paste it in --send-mail-password=your_application_password instead of your normal password.

hola buena tarde, manejo un proxy en mi empresa y cuando esta activo el proxy no me envía las notificaciones, de lo contrario me funciona perfectamente, ¿alguien le ha pasado? gracias

Gmail will disable connections with password (insecure programs) the only way to send an email via gmail will be with Oauth 2.0 this implies that --send-mail will no longer work with gmail addresses. is there a plan to improve --send-mail to integrate OAuth2.0 authentication
Thank you.

Gmail will disable access to unsecure programs was posted as a new topic a few minutes after above. Probably best to continue there to figure out what’s up (reply made, awaiting reply) than continue here.

Crossposted from the other thread:

Fairly sure this is a non-issue. The notice is about “account access”, not email send authentication. This quote directly from the original Google notification:

No change is required for scanners or other devices using simple mail transfer protocol (SMTP) or LSAs to send emails.

Further, if the receiving account is Gmail or GSuite, you don’t need to authenticate at all.

  • I got the same problem at first, but it then worked for me when i changed that line by [–send-mail-from=your_sending_gmail_username@gmail.com] like @paglino said.

  • Another thing is that putting the gmail account password wouldn’t work anymore, instead you must generate an Application Pass

Finally i wanted to thank you so much because i saved a lot of time and solved a lot of issues because of the text configuration you have provided

please keep sharing and helping us in the community
we need this inspiration from such experienced people like you @Marc_Aronson

Emails do not work in latest v2.1 stable version. I have tried every combination and permutation but still no go. I have verified the username/pwd is correct. There is no way to know what’s going not working as there is nothing reported in the logs (About > Show Log) or anywhere else where I can find.

–send-mail-from=__________
–send-mail-to=__________
–send-mail-level=“Warning,Error,Fatal”
–send-mail-url=smtp://smtp.gmail.com:587?starttls=always
–send-mail-username=__________
–send-mail-password=__________
–send-mail-subject=Duplicati %PARSEDRESULT%, %OPERATIONNAME% report for %backup-name%

Not sure if I am missing something or v2.1 somehow has some sort of bug sending emails.

Welcome to the forum @Alcyoneus

Are you saying that it worked before? If so, when? Or is this initial setup test?

Sign in with app passwords discussed above (term may vary) can impact you.

Where did options list come from? If GUI “Edit as text”, --send-mail-level
shouldn’t have its value double quoted. If CLI, --send-mail-subject should.

From reading the forum, I presume it was working for people in version 2 or so. But to answer your question, it did not work ever for me. This is the first time I am setting it up.

I am using App password which is confirmed working in other applications. --send-mail-level was set as double quote. Not sure if value for --send-mail-subject also needs to be double quoted.

Is there anyway to find from the logs anywhere as to what’s failing and at what point so that it can be troubleshooted?

Is this GUI or CLI? Basically, what you have is inconsistent for one of them.

You use --log-file=<path> --log-file-log-level=profiling. Does run end something like

2025-01-20 07:24:27 -05 - [Profiling-Timer.Finished-Duplicati.Library.Main.Controller-RunBackup]: Running Backup took 0:00:04:26.580
2025-01-20 07:43:14 -05 - [Profiling-Duplicati.Library.Modules.Builtin.SendMail-SendMailResult]: Whole SMTP communication: Connected to smtp://smtp.gmail.com:587/?starttls=always
(etc.)

About → Show log → Live → Profiling might be able to catch it. A small backup gives fewer lines.

The SEND-MAIL command is a way to test without any backup. If you run from GUI in Command, don’t double quote values. If run from CLI, double-quote values to protect any embedded spaces.

Just tested sending mail using Send-mail command and it worked but does not work even identical settings are used in the Duplicati web interface.

Turning on logs to a text file does not have anything related to sendmailresult or smtp.gmail or any other keywords and thus does not even work.

Is mail sending working for anyone using Gmail when on Duplicati v2.1?

Works here. Did you ever correct your quoting? Is current test GUI or CLI?

More usefully, what did it do? I’m not hearing that it said nothing.
If no mail was tried, then the lines I posted would jump to below.
Basically, there are normally two statements on backup endings.
SendMail (if it runs) goes between them.

2025-01-20 07:43:14 -05 - [Information-Duplicati.Library.Modules.Builtin.SendMail-SendMailComplete]: Email sent successfully using server: smtp://smtp.gmail.com:587/?starttls=always
2025-01-20 07:43:14 -05 - [Information-Duplicati.Library.Main.Controller-CompletedOperation]: The operation Backup has completed

except without the SendMail stuff. If it tried SendMail and failed, you’d see that, so maybe it didn’t try, which could be due to the --send-mail-level double quoting. Also note that you requested that no mail be sent normally, so I hope you got at least a warning. What if you omit it or try all?

  --send-mail-level (String): The messages to send
    You can specify one of "Success", "Warning", "Error", "Fatal".
    You can supply multiple options with a comma separator, e.g. "Success,Warning". The special value "All" is a shorthand for "Success,Warning,Error,Fatal" and will cause all backup operations to send an
    email.
    * values: Unknown, Success, Warning, Error, Fatal, All
    * default value: all

I am having the same issue. Gmail. I am using an App Generated Password with my Gmail account with Duplicati.

Warnings 1

2025-02-07 13:31:52 -06 - [Warning-Duplicati.Library.Main.Controller-UnsupportedOption]: The supplied option ---send-mail-url is not supported and will be ignored

Welcome to the forum @jeffreyswiggins

CLI options start with two dashes, not three.

But I am not setting that to be Two Dashes or Three Dashes… Their Code is. I have it added as a Setting in the Docker Container under DEFAULT OPTIONS so I chose that option only with a bunch of others to use and have assigned before and after every job. It is their code that is now adding that 3 dash I guess because I did not script that.
I write code and use docker compose and other things so I am familiar enough with what you are talking about, but in this case their app provides it so I just used the options in it.

What Duplicati release is that? If unsure, see About in GUI.

If that means Duplicati Settings screen, what does Edit as text show it did?

It made two dashes for me, as it should. If you added it some other way, what?

I am running Duplicati - 2.1.0.4_stable_2025-01-31

When I checked the Edit as a Text Option it appears there were — Dashes. No idea when or where that 3 dash got added because these settings stay static and do not get changed by me and I am the only one in my homelab. That did fix it for me and the jobs now run without errors and I received my emails!