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
Error when sendig email report after upgrading to 4.11 #19633
Comments
Hi @x97-epe, thanks for reaching out. If the console test-email command is successfully sending emails then it seems unlikely there is an issue with the Matomo email configuration. As far as I can see there haven't been any recent changes relating to mail delivery. I've also tested the 'Personal > Email Reports > Send Report Now' function and it's working for me. "Could not instantiate mail function." is a generic message returned by PHPMailer when it is unable to deliver the mail to the system mail transport agent, which would match up with the lack of postfix activity. A few things to try:
|
Hi bx80! Thanks for feedback. It seems to me PHP and email sub-system (postfix) are properly configured and work. In fact:
The problem seem to be connected to sending email via web-admin.
I actually find another similar report in forum when searching for "error crating new users": It could be that email issues existed before 4.11, but we have not noticed it. I open present issue following a report my our web team complaining they failed to notify new users... |
Hi @x97-epe, thanks for the extra information 👍 I've checked the 'Send Report Now' and 'Invite User' web admin functions and they are using the same underlying code to send mail as the Typically the web server will not be running as the same Linux user as one used for scheduled reports (cronjob) and console commands, so different user permissions might an issue. From your tests we know that the PHP mail() command and system mail subsystem are working, it would be good to also confirm that the web server user can successfully send test emails. Could you try to run the test email command as the web server user? (assuming the web server user is apache2 on RHEL)
|
Hi! I double check and process for httpd and php-fpm on RHEL8 run as user "apache". I run
And it worked as expected. |
Ok... I got it! It was SELINUX... So obvious (now), but somehow I miss it. I finally noticed the logs generated into audit logs, I set SELINUX in permissive mode and emails are now sent via web... When set SEpolicy "httpd_can_sendmail" it works also with enable (enforcing) SELinux. Problem happened since such config was supposed to be already fix on server ("bug" into Ansible playbook script), and we notice issue at "wrong time" (i.e. right after Matomo update) No problem with Matomo, case closed. |
Glad you got it sorted! Thanks for letting us know 🙂 |
This issue has been mentioned on Matomo forums. There might be relevant details there: https://forum.matomo.org/t/matomo-no-send-mail-for-invite-a-new-user/50150/4 |
After upgrading Matomo from 4.10.1 to 4.11.0 system fails sending email report.
System is configured to send email using PHP build in-mail function.
Email troubleshooting:
$ ./console core:test-email <myemailaddress>
succeed (no kind of error/warning, and email is regularly received). Instead sending report via admin web-page (Personal Email Reports => Send-Report-now) fails with generic error:
"An error occurred while sending 'HTML Email Report - 2.yesterday.1.en - XXXXX.html' to . Error was 'Could not instantiate mail function.'"
Original Matomo installation was 4.9 and then further updated. Problem is new since update to 4.11.0.
Please note:
config.ini.php seems correct with expected config (including noreply_email_address) and Matomo diagnostic does not report any kind of problem.
Has such behavior been noticed by others? Any further troubleshooting step to be performed? In the way problem appeared it seems related to performed upgrade.
The text was updated successfully, but these errors were encountered: