Unable to get e-mail alerts working

Status
Not open for further replies.

Shankage

Explorer
Joined
Jun 21, 2017
Messages
79
Hi all,

I have been tearing my hair out trying to get this working and i have followed the guide here: https://forums.freenas.org/index.ph...-getting-freenas-to-email-you-in-gmail.22517/.

Other things i have tried:
  1. - Tried with mailgun
  2. - Tried with Easy-SMTP

All attempts ended with this error: "Your test email could not be sent: SMTP AUTH extension not supported by server."

Which leads me to think that it is not a mail configuration issue, but something else on the server?

Any thoughts?

Cheers
 

Hazimil

Contributor
Joined
May 26, 2014
Messages
172
I had a problem like this, I fixed it by ensuring the "from email" under System, Email is the email address of the email account you are using, and not the default email address FreeNAS has.

Perhaps try that to see if it works?

Jonathan
 

Shankage

Explorer
Joined
Jun 21, 2017
Messages
79
I had a problem like this, I fixed it by ensuring the "from email" under System, Email is the email address of the email account you are using, and not the default email address FreeNAS has.

Perhaps try that to see if it works?

Jonathan

Thanks for the tip! But it is definitely using the right email address.
 

Spearfoot

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

I have been tearing my hair out trying to get this working and i have followed the guide here: https://forums.freenas.org/index.ph...-getting-freenas-to-email-you-in-gmail.22517/.

Other things i have tried:
  1. - Tried with mailgun
  2. - Tried with Easy-SMTP

All attempts ended with this error: "Your test email could not be sent: SMTP AUTH extension not supported by server."

Which leads me to think that it is not a mail configuration issue, but something else on the server?

Any thoughts?

Cheers
You're using a gmail account?
 

Spearfoot

He of the long foot
Moderator
Joined
May 13, 2015
Messages
2,478
Post the file /var/log/maillog in code tags. Also, post the output of grep smtp /var/log/debug.log, again in code tags.
 

Shankage

Explorer
Joined
Jun 21, 2017
Messages
79
Post the file /var/log/maillog in code tags. Also, post the output of grep smtp /var/log/debug.log, again in code tags.
Code:
Aug  3 14:41:47 Freenas1 newsyslog[1581]: logfile first created


And there was nothing in the second log!
 

Spearfoot

He of the long foot
Moderator
Joined
May 13, 2015
Messages
2,478
Code:
Aug  3 14:41:47 Freenas1 newsyslog[1581]: logfile first created


And there was nothing in the second log!
Run the email test again (under System->Email) and see if you get anything in the maillog file.
 

Spearfoot

He of the long foot
Moderator
Joined
May 13, 2015
Messages
2,478
Any ideas what i could try?
For a start... please post your full system specifications, per the Forum rules.

How is your network set up? Have you specified a good default gateway and nameserver in Network->Global Configuration? What brand and model of gateway/router/switch are you using?

Please post the output of ifconfig in code tags.

Can you successfully ping any external servers from a FreeNAS shell session? In particular, can you ping the mail server(s) you're trying to use? Examples: ping www.google.com and ping smtp.gmail.com.

Does the file /var/log/maillog exist on your system? If it's missing or empty (as you implied above) that's cause for concern.
 

Shankage

Explorer
Joined
Jun 21, 2017
Messages
79
For a start... please post your full system specifications, per the Forum rules.

How is your network set up? Have you specified a good default gateway and nameserver in Network->Global Configuration? What brand and model of gateway/router/switch are you using?

Please post the output of ifconfig in code tags.

Can you successfully ping any external servers from a FreeNAS shell session? In particular, can you ping the mail server(s) you're trying to use? Examples: ping www.google.com and ping smtp.gmail.com.

Does the file /var/log/maillog exist on your system? If it's missing or empty (as you implied above) that's cause for concern.

System:
Super Micro - X9DR3-F
Intel(R) Xeon(R) CPU E5-2630 v2 @ 2.60GHz
128GB RAM
SATA DOM 120gb - Freenas OS
PCI SSD 400GB - SLOG
8 x 4 TB SATA HDD's in 4 mirrors
LSI 9300-8i HBA
Currently using the onboard NIC, but will be moving to an Intel X550T Dual 10gb NIC

Network:
Freenas server is connected to the distribution layer switch stack and internal OSPF is enabled on the network.
The gateway it is pointing to is the SVI for the vlan it is on, until our DNS server is back up i am using 8.8.8.8 for DNS.
Running two nics in a LAG on freenas using load balance.

Distribution layer is a stack of Dell 3048's
Core / Gateway is a Sophos XG

IFconfig:
Code:
root@FREENAS1:~ # ifconfig
vmx0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
		options=60039b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,TS																																											 O6,RXCSUM_IPV6,TXCSUM_IPV6>
		ether 00:0c:29:46:45:5c
		hwaddr 00:0c:29:46:45:5c
		inet 10.15.63.30 netmask 0xffffffc0 broadcast 10.15.63.63
		nd6 options=9<PERFORMNUD,IFDISABLED>
		media: Ethernet autoselect
		status: active
vmx1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 9000
		options=60039b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,TS																																											 O6,RXCSUM_IPV6,TXCSUM_IPV6>
		ether 00:0c:29:46:45:66
		hwaddr 00:0c:29:46:45:66
		nd6 options=9<PERFORMNUD,IFDISABLED>
		media: Ethernet autoselect
		status: active
vmx2: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 9000
		options=60039b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,TS																																											 O6,RXCSUM_IPV6,TXCSUM_IPV6>
		ether 00:0c:29:46:45:66
		hwaddr 00:0c:29:46:45:70
		nd6 options=9<PERFORMNUD,IFDISABLED>
		media: Ethernet autoselect
		status: active
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
		options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
		inet6 ::1 prefixlen 128
		inet6 fe80::1%lo0 prefixlen 64 scopeid 0x4
		inet 127.0.0.1 netmask 0xff000000
		nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
		groups: lo
lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 9000
		options=60039b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,TS																																											 O6,RXCSUM_IPV6,TXCSUM_IPV6>
		ether 00:0c:29:46:45:66
		inet 10.55.0.2 netmask 0xfffffffc broadcast 10.55.0.3
		nd6 options=9<PERFORMNUD,IFDISABLED>
		media: Ethernet autoselect
		status: active
		groups: lagg
		laggproto loadbalance lagghash l2,l3,l4
		laggport: vmx1 flags=4<ACTIVE>
		laggport: vmx2 flags=4<ACTIVE>



Code:
root@FREENAS1:~ # ping www.google.com
PING www.google.com (216.58.193.68): 56 data bytes
64 bytes from 216.58.193.68: icmp_seq=0 ttl=52 time=33.071 ms
64 bytes from 216.58.193.68: icmp_seq=1 ttl=52 time=13.108 ms
64 bytes from 216.58.193.68: icmp_seq=2 ttl=52 time=35.046 ms
64 bytes from 216.58.193.68: icmp_seq=3 ttl=52 time=28.823 ms
64 bytes from 216.58.193.68: icmp_seq=4 ttl=52 time=23.365 ms



Code:
root@FREENAS1:~ # ping smtp.gmail.com
PING gmail-smtp-msa.l.google.com (74.125.28.108): 56 data bytes
64 bytes from 74.125.28.108: icmp_seq=0 ttl=43 time=25.197 ms
64 bytes from 74.125.28.108: icmp_seq=1 ttl=43 time=19.765 ms



The log file does exist, but is still empty.

Code:
Aug  3 19:26:26 FREENAS1 newsyslog[1688]: logfile first created
 

Spearfoot

He of the long foot
Moderator
Joined
May 13, 2015
Messages
2,478
Everything looks good! Puzzling that you can't get email to work...

Try running this script - you'll need to edit it and assign your email address to the testemail variable:
Code:
#!/bin/sh

testemail=--- SPECIFY YOUR EMAIL ADDRESS HERE ---
mailfile=/tmp/email-test.txt

(
  echo "From: root"
  echo "To: ${testemail}"
  echo "Subject: Email test"
  echo "Content-Type: text"
  echo "MIME-Version: 1.0"
  printf '\r\n'
  echo "Test message"
) > "$mailfile"

sendmail -t -oi < "$mailfile"
rm "$mailfile"
This should send you a simple email message and add some entries like these to your /var/log/maillog file:
Code:
Aug  4 12:51:44 bandit /find_alias_for_smtplib.py[64803]: sending mail to -oiFrom: root
To: noname@spearfoot.net
Subject: Email test
Content-Type: text
MIME-Version: 1.0


Test message
Aug  4 12:51:45 bandit /find_alias_for_smtplib.py[64803]: sending mail to noname@spearfoot.netContent-Type: text
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Subject: Email test
From: freenas.bandit@spearfoot.net
To: noname@spea
FYI, noname@spearfoot.net is the value I assigned to the testemail script variable, and freenas.bandit@spearfoot.net is the email account I set up under System->Email.

Note that my FreeNAS system truncates part of the target email name in the log, similar to what you described earlier. No idea why, but for our purposes it doesn't matter.
 

Shankage

Explorer
Joined
Jun 21, 2017
Messages
79
Done, and the log populated, however still didn't get any emails.

I changed the variable the second time I ran it as i hadn't taken out the dashes lol..

Code:

Code:
root@FREENAS1:~ # cat /var/log/maillog
Aug  3 19:26:26 FREENAS1 newsyslog[1688]: logfile first created
Aug  4 11:20:43 FREENAS1 /find_alias_for_smtplib.py[9035]: sending mail to -oi
From: root
To:
Subject: Email test
Content-Type: text
MIME-Version: 1.0

Test message
Aug  4 11:22:06 FREENAS1 /find_alias_for_smtplib.py[9241]: sending mail to -oi
From: root
To: emailaddress@domain.here
Subject: Email test
Content-Type: text
MIME-Version: 1.0

 

Spearfoot

He of the long foot
Moderator
Joined
May 13, 2015
Messages
2,478
...snip...
All attempts ended with this error: "Your test email could not be sent: SMTP AUTH extension not supported by server."
...snip...
Oh, snap! I just read back over the thread and saw this in your original post!

We're not going to get anywhere until you get basic 'send email' functionality working under System->Email. How have you configured these settings?
 

Shankage

Explorer
Joined
Jun 21, 2017
Messages
79
Oh, snap! I just read back over the thread and saw this in your original post!

We're not going to get anywhere until you get basic 'send email' functionality working under System->Email. How have you configured these settings?

From Email: my gmail accound
Outgoing: smtp.gmail.com
Port: 587
TLS
Use SMTP Auth: Checked
Username: same email as above
password: password for the account
 

Spearfoot

He of the long foot
Moderator
Joined
May 13, 2015
Messages
2,478
From Email: my gmail accound
Outgoing: smtp.gmail.com
Port: 587
TLS
Use SMTP Auth: Checked
Username: same email as above
password: password for the account
Does it still fail when you run the email test?
 

Spearfoot

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

Shankage

Explorer
Joined
Jun 21, 2017
Messages
79
My personal account has allow unsecure apps, i also tried the two factor approach. Still couldn't get past this error!

Tried with SSL and get the following:
  • Your test email could not be sent: [SSL: UNKNOWN_PROTOCOL] unknown protocol (_ssl.c:749)
 
Status
Not open for further replies.
Top