Gmail setup failed

I tried to set up email notifications through gmail according to the instructions at How to configure automatic email notifications via gmail for every backup job

I think that I set it up correctly, but after the backup finished I got the following error:

I’m guessing that my gmail setup is different than the standard (probably because I use my own domain instead of gmail.com).

I set up email on TrueNAS recently. They supported using Google OAuth instead of requiring the password. I’m not sure how complicated that is, but might be worth investigating.

2024-06-05 16:55:08 -04 - [Warning-Duplicati.Library.Modules.Builtin.ReportHelper-ReportSubmitError]: Failed to send message: MailKit.Security.AuthenticationException: 534: 5.7.9 Application-specific password required. For more information, go to 5.7.9 Sign in with app passwords - Google Account Help 71dfb90a1353d-4eb4ad32a21sm5103e0c.35 - gsmtp → MailKit.Net.Smtp.SmtpCommandException:

Welcome to the forum @pheltman

I’m not sure if this is a support request or a feature request. If support, please read Google’s advice link.

Some people are currently on two-factor authentication because Google forced it. Are you on 2FA now?

Google wants people to use 2FA, so it’s just going to turn it on for them
Non-tech-savvy users always use the defaults, and the default will soon be 2FA.

Google wants every account to use 2FA, starts auto-enrolling users
Two-factor authentication is coming to Google accounts whether you want it or not.

A simpler and safer future — without passwords

Soon we’ll start automatically enrolling users in 2SV if their accounts are appropriately configured.

How we get along with OAuth is Duplicati’s scheme, whereas TrueNAS probably uses local storage.
The OAuth server is due for a move, but is currently at https://duplicati-oauth-handler.appspot.com/.
You can see the Destination storage providers that it supports, but I don’t think it now supports email.

In order to have Duplicati send email via a Gmail account you’ll need to set up an App Password. This is necessary because Google doesn’t allow your account credentials to be used for anything that doesn’t support enhanced authentication (OAuth). Duplicati supports OAuth for the purposes of using Google Drive as a destination, but not for the purposes of sending email.

To do this, navigate into your Google Account settings and search for “App Passwords” (I’ve never been able to find it any other way).

image

Once there you’ll be asked to provide a name for this App Password. It’s just a label so you can identify it later.

After you provide a name, it will come back with an App Password. Make note of it immediately, because it will never show you again.

Then, when you are setting up Duplicati to send email via Gmail, use this password instead of your real Gmail password.

If I recall correctly, Google will require you to set up 2FA before it allows you to make app passwords, but I suspect that nearly everyone will have done that by now.

If you decide later that you don’t want this App Password to exist anymore, you can delete it from the same place.

1 Like

Thank you! That was the information I needed. For some reason the suggested format for -send-mail-from produced an error but changing it just to my email address worked fine. Duplicati is now set up and working great.

Peter Heitman

1 Like