OPNsense Forum

English Forums => General Discussion => Topic started by: pcborges on July 15, 2016, 11:20:01 pm

Title: [SOLVED] Cannot send notification mail
Post by: pcborges on July 15, 2016, 11:20:01 pm
Hi, I am trying to set OPNSense to send email notification.
But when I click TEST SMTP I get the following message on System: Settings: Notifications

opnsense: /system_advanced_notifications.php: Could not send the message to pcborges@yahoo.com -- Error: could not connect to the host "smtp.gmail.com": ??

The OPNSense host is directly connected to the ISP and everything else works fine
I tried to swap the FQDN by the IP and the result was:

opnsense: /system_advanced_notifications.php: Could not send the message to pcborges@yahoo.com -- Error: could not connect to the host "64.233.186.109": ??

Thanks
Paulo Borges
Title: Re: Cannot send notification mail
Post by: bartjsmit on July 16, 2016, 08:28:41 am
Hi Paulo,

Google won't let you relay mail for Yahoo without authentication. Why don't you use Yahoo's SMTP host to send the notification? mta6.am0.yahoodns.net is one of their MTA's.

Bart...
Title: Re: Cannot send notification mail
Post by: pcborges on July 16, 2016, 12:56:19 pm
Hi Bart, thanks for you help.

I have checked that smtp.gmail.com will relay once you provide a valid gmail account and password as you say, but I do not even get that far.

opnsense reports it cannot even resolve smtp.gmail.com, I tried other smtp server I have email account and works with zabbix (I mean, works as a notification account at zabbix which is very similar to opnsense in that matter) and the message is the same, opnsense fails to "find" the smtp server even typing the smtp server's ip address.

Interfaces: Diagnostics: Ping    smtp.gmail.com works sucessfuly.

I also tested your suggestion with my Yahoo mail account and the result is as follows:

opnsense: /system_advanced_notifications.php: Could not send the message to pcborges@yahoo.com -- Error: could not connect to the host "mta6.am0.yahoodns.net": ??


Thanks
Paulo
Title: Re: Cannot send notification mail
Post by: bartjsmit on July 16, 2016, 03:52:11 pm
Hi Paulo,

Can you connect to the OPNsense console and try these:

nslookup -q=mx yahoo.com.
telnet mta6.am0.yahoodns.net 25

and report any errors?

Bart...
Title: Re: Cannot send notification mail
Post by: pcborges on July 17, 2016, 12:46:27 am
Hi Bart,

Thanks again for your support.

I just did the requested tests and took pictures as attached:

Regards
Paulo
Title: Re: Cannot send notification mail
Post by: pcborges on July 17, 2016, 12:47:15 am
Next picture of the required test
Paulo
Title: Re: Cannot send notification mail
Post by: bartjsmit on July 17, 2016, 09:09:28 am
Thanks Paulo,

That confirms that the firewall can resolve the Yahoo! mail host and you are able to connect to it with SMTP.

Have you tried with a different recipient address? E.g. gmail or outlook.com? There may be discrepancies between OPNsense and Yahoo!

Bart...
Title: Re: Cannot send notification mail
Post by: pcborges on July 17, 2016, 04:29:01 pm
Hi, thanks.

I just tried and got it to work with the following setup:

smtp server: smtp.gmail.com
Secure SMTP Connection:
   Enable STARTTLS with ports 587 
From e-mail address: cyberwatchbr@gmail.com
E-Mail address (destination): pcborges@yahoo.com
E-Mail auth username: cyberwatchbr@gmail.com
E-Mail auth password: *****

Thanks again for your valuable suppor.

Regards
Paulo Borges