Setting Up Email + Gmail + 2 Factor Authentication

Do you use email in FreeNAS?


  • Total voters
    93
Status
Not open for further replies.

Yatti420

Wizard
Joined
Aug 12, 2012
Messages
1,437
I've liked what Google has done security wise lately.. I use 2 factor authentication and wanted to use my Gmail for FreeNAS outgoing mail.. Didn't realize email could still be used with Gmail SMTP+2-factor authentication.. I did the following to enable..

1. Ensure Gmail/Google is functional as you desire with your desired settings.
2. Ensure IMAP is enabled within Gmail Settings.. ?
3. Within the Google Accounts Dashboard.. Access the "Manage Security Page"..
4. Within the security page - 2 factor authentication section click Manage your application specific passwords. Create an application specific password for your freenas box.. Copy it to the clipboard.. **Note: it will only be displayed once ** An email will be sent to your gmail account as a reminder you created this password..
5. Within the Settings>>Email Tab set the appropriate options to utilize gmail.. (See Image Attachment)
6. With Account>>Users>>>View Users>>"Root"- Set an email as indicated in attachment images..
7. Add email to SMART (S.M.A.R.T) settings... (Hint: Add 40 to critical field in SMART setup)
8. Wait for daily freenas email @ 3am local time daily..
9. Enjoy.

Poll included for usage input..
 

Attachments

  • emailsetup.png
    emailsetup.png
    16.2 KB · Views: 3,035
  • emailsetup1.png
    emailsetup1.png
    30.5 KB · Views: 2,597
  • emailsetup2.png
    emailsetup2.png
    42.4 KB · Views: 2,531

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Choosing to not setup email on your server means you should be logging in at regular intervals and manually checking smart, UPS, etc. After all, emails are how FreeNAS contacts you if something is wrong. I prefer to let it run and have it tell me if something is wrong.
 

Yatti420

Wizard
Joined
Aug 12, 2012
Messages
1,437
Would daily emails include UPS info? I don't see it but I don't use one currently.. I wanted to set this up to minimize the need for management if I was on the road.. As I have the system the way I want it at this point.. Security output is interesting.. A few rejected logins from the WAN..
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
I don't remember getting UPS emails, but I don't use the UPS function from within FreeNAS currently as I use ESXi.

I will warn you that some people have had a loss of power damage their zpool, so a UPS is highly recommended. It's not supposed to do that, and its coded to rollback any unfinished writes from a loss of power, but nonetheless some users have had it happen. It could have been the loss of power or something else that the loss of power exacerated. Tough to say.
 

Yatti420

Wizard
Joined
Aug 12, 2012
Messages
1,437
As a followup to my original post If I notice an IP I want blocked on the FreeNAS box could I put this in hosts.deny? It seems to have disapeared? No firewall in FreeNAS.. But can still use hosts file correct? I already blocked on my router etc.. Just wanted to go the extra mile..

I've been looking at a UPS but I don't want to get stuck with a non-compatible paperweight.. APC is the brand I know but seems pricey.. I may create a new hardware thread for recommendations in the future..
 

Dusan

Guru
Joined
Jan 29, 2013
Messages
1,165
Would daily emails include UPS info?
The UPS service has it's own e-mail settings. You need to set it up via Services -> UPS. It will send an e-mail anytime it loses connection with the UPS, the UPS switches to battery, ...
 

Yatti420

Wizard
Joined
Aug 12, 2012
Messages
1,437
For users wanting to control what FreeNAS sends in the daily email see Dusan's post here.

Yep I see it now.. What about blocking IPs within FreeNAS? I realize there is no firewall integrated.. Was hoping I could add to hosts with block.. I know I could create a jail and run a firewall or something similiar but seems overkill.. Should a firewall not be integrated into FreeNAS - is this in the roadmap?
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Well, what IPs are you trying to block? Some of the sharing protocols let you block IPs from the protocol.

I'm really not sure why you'd need to block IPs on a LAN.

Additionally, I have no clue what this has to do with the original thread topic... setting up emails.
 

Yatti420

Wizard
Joined
Aug 12, 2012
Messages
1,437
For users without the ability to block ips via router they should be able to via FreeNAS either a built-in firewall or via specific services etc.. I want to block the WAN IP that attempted to login..
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Then your router firewall should prevent that from happening. If you wish to continue this discussion please make a new thread as this is not related to email at all.
 

ECCfrenaslover

Explorer
Joined
Dec 27, 2013
Messages
89
I don't remember getting UPS emails, but I don't use the UPS function from within FreeNAS currently as I use ESXi.

I will warn you that some people have had a loss of power damage their zpool, so a UPS is highly recommended. It's not supposed to do that, and its coded to rollback any unfinished writes from a loss of power, but nonetheless some users have had it happen. It could have been the loss of power or something else that the loss of power exacerated. Tough to say.



Brother,

What recommendations do you have for a good UPS unit? One UPS unit per server? I have 3 servers. What say you?
thanks!
 

Yatti420

Wizard
Joined
Aug 12, 2012
Messages
1,437
I can confirm UPS emails work via gmail.. I'm assuming SMART will aswell.. Aswell as log outputs..
 

Radu

Dabbler
Joined
Mar 7, 2014
Messages
45
Please delete it was off topic
 

Yatti420

Wizard
Joined
Aug 12, 2012
Messages
1,437
I would verify everything is setup correctly.. I get mine with no issues..
 

Yatti420

Wizard
Joined
Aug 12, 2012
Messages
1,437
Not sure what to tell you.. If other emails work (hopefully) you wont have any problems.. Not getting a test email would bug me.. Junk/Spam catching it? What version of FreeNAS?

Code:
From:    myemail@gmail.com
to:    myemail@gmail.com
date:    Tue, Mar 18, 2014 at 1:48 AM
subject:    Test message from FreeNAS
mailed-by:    gmail.com
:    Important mainly because it was sent directly to you.
 

omcn7

Dabbler
Joined
May 19, 2015
Messages
20
I've liked what Google has done security wise lately.. I use 2 factor authentication and wanted to use my Gmail for FreeNAS outgoing mail.. Didn't realize email could still be used with Gmail SMTP+2-factor authentication.. I did the following to enable..

1. Ensure Gmail/Google is functional as you desire with your desired settings.
2. Ensure IMAP is enabled within Gmail Settings.. ?
3. Within the Google Accounts Dashboard.. Access the "Manage Security Page"..
4. Within the security page - 2 factor authentication section click Manage your application specific passwords. Create an application specific password for your freenas box.. Copy it to the clipboard.. **Note: it will only be displayed once ** An email will be sent to your gmail account as a reminder you created this password..
5. Within the Settings>>Email Tab set the appropriate options to utilize gmail.. (See Image Attachment)
6. With Account>>Users>>>View Users>>"Root"- Set an email as indicated in attachment images..
7. Add email to SMART (S.M.A.R.T) settings... (Hint: Add 40 to critical field in SMART setup)
8. Wait for daily freenas email @ 3am local time daily..
9. Enjoy.

Poll included for usage input..


I used this how to just recently. I am setting up a new NAS box and am still waiting for my SAS card to come from ebay. I set up SMART and sent a test email. Everything is working so far. Although I do not have any drives attached yet, so I can't report if the smart email alerts are working.

Thanks for the post!
 

diedrichg

Wizard
Joined
Dec 4, 2012
Messages
1,319
Status
Not open for further replies.
Top