Page 1 of 1

Contact form submissions come in MIME format

Posted: 26 Feb 2023, 08:08
by metallissimus
Yesterday I got a contact form submission that looked weiredly different than what I am used to.

Here's a test submission I sent to myself:
This is a multi-part message in MIME format.

--b1_G4btMXUsxrUpvPamvidDw9OpeVPiG5w62yZXzZq62vk
Content-Type: text/plain; charset=us-ascii

Von: Daniel Bollinger d.bollinger@gmx.de


Nachricht:

[url=sdfjhdgkfhjlkfulfpagehttps://hochzeiten.danielbollinger.de/kontakt/]sdfjhdgkfhjlkfulfpagehttps://hochzeiten.danielbollinger.de/kontakt/[/url]

--b1_G4btMXUsxrUpvPamvidDw9OpeVPiG5w62yZXzZq62vk
Content-Type: text/html; charset=us-ascii

<strong>Von:</strong> Daniel Bollinger <a href='mailto:d.bollinger@gmx.de'>d.bollinger@gmx.de</a>
<br>
<br>
<strong>Nachricht:</strong>
<br>
<br> sdfjhdgkfhjlkfulf<br><br><strong>page</strong><br>https://hochzeiten.danielbollinger.de/kontakt/


--b1_G4btMXUsxrUpvPamvidDw9OpeVPiG5w62yZXzZq62vk--
What happened?

This only happens here: https://hochzeiten.danielbollinger.de/kontakt/
Submissions from https://www.danielbollinger.de/kontakt/ are still normal.

Re: Contact form submissions come in MIME format

Posted: 26 Feb 2023, 09:48
by mjau-mjau
Did you get the test email from me? Did the same happen?

Can you try to create a new hidden page and just drop the standard "contact" template, and see what happens?
metallissimus wrote: Content-Type: text/plain; charset=us-ascii
This worries me slightly, as it should be UTF-8.

Optionally, it could be related to customized email "templates".

Re: Contact form submissions come in MIME format

Posted: 27 Feb 2023, 03:13
by metallissimus
I did get your message and set up a new page with just the contact form (simple), in both cases the same happened.

This is my mail template:
Code
<strong>Von:</strong> %name% <a href='mailto:%email%'>%email%</a>
<br>
<br>
<strong>Nachricht:</strong>
<br>
<br> %message%
I haven't touched that for ages, though.

Re: Contact form submissions come in MIME format

Posted: 27 Feb 2023, 03:18
by metallissimus
Is it possible I have shared too much information in the matomo forums and someone used that to mess with my site?

These are my threads there:
https://forum.matomo.org/t/unterschiedl ... -url/49964
https://forum.matomo.org/t/einstiegssei ... ackt/49979

Re: Contact form submissions come in MIME format

Posted: 27 Feb 2023, 04:06
by mjau-mjau
It must be something on the server, backend or your email client. From the contact page itself, everything gets sent correctly in UTF-8 without any additional junk:
Image
Code
Content-Type: text/plain; charset=us-ascii
I just saw this "text/plain" now. This is part of the email that is for email clients that don't render HTML. Maybe not important, as it's probably just including the entire raw email.
metallissimus wrote: Is it possible I have shared too much information in the matomo forums and someone used that to mess with my site?
Doubtful. You would have to share some kinda PHP/login access info. Besides, why would they just mess a bit with emails ...

I need panel login to diagnose more.

Re: Contact form submissions come in MIME format

Posted: 27 Feb 2023, 04:14
by metallissimus
mjau-mjau wrote: It must be something on the server, backend or your email client.
One change that came to mind (besides obviously the whole matomo thing): I updated to a new PHP version in the last days.

What's so strange to me is the fact that I am not aware of any difference between my two sites.

Re: Contact form submissions come in MIME format

Posted: 27 Feb 2023, 04:52
by mjau-mjau
Ok, so I did several tests editing the "mail body" and "response text", sending to my own email, but got the same result as you.

I then tried to change to enable the "use SMTP" option (using my own SMTP), and then it worked fine:
Image

This is definitely related to your servers own mail() mechanism. I'm actually surprised that you are using email without SMTP enabled, as most servers have disabled this and/or it just causes problems with spam and blacklisting. Sometimes servers have their own mail() mechanism enabled, but only when sending FROM a specific email (on the same domain), and sometimes only TO a specific email (on the same domain) ... This allows the server to be sure it's not sending spam on behalf of 3rd party emails.

Anyway, you can try to figure out why your server mail() is not formatting the email properly ... Or you can setup SMTP instead, which is always the recommended solution. I really don't know why your server is suddenly doing this, but something changed internally. Nothing changed with what X3 sends or how it sends it, as you know yourself you didn't edit anything, and as you can see in the screenshot, it works fine when changing the method for sending to SMTP.

Re: Contact form submissions come in MIME format

Posted: 27 Feb 2023, 05:06
by metallissimus
mjau-mjau wrote: I'm actually surprised that you are using email without SMTP enabled
To be honest, I simply didn't know how to set it up. But it's well documented with my host and turned out to be no problem at all.

Thank you so much!