Sw33tCode

Smart code for developers

Sw33tCode header image 2

Setting up FreeNAS to use gmail for email service

April 1st, 2011 · 8 Comments


If you choose to use FreeNAS S.M.A.R.T service then you will want to make sure you have an email service to use for sending emails. I choose to use gmail for this service since it’s rocks. This explains what settings to use.

  1. Using the FreeNAS WebGUI go to System -> Advanced and select the Email tab.
  2. Fill in the following fields:
    1. From Email: youremail@gmail.com
    2. Outgoing Mail Server: smtp.gmail.com
    3. Port: 465
    4. Security: SSL
    5. Authentication: Check Enable SMTP Authentication
    6. Username: youremail@gmail.com
    7. Password: xxxxxxxx
    8. Authentication Method: Login

Once this is done send yourself a test email by clicking the button and you should have no issue getting an email….. however….

I did have an issue where it couldn’t find the server smtp.gmail.com which appeared to be a dns issue. To fix this I appended google’s dns server to my /etc/resolv.conf (which unfortunately this files gets overridden after every reboot, but it didn’t matter since this command kicked it in the butt to get it working).

If you go into System -> Advanced menu, there is option to set commands to be executed after every reboot. I just added new postinit command:

echo "nameserver 8.8.8.8" >> /etc/resolv.conf

Please let me know if you have any questions. Thanks!

Tags: freenas

8 responses so far ↓

  • 1 Jerry // Feb 13, 2012 at 3:23 am

    Thank you. saved me trouble… also if you have a dual authentication with google, you must make an application specific password for this.

  • 2 Sygrael // Nov 9, 2013 at 5:22 pm

    Thanks for the tip it help me a lot :)

  • 3 Jason // Jun 22, 2014 at 1:40 am

    In order for this to work the root email address must be set. What’s not immediately obvious is that mail is sent to root using the account specified in Settings. So two things required, settings as described in the post above and the root’s email address.

  • 4 iimki // Feb 5, 2015 at 1:16 pm

    Thanks for the tip this worked for me with a little modification on the G-mail side. I had to change Gmail to accept less secure apps.

  • 5 gustavo // Sep 17, 2015 at 5:00 pm

    THANKS

  • 6 Wayne // Sep 29, 2015 at 5:11 am

    Google have tightened up on their security. You need to lower the security to get this to work now:

    https://www.google.com/settings/security/lesssecureapps

    Good reason to get a second account just for this?

  • 7 Vitor Ribas // Dec 28, 2015 at 7:32 pm

    Caso o acesso seja recusado pelo Google ative a opção de aplicativos menos seguros!

  • 8 Joel // Dec 29, 2015 at 1:51 pm

    I had to set Google to use less secure apps, then I was able to send email:
    https://support.google.com/mail/answer/78754 y1sm19492855oes.5

Leave a Comment

*