Register for the iXsystems Community to get an ad-free experience and exclusive discounts in our eBay Store.

Are you having trouble getting FreeNAS to email you in Gmail?

diedrichg

FreeNAS Expert
Joined
Dec 4, 2012
Messages
1,224
Are you having troubles getting FreeNAS 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 FreeNAS 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 FreeNAS.

Assign an App Password in Gmail
  1. Go to your Gmail or Google page.
  2. Click your picture in the top-right
  3. Click Google Account
  4. Click Security on the left menu
  5. You will now see the section "Signing in to Google"
  6. If 2-step Verification is already enabled on your account then click "App Passwords"
  7. On this new page - At the bottom, click the drop-down box that says "Select app" - Click Mail
  8. Just to the right is a drop-down box that says "Select Device" - Click "Other (custom name)"
  9. Enter a name for your FreeNAS system
  10. Click Generate
  11. Copy the password that appears in the Yellow box, you will need this for your password in the FreeNAS 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.
  12. Click Done and exit
Gmail parameters for setting up an email address in FreeNAS to receive system notifications
  • 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.)
Changelog:
Jan 09, 2019:
Updated to the latest Google GUI layout
Jan 08, 2017: Changed the security to TLS and port 587.
Feb 11, 2016: Updated the app password section to reflect web page layout. I also added the notation to allow less secure apps (Thank you @Ruff.Hi )

Additional search tags
Hotmail, Yahoo mail, 2-factor, factor, two-factor, test email, 2-step, two-step
 
Last edited:

Ericloewe

Not-very-passive-but-aggressive
Moderator
Joined
Feb 15, 2014
Messages
16,106
I'd like to add that a similar procedure solves the same problem with Outlook.com (as well as any other e-mail provider that uses two-factor authentication).
 

Paranoiak

Newbie
Joined
Jun 3, 2014
Messages
45
I didn't know the App Password feature in Gmail, so thank you very much for this thread ! :)
 
Joined
Mar 12, 2014
Messages
1
Very nice, thanks. I was confused at first because I didn't have 2-factor enabled so the settings in Apps passwords wasn't there. But after enabling that, I got a test e-mail from the NAS. Working e-mail and tighter Google security settings - double win!
 

sfl

Newbie
Joined
Apr 14, 2012
Messages
11
Just wondering if anyone has noticed that without application passwords (which seems to only be enabled with 2 factor authentication), the only way to have some clients work (FreeNAS included it seems) with a gmail account is to "allow less secure apps" to be enabled. While I get that there's likely been some improvements to authentication independent of 2 factor auth. it's not quite clear to me how these are any less secure considering they support SSL/TLS. Would anyone be able to clarify how FreeNAS is considered less secure?
 

Ruff.Hi

FreeNAS Experienced
Joined
Apr 21, 2015
Messages
204
I've just created a NAS specific gmail account. FreeNAS can run that and email my normal account. I am pretty sure that this set up will let me delete the dull, boring, everyday NAS emails and also keep a record of all emails in the 'sent' folder of the NAS gmail account. I'll update this post once I have it up and running.

Edit: My NAS root user email is set to my NAS specific gmail account and I have set up the email as per post #1. Initially, it wasn't working as google had set the 'allow less secure applications' to FALSE. However, setting that to TRUE released FreeNAS to access this account. Email working!

Google also emailed me to warn me that someone was hacking my account. They included ...

If this was you
You can switch to an app made by Google such as Gmail to access your account (recommended) or change your settings at https://www.google.com/settings/security/lesssecureapps so that your account is no longer protected by modern security standards.


So ... with my specific NAS gmail account sending emails to itself, I get a complete repository of NAS emails plus with the gmail forwarding in action, my normal account gets the NAS emails and I can happily delete them if they are boring.
 
Last edited:

Easygoer

Newbie
Joined
Mar 11, 2014
Messages
53
Are you having troubles getting FreeNAS 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 FreeNAS 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 FreeNAS.

Assign an App Password in Gmail
  1. Go to your Gmail or Google page.
  2. Click your picture in the top-right
  3. Click Account
  4. Click Security at the top
  5. In the Password section - Click Settings next to App Passwords
  6. On this new page - Click the drop-down box that says Select app - Click Mail
  7. Just to the right is a drop-down box that says Select Device - Click Other (custom name)
  8. Enter a name for your FreeNAS system
  9. Click Generate
  10. Copy the password that appears in the Yellow box, you will need this for your password in the FreeNAS Email settings - This is the only time you will ever be able to see this password so copy it down. If you forget it, you will need to revoke the app password and start over.
  11. Click Done and exit
Gmail parameters for setting up an email address in FreeNAS to receive system notifications
  • From email: the from email address to be used when sending email notifications
  • Outgoing mail server: smtp.gmail.com
  • Port to connect to: 465 (for SSL)
  • TSL/SSL: SSL
  • 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.)

Additional search tags
Hotmail, Yahoo mail, 2-factor, factor, two-factor, test email
I had this problem (email not being sent automatically through Freenas) crop up suddenly after I upgraded to 9.3.1 20160118.

I would like to say that the above procedure worked for me. Setting up the App Password in Google is the key in case one has enabled 2SA. In any case follow the steps to the letter. It works!!!

Thanks to diedrichg. Appreciate the detail steps for a noob like me.
 

diedrichg

FreeNAS Expert
Joined
Dec 4, 2012
Messages
1,224
Changelog:
Feb 11, 2016:
Updated the app password section to reflect web page layout. I also added the notation to allow less secure apps. Thank you @Ruff.Hi !
 
Joined
Feb 17, 2016
Messages
2
Diedrich,
Nice tutorial. Thanks for doing this for us newbs.
I'm obviously still getting something wrong cuz it ain't working for me yet. First off. I think I'm not putting the correct "From email:" in. What do I put here? Where do I find this?
Secondly, The generated password comes in four, four-letter chunks. Am I supposed to add spaces between the four-letter chunks or is it all run together?
Thanks!
 

diedrichg

FreeNAS Expert
Joined
Dec 4, 2012
Messages
1,224
Diedrich,
Nice tutorial. Thanks for doing this for us newbs.
I'm obviously still getting something wrong cuz it ain't working for me yet. First off. I think I'm not putting the correct "From email:" in. What do I put here? Where do I find this?
Secondly, The generated password comes in four, four-letter chunks. Am I supposed to add spaces between the four-letter chunks or is it all run together?
Thanks!
There is a note next to that randomly generated password that says that it doesn't matter if you leave the spaces in or not, it'll compensate.

You should use your email... Unless you have set up a gmail account specifically for your server - that way you know who it's coming from and... well, it's just for anyone who likes to be anal.
 

Easygoer

Newbie
Joined
Mar 11, 2014
Messages
53
Diedrich,
Nice tutorial. Thanks for doing this for us newbs.
I'm obviously still getting something wrong cuz it ain't working for me yet. First off. I think I'm not putting the correct "From email:" in. What do I put here? Where do I find this?
Secondly, The generated password comes in four, four-letter chunks. Am I supposed to add spaces between the four-letter chunks or is it all run together?
Thanks!
Hi....I had to redo the email problem just a couple of days ago. Here's what I did....I followed Diedrich's method to the letter. He has updated it recently as I recall.

From email: put your@gmail.com (I use my gmail address) email address.
I copied and pasted the four-letter chunks "as is", no spaces required. Paste that into your password space, and hit save.
Then try sending an email. If all is well you will get a "email sent successfully" message in "red".
Check your email to make sure it has arrived.
Hope it works for you. Cheers.
 
Joined
Feb 17, 2016
Messages
2
I got it going! Not my Gmail account though. I let my frustration get the better of me and used a different email account. Even that was frustrating but the point is I have the gui sending email.
I must say, this was my first post and you guys were super helpful and awesomely quick to respond with assistance.
Very impressed. Thanks so much for your patience and understanding.
I've been trying to get it going for over a month and thought it was because I have two routers in my home and the NAS is sitting behind the second one. However, this isn't the place to discuss this.
Thanks again.
Terie

PS... I think I probably should have entered this response as a reply to the post above and therefore its in the wrong spot. Sorry about that. I'm not sure if I can move it but I surely will remember next time.
 
Last edited:
Joined
May 5, 2016
Messages
8
Just so that you guys know:

I guess if you use a strong password (my gmail has 20 characters) you don't need to do anything. It worked out of the box. With a 10 digit pw it didn't work instantly.
 

yourmate

Newbie
Joined
Apr 4, 2016
Messages
94
I've just created a NAS specific gmail account.
You are quite right! I always do the same with my devices and I just could not understand the fuss why people want to set up their own email and password on the device...

It takes 5 mins to set up a new gmail account and you just assign a label to those mails in your own account and you will be able to do all the fancy stuff ;)
 

lukyjay

FreeNAS Experienced
Joined
May 13, 2016
Messages
133
Thank you, this solved my problem.

I am wondering why you suggest the use of SSL? Google search is telling me TLS is more secure, and it's working fine for me.
 

diedrichg

FreeNAS Expert
Joined
Dec 4, 2012
Messages
1,224
Thank you, this solved my problem.

I am wondering why you suggest the use of SSL? Google search is telling me TLS is more secure, and it's working fine for me.
Because that was 2.5 years ago and SSL was SO 2014. But now the cool kids are using TLS - because it's 2017, so I've updated the OP to TLS and port 587. I did a test and it works fine on my end.
 

Ryan Allen

Newbie
Joined
Oct 11, 2016
Messages
93
I'm having some troubles getting FreeNAS Corral to like my email settings. I have another box that's running 9.10 without any issues. I tried to do the same set up on Corral but still no good. Any advice?
 
Joined
Mar 24, 2017
Messages
1
Hi,
I use freenas 9.10.2
I set everything as described in this post...
The test email is sent in freenas, no error message, but nothing received in my gmail.
What is the problem ?
 

Ryan Allen

Newbie
Joined
Oct 11, 2016
Messages
93
Thanks guys! I was able to get it going. I had to manually enter in my Default Gateway. My DHCP did not supply it automatically when it was "Checked" to do so.
 
Top