2023-07-02, 10:00 PM
MyBB Version 1.8.34
PHP Version 8.0.29
SQL Engine MySQLi 8.0.33
This is a plain english default installation without any plugins.
I was able to find why no email was able to be sent from anywhere in the MyBB forum.
Inside the file "/inc/mailhandlers/php.php" I must delete two variables from the mail() function to allow it to work.
The line :
Was replaced with :
There is something wrong with the content of "$this->headers" .
The variable "$this->additional_parameters" was also used because there is NO safemode variable in the php.ini file.
Hope you can find the issue with the "headers", because from what I got from it, it seem quite OK :
All addresses were hidden with " *** "
I have found the problem, the headers lines are not separated with CRLF (\r\n), it seem the mailhandler delimiter is changed somewhere else in the code.
PHP ask for a CRLF (\r\n) separator between those lines...
This is the section where the delimiter is wrongly changed in the file "/inc/mailhandlers/php.php" :
This is causing the PHP mail() silent error!
PHP Version 8.0.29
SQL Engine MySQLi 8.0.33
This is a plain english default installation without any plugins.
I was able to find why no email was able to be sent from anywhere in the MyBB forum.
Inside the file "/inc/mailhandlers/php.php" I must delete two variables from the mail() function to allow it to work.
The line :
$sent = @mail($this->to, $this->subject, $this->message, trim($this->headers), $this->additional_parameters);
Was replaced with :
$sent = @mail($this->to, $this->subject, $this->message);
There is something wrong with the content of "$this->headers" .
The variable "$this->additional_parameters" was also used because there is NO safemode variable in the php.ini file.
Hope you can find the issue with the "headers", because from what I got from it, it seem quite OK :
From: "Forums" < *** @ *** .com>
Return-Path: MyBBFR < *** @ *** .support>
Reply-To: MyBBFR < *** @ *** .support>
Message-ID: <afbfe40ee3d3e0de1876bbfefbf90071@www. *** .fr>
Content-Transfer-Encoding: 8bit
X-Priority: 3
X-Mailer: MyBB
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
All addresses were hidden with " *** "
I have found the problem, the headers lines are not separated with CRLF (\r\n), it seem the mailhandler delimiter is changed somewhere else in the code.
PHP ask for a CRLF (\r\n) separator between those lines...
This is the section where the delimiter is wrongly changed in the file "/inc/mailhandlers/php.php" :
if($this->sendmail)
{
$this->headers = str_replace("\r\n", "\n", $this->headers);
$this->message = str_replace("\r\n", "\n", $this->message);
$this->delimiter = "\n";
}
This is causing the PHP mail() silent error!