How to set up email notification with Gmail

Hi Ken,

Some great news i tried email notification ini a VM and the emails are been send now I think my pc firewall or AV was blocking the mails to be send :ok_hand:

One thing is that i get the following error at the end of the email:

]
Warnings: [
    The supplied option --auth-u is not supported and will be ignored
]
Errors: []

I dont think i have configured --auth-u anywhere or what option is this?

Thanks,

Try to export the backup to commandline format and see if you can spot it somewhere.

1 Like

Hi Ken,

I really need to say Thanks you and to all the guys who assisted with this i think my emails and backup are running 100% now. So for me now it’s just about fine tuning my configuration e.g. to send mail only for warnings. Thanks u again much appreciated.

Thanks,:raised_hands:

1 Like

BTW: A good way of showing your appreciation for a post is to like it: just press the :heart: button under the post.

If you asked the original question, you can also mark an answer as the accepted answer which solved your problem using the tick-box button you see under each reply.

All of this also helps the forum software distinguish interesting from less interesting posts when compiling summary emails.

1 Like

Is it possible to get support for line breaks / new lines / carriage returns in the message body?

Something like this:

–send-mail-body="%OPERATIONNAME%: %PARSEDRESULT% \n\n Backup For: %backup-name% \n\n %RESULT%"

I have no idea if this would work, but I’m guessing something like this in SendMail.cs under ReplaceTemplate:

input = Regex.Replace(input, "\\n", Environment.NewLine, RegexOptions.IgnoreCase | RegexOptions.CultureInvariant);
1 Like

You can also supply a filename for --send-mail-body. If the file exists, Duplicati will do the template expansion on the file contents instead.

But maybe your solution is still nice, in that it is easier if the config is stored entirely in the job configuration.

A post was split to a new topic: Setting up email via web-interface not working

Hi Ken,

I found three occurences of a typo in the online help text shown in the GUI -> Settings -> Options for the advanced option send-mail-url regarding STARTTLS. In the composed URL, the / in front of ? should be removed.

Is: smtp://example.com:25/?starttls=<always|when-available|never>
Should be: smtp://example.com:25?starttls=<always|when-available|never>

scmarti,

I think you would be correct if the URL was to a specific page (such as default.html) but when a URL goes to a folder it relies on the web server to decide the default page to show - the “/” is needed so the web server knows a specific page is being requested.

Granted, the top level (root) folder MIGHT work without the “/”, but by including it we stay consistent with other non-top level scenarios.

Hi JonMikeIV,

thank you for explaining. For top level URLs this is definitely working. When my send-mail scenario failed I thought the (in my view: extra) slash was the culprit. I later found out that actually it was my mail server’s invalid certificate. I fixed that using the option “accept-specified-ssl-hash”. My test using the example’s syntax then were successful.

Thank you for quick help!

1 Like

After some problems with Gmail using sendEmail and other such tools, I ended up creating a Yahoo email just for notifications and it was the best thing I did, it worked perfectly and without headaches for more than 3 years.

Thanks kees-z, this configuration worked perfectly for me on Windows 10 boxes.
Also thanks to kenkendk for his linux advice - I’ll try that next.

I first created a Google app password for Duplicati to use for sending emails (otherwise Google will reject the smtps send mail). Then I copied, pasted and customized your example into Duplicati.

Best Regards

2 Likes

It works perfectly with Version: 2.0.6.1 (2.0.6.1_beta_2021-05-03) on Win10. I checked today. Thanks!