Setting up email alerts is a smart way of making sure nothing unexpected happens on a FreeNAS server without knowing about it or having to check the UI every now and then. A "should be straigthforward" way ough to be setting up a gmal account as the outgoing email. Nevertheless, it is not as simple as clicking "yeah, sure, email me".
Objective
Get a working E-Mail notification from FreeNAS by using a Gmail E-Mail address for sending the messages.
Overview
FreeNAS needs an smtp server and corresponding E-Mail account credentials to send E-Mails. E-Mails cannot be sent directly from within FreeNAS without an E-Mail server. Additionally, using a Gmail address with the corresponding account password does not work either. The steps to get such a setup running are briefly as follows,
- Get a Gmail E-Mail address,
- Allow "App password" access to the E-Mail account, and
- Set up FreeNAS E-Mail service.
Settings in the Google account
This is the first step in configuring sending E-Mails through a gmail account. Basically, a new App passsword is required for FreeNAS. Connecting and sending emails via the username and password merely did not work in my case, not even when enabling "Allow less secureapps". So to properly set up access the following needs to be done,
- Log in to the Google account.
- Go to Security.
- Enable 2 Factor Authentication (this is required for step 4!).
- Once 2 Factor Authentication is enabled, an option becomes avilable to create App passwords.
- Create a new App password and copy it to the clipboard.
Once this is done, the settings from Gmail side are complete.
Settings in FreeNAS
- Go to System/Email and adjust the settings according to the details below.
From E-Mail: ChooseItToYourLiking
Outgoing Mail Server: smtp.gmail.com
Mail Server Port: 465
Security: SSL (Implicit TLS)
SMTP Authentication: Ticked
Username: example@gmail.com
Password: YourAppPassword
Once this is done, a test E-Mail can be sent by clicking "SEND EMAIL". If all above steps were followed, a test notification wil arrive in the E-Mail box associated with the root user (!). Following this, an alert service can be set up as well. Without too much details,
- Go to System/Alert Services.
- Click "Add" and choose Type/Email.
- Fill out your email address and click "SEND TEST ALERT".
This should be working now as well and the type of alerts cn be configured based on user needs.
No comments:
Post a Comment