After upgrading to 0.44 from a very old version (0.28), my web applications (running on a separate server) can no longer establish an SMTP connection to my MiaB server. It seems to be an issue around versions of TLS, or possibly specific ciphers missing on the client. My mail.log shows the following:
My web server is fairly out of date, but it does appear to be running a version of openssl that should support TLS1.2. The specific configuration is:
Ubuntu 16.04.2
OpenSSL 1.0.2g
PHP 7.0.33
I would try upgrading OpenSSL and PHP on the client machine, but I don’t want to risk breaking my production server right now if possible. Is there a way I can temporarily modify MiaB to fallback to an older version of TLS and see if this fixes the problem?
In general, it is a bad idea to use PHP for SMTP. You would be better off using something like Postfix, nullmailer, or any sendmail compliant MTA, and the PHP application should be using mail(), which calls sendmail (i.e., any sendmail complian MTA).
Yup, definitely what I need to do soon. But I don’t want to risk a cascade of dependency failures (openssl -> php -> our application, for example) on my live server when we are nowhere near ready to fully upgrade our application.
As a temporary patch until we can prepare our upgrade, I’ve made the following changes in MiaB to allow TLS1 and TLS1.1:
Edit /etc/postfix/main.cf:
Change the smtpd_tls_mandatory_protocols and smtp_tls_mandatory_protocols to:
Speaking as the maintainer of PHPMailer, it’s generally preferable to send from PHP using SMTP (though you should still use a local relay) as opposed to using PHP’s built-in mail() function, which is inherently unsafe, slower, and harder to debug problems with.
For your particular problem, I’d say it is down to the TLS library linked to your PHP instance.
Speaking as a former user of PHPMailer, I was unable to get it to send anything other than in the clear, so I gave up using it and assumed it to be insecure.