Unable to get e-mail alerts working

Status
Not open for further replies.

Spearfoot

He of the long foot
Moderator
Joined
May 13, 2015
Messages
2,478

Shankage

Explorer
Joined
Jun 21, 2017
Messages
79
Same here!

I've done that a few times now and tested with other email services, so was wondering if i missed something within the settings!
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
You will have to set up 2FA for it and get an app password to get it to work. Google changed their API a while back and it broke a lot of apps.

I had gmail set up on my forum and it broke that too. I tried the less secure app route and it wouldn't work no matter what I did. Ended up switching the forum to mailgun to resolve it.
 

Shankage

Explorer
Joined
Jun 21, 2017
Messages
79
You will have to set up 2FA for it and get an app password to get it to work. Google changed their API a while back and it broke a lot of apps.

I had gmail set up on my forum and it broke that too. I tried the less secure app route and it wouldn't work no matter what I did. Ended up switching the forum to mailgun to resolve it.


Hmm, that's very strange. As i tried with 2FA and with mailgun and still got the same SMTP Auth error.
 

Spearfoot

He of the long foot
Moderator
Joined
May 13, 2015
Messages
2,478
I just checked my google account...

Go to My Account->Sign-in & security, then scroll down to the Signing in to Google section, where you'll see App passwords under Password & sign-in method. Select App passwords.

The system will verify your password before proceeding. Once you get to the App passwords form, generate a new password for your FreeNAS server. I did this just now, using this form:
google-email-app.jpg

I selected 'Mail' as the app and 'Other (Custom name)' for the device, which I named 'FreeNAS', then I clicked the Generate button. The system generated and displayed a 16-character password, along with instructions:
google-email-app-password.jpg

I would try using this password in the System->Email settings on your FreeNAS server... and give it a shot!

Let us know if this works... good luck!
 

Shankage

Explorer
Joined
Jun 21, 2017
Messages
79
Tried that again and got the same result. I have attached the screenshot.

But the maillog has this now:
Code:
Aug  8 00:00:00 FREENAS1 newsyslog[83441]: logfile turned over
Aug  8 03:01:03 FREENAS1 /find_alias_for_smtplib.py[90888]: sending mail to rootTo: root
Subject: FREENAS1.local daily security run output


FREENAS1.local login failures:
Aug  7 19:59:22 FREENAS1 sshd[74143]: Invalid us
 

Attachments

  • Freenas.png
    Freenas.png
    12.8 KB · Views: 314

Shankage

Explorer
Joined
Jun 21, 2017
Messages
79
Snipping from the debug.log

Code:
97, in _get_smtp_server
  File "/usr/local/lib/python3.6/smtplib.py", line 1029, in __init__
  File "/usr/local/lib/python3.6/smtplib.py", line 251, in __init__
  File "/usr/local/lib/python3.6/smtplib.py", line 335, in connect
  File "/usr/local/lib/python3.6/smtplib.py", line 1037, in _get_socket
	server = _get_smtp_server()
  File "/usr/local/www/freenasUI/tools/../../freenasUI/common/system.py", line 2																																											 07, in _get_smtp_server
  File "/usr/local/lib/python3.6/smtplib.py", line 696, in login
smtplib.SMTPNotSupportedError: SMTP AUTH extension not supported by server.

 

Spearfoot

He of the long foot
Moderator
Joined
May 13, 2015
Messages
2,478
Snipping from the debug.log

Code:
97, in _get_smtp_server
  File "/usr/local/lib/python3.6/smtplib.py", line 1029, in __init__
  File "/usr/local/lib/python3.6/smtplib.py", line 251, in __init__
  File "/usr/local/lib/python3.6/smtplib.py", line 335, in connect
  File "/usr/local/lib/python3.6/smtplib.py", line 1037, in _get_socket
	server = _get_smtp_server()
  File "/usr/local/www/freenasUI/tools/../../freenasUI/common/system.py", line 2																																											 07, in _get_smtp_server
  File "/usr/local/lib/python3.6/smtplib.py", line 696, in login
smtplib.SMTPNotSupportedError: SMTP AUTH extension not supported by server.

Again... I'm out of ideas! :oops:

I set up my 'test' server with my gmail account ({user}@gmail.com) and the password I created as described above and it worked for both TLS on port 587 and SSL on port 465 when hitting smtp.gmail.com.

Have you checked at Google to make sure your account isn't blocked or some such?

EDIT: More info from Google:
gmail-sending.jpg
 

Shankage

Explorer
Joined
Jun 21, 2017
Messages
79
Again... I'm out of ideas! :oops:

I set up my 'test' server with my gmail account ({user}@gmail.com) and the password I created as described above and it worked for both TLS on port 587 and SSL on port 465 when hitting smtp.gmail.com.

Have you checked at Google to make sure your account isn't blocked or some such?

EDIT: More info from Google:
View attachment 19832


As far as I know my account is ok, as i use it daily. SSL definitely doens't work for me with error "Your test email could not be sent: [SSL: UNKNOWN_PROTOCOL] unknown protocol (_ssl.c:749)".

I've definitely tested the above! This account is part of a domain and we use G Suite, would that have something to do with it ?
 

Spearfoot

He of the long foot
Moderator
Joined
May 13, 2015
Messages
2,478
As far as I know my account is ok, as i use it daily. SSL definitely doens't work for me with error "Your test email could not be sent: [SSL: UNKNOWN_PROTOCOL] unknown protocol (_ssl.c:749)".

I've definitely tested the above! This account is part of a domain and we use G Suite, would that have something to do with it ?
I believe it has everything to do with it.

According to my understanding of the G Suite info below, you need a static IP and should use a different SMTP host (smtp-relay.gmail.com).

https://support.google.com/a/answer/176600?hl=en
 

Shankage

Explorer
Joined
Jun 21, 2017
Messages
79
Hmm i tried using that host, it didn't seem to work. But oddly enough it doesn't work for one of my standard gmail accounts either.
 

Spearfoot

He of the long foot
Moderator
Joined
May 13, 2015
Messages
2,478
Hmm i tried using that host, it didn't seem to work. But oddly enough it doesn't work for one of my standard gmail accounts either.
Do you have a static IP at your site? I imagine you need to set IP up on Google, as it authenticates by IP address.

I don't mean a static IP on your FreeNAS server on your local LAN; I mean a static WAN IP provided by your ISP.
 

Spearfoot

He of the long foot
Moderator
Joined
May 13, 2015
Messages
2,478
Even for a non G suite account?
For non-G? No. That's what I have, and -- as I mentioned above -- it works fine, using TLS/SSL and SMTP server smtp.gmail.com.
 

Shankage

Explorer
Joined
Jun 21, 2017
Messages
79
Alright attempted the above with my personal account.

Same error message and the logs aren't updating by the looks of it. It still has the old email address as the last log entry in maillog.
 

Shankage

Explorer
Joined
Jun 21, 2017
Messages
79
I've been able to get HipChat alert services working, in terms of error messages and content will I be missing out on anything that would be coming through email?
 
Status
Not open for further replies.
Top