diedrichg
Wizard
- Joined
- Dec 4, 2012
- Messages
- 1,319
Update for TrueNAS (12.x): There is now an option in System>Email settings to enable GMail OAuth. This allows account authorization via a API. Simply, this asks you to login to your Google account and to allow TrueNAS access your account and to remove the need for a special app password (this method is still listed below if you wish to use it instead). The advantage of GMail OAuth is that there is a simple account login and then authorization via your phone assuming you 2-Step Verification set in your Google Account Settings (Steps 1-5 of the App Password instructions listed below).
How GMail OAuth authorization works
Instructions
Are you having troubles getting TrueNAS to email you when setting up the email address parameters in Settings>Email? It could be because you have Google's 2-step verification enabled. You need to set an application-specific password for TrueNAS in your Google's security settings.
I'll first describe the steps to set an application-specific password and then I'll go over the settings for making sure you have the right parameters set in TrueNAS.
Option 1: Assign an App Password in Gmail
Option 2: Use GMail OAuth
Changelog:
Additional search tags
Hotmail, Yahoo mail, 2-factor, factor, two-factor, test email, 2-step, two-step
How GMail OAuth authorization works
At a high level, all apps follow the same basic authorization pattern:
- When the OAuth app launches, request that the user grant access to data in their Google account.
- If the user consents, TrueNAS requests and receives credentials to access the Gmail API.
- Refresh the credentials (if necessary).
Instructions
Are you having troubles getting TrueNAS to email you when setting up the email address parameters in Settings>Email? It could be because you have Google's 2-step verification enabled. You need to set an application-specific password for TrueNAS in your Google's security settings.
I'll first describe the steps to set an application-specific password and then I'll go over the settings for making sure you have the right parameters set in TrueNAS.
Option 1: Assign an App Password in Gmail
- Go to your Gmail or Google page.
- Click your picture in the top-right
- Click Manage your Google Account
- Click Security on the left menu
- You will now see the section "2-Step Verification"
- Then click "App Passwords" at the very bottom of the page
- In the App Name box enter the name of the app for which you wish to create a password
- Click Create
- Copy the password that appears in the Yellow box, you will need this for your password in the TrueNAS Email settings - This is the only time you will ever be able to see this password so copy it. If you forget it, you will need to revoke the app password and start over.
- Click Done and exit
- From email: the from email address to be used when sending email notifications
- Outgoing mail server: smtp.gmail.com
- Port to connect to: 587 (for TLS)
- TSL/SSL: TLS
- Use SMTP Authentication: (checked)
- Username: youremail@gmail.com
- Password: (the password you copied from the Gmail App Password in step 10 above, not your normal Gmail password if you have Google's 2-step verification enabled. If you don't have Google's 2-step verification enabled then yes - enter your normal Gmail password.)
- Click the GMail OAuth radio button
- You will get a pop-up window asking if you want to allow TrueNAS access, accept this.
- You will now need to login to your Google Account
- Assuming you setup 2-Step Verification in your Google Account Security Settings, you will now be prompted on your phone (or email) to allow TrueNAS to access your Google Account. Allow this.
- That's it! Send a test email.
Jan 12, 2021: Added info about the new GMail OAuth option offered in TrueNAS 12.x
Jan 09, 2019: Updated to the latest Google GUI layout
Jan 08, 2017: Changed the security to TLS and port 587.
Jan 09, 2019: Updated to the latest Google GUI layout
Jan 08, 2017: Changed the security to TLS and port 587.
Additional search tags
Hotmail, Yahoo mail, 2-factor, factor, two-factor, test email, 2-step, two-step
Last edited: