[SOLVED] system_advanced_notifications.php Could not send the message.

Started by rost, April 06, 2015, 10:52:58 AM

Previous topic - Next topic
opnsense: /system_advanced_notifications.php: Could not send the message to username@mydomain.com -- Error: could not connect to the host "smtp.gmail.com": ??

How to debug this issue?
What is "could not connect"? Wrong password, wrong smtp serv, wrong port, ... ???

Hi,

It might be that your firewall on the WAN site is blocking smtp traffic, the first thing you should check is if you have a rule on the wan interface allowing smtp (port 25) traffic to the outside world from your firewalls ip address.
If your firewall is open and it still doesn't work, you could test the connectivity from the box itself (using a ssh shell or terminal connection) by starting a telnet connection to gmail:

telnet smtp.gmail.com 25


It should say something like this :

220 mx.google.com ESMTP 12gaygddfasdf - gsmtp



same error? is there any other lead in the log? It might be that gmail is blocking your mails (header issues), but I expect a little more info in the logs then.

opnsense: /system_advanced_notifications.php: Could not send the message to username@domain.com -- Error:
no more additional info in log

use
smtp.gmail.com  port 25
STARTTLS
E-Mail auth username and E-Mail auth password

Found the issue, it's suppressing this warning:

Warning: stream_socket_enable_crypto(): Peer certificate CN=`smtp.gmail.com' did not match expected CN=`173.194.65.108' in /usr/local/etc/inc/notices.smtp.inc on line 609

I will push a fix later (we're in a release cycle at the moment, so git is currently frozen).

When this part is fixed, the log tells me "530-5.5.1 Authentication Required. Learn more a", and when putting in credentials for my gmail account google starts complaining about a untrusted client.
I guess when you change your gmail settings it will probably work.



Hi, What do I have to do?
Do I change something on the src/etc/inc/notices.smtp.inc?
Do I have to replace the entire file?
Thanks

You replied to a thread from two years ago. I'm assuming all the fixes reached version 17.1 so there is no need to manually do anything. Is there anything else in the logs that might help pinpoint this?

Hi, I took some time to test the problem again.
I just installed a test PC with the OPNsense 17.1.5-i386
Set system/settings/notification as below:

server: smtp.gmail.com
port: 587
check Enable STARTTLS
sender: cyberwatchbr@gmail.com
destination: pcborges@yahoo.com
Email auth username: cyberwatchbr@gmail.com
Email auth pass: *****

This setup used to work well.
Now, when I click TEST SMTP I get no mail and the following log entry:

OPNsense opnsense: /system_advanced_notifications.php: Could not send the message to pcborges@yahoo.com -- Error: 534-5.7.14 EX4zifEE_WoNFn8Jfrfj4sQVPTi8TBcSEWDvtyxfFcF4w78dqVm8sCYWvDGxYvuxu4BkQW

Thanks
Paulo Borges