matomo-org / matomo

Empowering People Ethically with the leading open source alternative to Google Analytics that gives you full control over your data. Matomo lets you easily collect data from websites & apps and visualise this data and extract insights. Privacy is built-in. Liberating Web Analytics. Star us on Github? +1. And we love Pull Requests!
https://matomo.org/
GNU General Public License v3.0
19.66k stars 2.62k forks source link

[Bug] E-mail reports are not displayed correctly #22516

Open lourdas opened 1 month ago

lourdas commented 1 month ago

What happened?

I've configured automated email reports for my Matomo installation for two sites. The e-mails are sent, but they are not displayed in Thunderbird:

Screenshot_20240819_181943

The email message size is not zero, the size for the e-mail at the above screenshot is 952KB.

The HTML message source code is something like this:

Screenshot_20240819_182229

The same result is when I send the e-mail reports manually from the administration interface.

I've also stumbled upon this PHP bug. Could this be somehow related?

My vps is a Linux server, with PHP 8.1.29 FPM and Apache 2.4.62.

What should happen?

The email reports should look fine in Thunderbird, like this:

Screenshot_20240819_185353

This is from another Matomo installation with PHP 8.1.29 too that I manage.

How can this be reproduced?

Can't really tell, since I don't know if this is PHP related or something else. This is an old installation from many years ago, but email reports used to work fine.

Matomo version

5.1.1

PHP version

8.1.29

Server operating system

Linux

What browsers are you seeing the problem on?

Not applicable (e.g. an API call etc.)

Computer operating system

Linux

Relevant log output

No response

Validations

des-innocraft commented 2 weeks ago

@lourdas thank you for raising this ticket. Can I ask if you still encounter the same issue on Thunderbird?

I tried replicating but got no luck:

Screenshot 2024-09-02 at 7 37 55 AM

If yes, can I ask what is the Thunderbird version you used? Also do you experience the same on other email apps?

lourdas commented 2 weeks ago

Hi @des-innocraft

This is Thunderbird 115.14.0. I administer another Matomo installation which is hosted in a different server and the e-mail reports are sent and displayed fine in the same Thunderbird installation:

image

So, I guess something must be configured incorrectly in the server.

Help is needed to debug this issue. What information do you need in this direction?

des-innocraft commented 1 week ago

@lourdas thank you for the reply. I assumed this only happens in one of your server. This might be a server configuration issue. Does this server has the same server configuration with the new installation on another server(where email works as expected)?

Can you export the email where the error happens ans we'll see if we can reproduce? Also, this error only happens on Thunderbird and not other mail app or webclient?

lourdas commented 1 week ago

@des-innocraft This is a screenshot of my web mail displayin the report:

image

Which is actually the source code of the message in Thunderbird:

image

(I'm showing the source code, since Thunderbird cannot decode the message properly and actually displays a blank page, see my initial message).

You write about exporting the email. What exactly do you mean?

des-innocraft commented 6 days ago

@lourdas thank you for your reply. What I meant for exporting the email is saving the email file and attached it here so we can try check and try to reproduce. Currently we are not able to reproduced and not aware of any existing issue like this. This maybe a rare case happening only on your instance.

Have you tried other mail client like Outlook to see if the emails are like this as well?

lourdas commented 6 days ago

I've attached the problematic report.

No, I haven't tried other mail clients besides Thunderbird and my webmail, but I highly doubt the client is the issue here. My Thunderbird installation works perfectly. The e-mails generated from this specific installation are the issue. report.zip