0

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=?= <admin@example.com>
 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: <E1lyJ2C-00028k-9y@example.com>

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" <support@example.com>
List-Unsubscribe: <mailto:unsubscribe@example.com>, <https://www.example.com/unsubscribe/?c=3d9795e2646d156972cdf58655c758bd
Content-type: multipart/alternative;boundary=helio60db72e0c0005
Message-Id: <E1lyJJA-00036U-Px@example.com>
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!

Krydos
  • 11
  • 3
  • The single space at the beginning is called folding white space, and the contents of such lines are considered a continuation of the previous line. Thus that message has ONLY the headers MIME-Version (with a quite bizarre and probably invalid value) and Message-Id. Invision Community certainly does not do this, so the problem indeed is likely elsewhere. Why does this system use Exim? That's a very strange choice and rarely seen outside some niches such as mass web hosting. – Michael Hampton Jun 29 '21 at 21:22
  • The server is a cPanel server, and cPanel installed Exim. – Krydos Jun 29 '21 at 21:27
  • Aha. Then your next stop should be cPanel support. We actually do not accept questions about cPanel systems here. – Michael Hampton Jun 29 '21 at 21:28
  • Oh sorry. I didn't realize that. Thanks! – Krydos Jun 29 '21 at 21:29
  • @Krydos You should close your question, as it is considered off-topic here at Server Fault due to the installation of the web hosting control panel, but please return and ask questions on other topics. – Paul Jul 03 '21 at 00:33
  • I solved it myself by editing Invision's code, and it had nothing to do with cPanel. I'm obviously new here, but wouldn't it be better to have an accepted answer rather than deleting it entirely? – Krydos Jul 05 '21 at 04:41

1 Answers1

1

I was able to fix this issue by editing Invision's code and changing one occurrence of PHP_EOL to "\r\n". Hopefully they include my changes in future releases of their software.

Krydos
  • 11
  • 3