I'm using cPanel/WHM 96, CentOS 7.9.2009, PHP 8.0.7, Apache 2.4, and Exim 4.94.2.
When I send an email using the PHP mail() function in some code I wrote myself it send perfect multipart text/html emails that render correctly. When my Invision Community software sends an email it shows up as html code and the multipart boundaries aren't recognized. With the help of a nice guy over on serverfault he confirmed that the spaces I found at the start of the email headers would cause this.
Here is what my correct email headers look like:
Here's what the Invision Community emails look like. Note the single space in front of the From, Date, Auto-Submitted, and Content-Type headers:
The serverfault guy said that a space at the front of a line like that is called folding whitespace and it is interpreted to a continuation of the line above rather than a new header line.
So, now that we know what the problem is, does anyone have any ideas of how to fix this?
I already contacted Invision and they've never seen anything like this on any of their customers. I was looking at this How to Customize the Exim System Filter File | cPanel & WHM Documentation Would it be possible to write a filter that watches for this whitespace and removes it? It's really strange to me that the same php version and the same user and the same everything with my code produces perfect emails, but the Invision php code does this. Obviously, everything else being equal, my first reaction was to ask Invision, but after several hours of going back and forth they insist there is nothing wrong with their code and something is broken on my server. Anyone have any ideas? Thanks!
When I send an email using the PHP mail() function in some code I wrote myself it send perfect multipart text/html emails that render correctly. When my Invision Community software sends an email it shows up as html code and the multipart boundaries aren't recognized. With the help of a nice guy over on serverfault he confirmed that the spaces I found at the start of the email headers would cause this.
Here is what my correct email headers look like:
Code:
MIME-Version: 1.0
From: "Example" <[email protected]>
List-Unsubscribe: <mailto:[email protected]>, <https://www.example.com/unsubscribe/?c=3d9795e2646d156972cdf58655c758bd
Content-type: multipart/alternative;boundary=helio60db72e0c0005
Message-Id: <[email protected]>
Date: Tue, 29 Jun 2021 19:22:08 +0000
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
Code:
MIME-Version: 1.0
From: =?UTF-8?B?SGVsaW9OZXQ=?= <[email protected]>
Date: Tue, 29 Jun 2021 19:04:36 +0000
Auto-Submitted: auto-generated
Content-Type: multipart/alternative; boundary="--==_mimepart_3d7970817fa277e018f1936f5865d582"; charset=UTF-8
Content-Transfer-Encoding: 8bit
Message-Id: <[email protected]>
So, now that we know what the problem is, does anyone have any ideas of how to fix this?
I already contacted Invision and they've never seen anything like this on any of their customers. I was looking at this How to Customize the Exim System Filter File | cPanel & WHM Documentation Would it be possible to write a filter that watches for this whitespace and removes it? It's really strange to me that the same php version and the same user and the same everything with my code produces perfect emails, but the Invision php code does this. Obviously, everything else being equal, my first reaction was to ask Invision, but after several hours of going back and forth they insist there is nothing wrong with their code and something is broken on my server. Anyone have any ideas? Thanks!
Last edited by a moderator: