Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SMTP Notification over SSL/TLS not working #1983

Closed
JasMan78 opened this issue Dec 8, 2017 · 7 comments
Closed

SMTP Notification over SSL/TLS not working #1983

JasMan78 opened this issue Dec 8, 2017 · 7 comments
Assignees
Labels
bug Production bug
Milestone

Comments

@JasMan78
Copy link

JasMan78 commented Dec 8, 2017

Hi,

The SMTP notification is not working with some providers or in generally when "Enable SMTP over SSL/TLS" is checked.

Dec 8 22:03:11 | opnsense: /system_advanced_notifications.php: Could not send the message to me@home.de -- Error: could not connect to the host "smtp.strato.de": ??
-- | --

When I disable SSL/TLS and use port 587 the notification will be send out.
My OPNsense vesion is OPNsense 17.7.9_8-amd64. I'm new with OPNsense so I don't know since which version this issue appears.

Because I've found a post in the German OPNsense forum which descripes the same behaviour with another provider, and the same issue in the pfSense bug list I think it could be also a bug in OPNsense.

German forum: https://forum.opnsense.org/index.php?topic=6263.msg26469#msg26469
pfSense bug: https://redmine.pfsense.org/issues/5604

Thank you.
Jas Man

@NOYB
Copy link
Contributor

NOYB commented Dec 14, 2017

Although the symptoms are similar to what some pfSense users experience. The causes are totally different.

In the OPNsense case it is caused by notices.smtp.inc: fsockopen being passed the IP address instead of domain name. Thus certificate validation fails.

To test, "$ip" can be replaced with "$domain" in the 2 fsockopen calls.

I just track this down a few minutes ago. So fresh off the press. Of course the SMTP server has to present a certificate that is trusted by the client (OPNsense). So if you signed your own, the CA will need to be added.

@AdSchellevis
Copy link
Member

We don't really use the notifications, there are only a few places left where they are triggered. Maybe monit is a better alternative to receive status messages.

@NOYB
Copy link
Contributor

NOYB commented Dec 18, 2017

Since it is available and being used it would seem appropriate for it to be functional. And secure.

As it stands SMTPS fails due to certificate being verified against IP address instead of domain.

And STARTTLS is open to MITM due to peer verifications being disabled. Perhaps that was done to accommodate the fsockopen using IP address instead of domain.

Passing $domain to fsockopen instead of $ip allows both SMTPS and STARTTLS (if verifications enabled) to establish secure connections.

@AdSchellevis
Copy link
Member

@NOYB in case you would like to work on a fix, certainly feel free to do so and offer a pull request.

@NOYB
Copy link
Contributor

NOYB commented Dec 18, 2017

More interested in the architect correcting the security hole they created. Already provided an outline of what needs to be done.

@fichtner fichtner self-assigned this Dec 18, 2017
@fichtner fichtner added the bug Production bug label Dec 18, 2017
@fichtner fichtner added this to the 18.1 milestone Dec 18, 2017
@fichtner fichtner modified the milestones: 18.1, 18.7 Jan 17, 2018
@fichtner
Copy link
Member

fichtner commented Feb 5, 2018

discussed here recently: https://forum.opnsense.org/index.php?topic=7165.0

@fichtner fichtner removed this from the 18.7 milestone Feb 27, 2018
@fichtner fichtner added this to the 18.7 milestone Jun 23, 2018
@fichtner fichtner modified the milestones: 18.7, 19.1 Jul 15, 2018
@fichtner
Copy link
Member

Overcome by #2919

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Production bug
Development

No branches or pull requests

4 participants