I was having trouble figuring out why I couldn't send email via
127.0.0.1:25 only to figure out PHPMailer thinks my local Postfix accepts encryption.
To workaround this issue, I had to install my certificate within Postfix and access via
There is probably misconfiguration in my local Postfix, but shouldn't Matomo respect the STMP Encryption Method chosen? Which, in my case, is none.
Maybe we overlooked PHPMailer's
SMTPAutoTLS? I think it's enabled by default.
Whether to enable TLS encryption automatically if a server supports it, even if
SMTPSecureis not set to 'tls'.
Be aware that in PHP >= 5.6 this requires that the server's certificates are valid.
Edit: Add question about
Looking at the code there might be a regression indeed. @TylerVigario not sure if you configured mail in your
config/config.ini.php directly but it might be worth trying to edit it and setting
encryption = "". It looks like Matomo might assign
SMTPSecure setting in PHP Mailer and PHP Mailer might actually not understand this value.
encryption = "" to the
config/config.ini.php and the result was the same.
SMTP Error: Could not connect to SMTP host. ERROR [2020-12-23 23:52:35] 447576 Uncaught exception: /var/www/matomo/vendor/phpmailer/phpmailer/src/PHPMailer.php(2052): SMTP Error: Could not connect to SMTP host. SMTP Error: Could not connect to SMTP host.
connect from localhost[127.0.0.1] lost connection after STARTTLS from localhost[127.0.0.1] disconnect from localhost[127.0.0.1] ehlo=1 starttls=1 commands=2
I was mentioned before... You can check for more information.
@hahayidu Thanks for pointing out my failure to use the search feature. I guess Matomo developers have considered PHPMailer's
I would suggest that we adjust the SMTP Encryption Method default to "auto" and add a fourth option for "none" that will disable
SMTPAutoTLS. This will keep the same default security conscious approach while helping to clear things up.
I think below screen design covers all situations.
enum: [false, 'force', 'disabled', true],
'auto (uses STARTTLS if available)',
'force (requires STARTTLS or fail)',
'disabled (never use STARTTLS)',
description: 'whether the connection should use TLS',
description: 'ignore certificates error (e.g. self-signed certificate)',