Set timeout and report errors for SMTP mails sent as part of a front end process #19033
Labels
Easier debugging
For issues that make troubleshooting issues for developers easier.
Stability
For issues that make Matomo more stable and reliable to run for sys admins.
Milestone
Matomo sends various emails as part of user interface processes, such as creating a new user or generating new auth tokens.
If there is a mail configuration issue then the email send may hang for longer that the web server request timeout, resulting in the UI action timing out with no error message provided. This can be very difficult to troubleshoot as it may not even be obvious that the user action has triggered a mail send.
PHPMailer has a 300 second default timeout for sending SMTP emails.
This is fine for scheduled tasks, but for email sends which will block a UI response it would be good to consider reducing this to less than 60 seconds and showing an error message.
Perhaps the Mail class could have a property that can be set to indicate that the mail is part of a blocking UI process and could then use a lower timeout and make any resulting error message available to the UI process.
See #19016
Expected Behavior
Current Behavior
Possible Solution
Steps to Reproduce (for Bugs)
Context
Your Environment
The text was updated successfully, but these errors were encountered: