First of all, yes I have contacted Invision Community support. Yes, I am a paying user with an active license. We went back and forth for several hours and all they have to say is there's nothing wrong with their software, and I need to fix my server.
I'm using CentOS 7.9.2009, PHP 8.0.7, Apache 2.4.6, and Exim 4.94.2.
When Invision Communtiy sends emails the From: value says Apache or Root instead of the name of the forum, and the html part of the email just shows code instead of having a text part and an html part.
I also have php code that I wrote myself using the mail() function on the same server using the same version of php and everything that sends perfect multipart emails.
Comparing the source of an email sent by Invision and an email sent by my code I noticed that the From: header and the Content-Type: headers on the Invision email are indented in by one space, and those same headers on the emails sent by my code don't have any whitespace in front of them. Those headers seem to be ignored by the mail client. Here's what the source looks like:
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]>
Notice the single space in front of From, Date, Auto-Submitted, and Content-Type.
Here's what those headers look like on an email that displays correctly from the same server:
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
First of all, would these spaces cause the issues I'm seeing?
Second, if the spaces are the issue how do I go about fixing them?
Digging around in Invision's code it looks like they use PHP Pear Mail package https://pear.php.net/package/Mail Obviously it's probably a bad idea to edit Invision's code or Pear's code because any changes would likely be overwritten the next time I update. Are there any server settings I could change to fix this? Let me know if you need additional information and I'll edit in. Thanks!