I've been beating my head against this one for hours now and finally got it. I figured I would share what I did here.
I dropped the following into a separate file in my mybb root directory, it made sending out mails a lot easier and also displayed more error information than I was able to find through the mybb interface. Browse to it to activate. You'll have to change
'[email protected]' to a valid email address.
<?php
define('IN_MYBB', 1);
define('THIS_SCRIPT', 'mytest.php');
require_once('./global.php');
function myErrorHandler($errno, $errstr, $errfile, $errline)
{
print "Error: " . $errstr;
}
set_error_handler( 'myErrorHandler' );
my_mail( '[email protected]', 'Testing...', 'This is a test' );
?>
I then configured Apache to run only one worker. The settings for this were in /etc/apache2/mods-enabled/mpm_prefork.conf, though yours might be elsewhere depending on your setup. I then restarted Apache.
Once Apache was running with one worker I got the pid of the worker with ps aux and then ran "strace -p 3434 >strace.out 2>&1" (where 3434 was the particular pid of my worker). You might have to install strace for this to work.
I attempted to send out an email via the script above and examined the contents of strace.out, finding the following (grepping for ENOENT might help here).
stat("/usr/lib/ssl/certs/2e5ac55d.0", 0x7fffbb55ed10) = -1 ENOENT (No such file or directory)
stat("/usr/lib/ssl/certs/2e5ac55d.0", 0x7fffbb55ed10) = -1 ENOENT (No such file or directory)
Once I ensured that those files were available to php mybb was able to send mail again.
One thing that I've been reading is that PHP 5.6 sometimes requires the default cert file to exist and be valid in order to make outgoing TLS connections. You can find the default cert file location by running
php -r 'print_r(openssl_get_cert_locations());' at the command-line. This turned out not to be the problem in my case, but if it was then it should have produced an error line in strace.out
Good luck.