XF 2.0 Test outbound email Failed

Bellinis

Active member
I just upgraded my board in a test enviroment and got the following message when trying the Test outbound email tool:

ErrorException: Email to xxx@xxx failed: [E_WARNING] proc_close() has been disabled for security reasons
src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php:107

#0 [internal function]: XF::handlePhpError(2, 'proc_close() ha...', '/home/myforum...', 107, Array)
#1 src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php(107): proc_close(Resource id #7)
#2 src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/SendmailTransport.php(134): Swift_Transport_StreamBuffer->terminate()
#3 src/XF/Mail/Mailer.php(293): Swift_Transport_SendmailTransport->send(Object(Swift_Message), Array)
#4 src/XF/Mail/Mail.php(261): XF\Mail\Mailer->send(Object(Swift_Message), Object(Swift_SendmailTransport))
#5 src/XF/Admin/Controller/Tools.php(246): XF\Mail\Mail->send(Object(Swift_SendmailTransport))
#6 src/XF/Mvc/Dispatcher.php(249): XF\Admin\Controller\Tools->actionTestEmail(Object(XF\Mvc\ParameterBag))
#7 src/XF/Mvc/Dispatcher.php(89): XF\Mvc\Dispatcher->dispatchClass('XF:Tools', 'test-email', 'html', Object(XF\Mvc\ParameterBag), 'tools', Object(XF\Admin\Controller\Tools), NULL)
#8 src/XF/Mvc/Dispatcher.php(41): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#9 src/XF/App.php(1880): XF\Mvc\Dispatcher->run()
#10 src/XF.php(328): XF\App->run()
#11 admin.php(13): XF::runApp('XF\\Admin\\App')
#12 {main}

What can be wrong?
 
Your host has disabled the proc_close function, though oddly, presumably not the proc_open function, which really makes no sense.

You should contact them to see if they'll enable it. If they don't, the only recommendations would be to use SMTP to send mails or a different host that doesn't arbitrarily limit legitimate/useful PHP functions.
 
When installing, I only got these warnings:
The following warnings were detected when verifying that your server can run XenForo:
Your server has disabled a core PHP function exec via the disable_functions directive in php.ini. This may cause unexpected problems in XenForo.
Your server has disabled a core PHP function escapeshellarg via the disable_functions directive in php.ini. This may cause unexpected problems in XenForo.
Your server has disabled a core PHP function proc_open via the disable_functions directive in php.ini. This may cause unexpected problems in XenForo.
Your server has disabled a core PHP function popen via the disable_functions directive in php.ini. This may cause unexpected problems in XenForo.

After this I asked the host to make these changes, but since proc_close was not mentioned, he left that one untouched.

Now it's working.
 
Last edited:
Strictly speaking, that list isn't exhaustive. There are thousands of PHP functions and we likely use thousands and the list will change frequently. We only list commonly disabled functions there that are known to cause problems. When functions are paired/related, it's important to enable all related function. (For example, if popen is disabled, then pclose is presumably also affected.)

In an ideal world, we don't recommend any PHP functions be disabled. Hosts sometimes disable functions for security reasons, but they block the legitimate reasons for using the functions (such as in our case).
 
Top Bottom