2

I get the following error upon submit of the contact form (Pixel and Tonic's version).

proc_open() has been disabled for security reasons

Using Craft 3.0.5 and Contact Form 2.1.1. Email is being sent by Sendmail

Client's website host are not willing to enable proc_open. Is anyone aware of a simple way around this?

Here's the Stack Trace:

yii\base\ErrorException: proc_open() has been disabled for security reasons in /home/blahblah/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php:296
Stack trace:
#0 /home/blahblah/vendor/craftcms/cms/src/web/ErrorHandler.php(84): yii\base\ErrorHandler->handleError(2, 'proc_open() has...', '/home/blahblah/...', 296)
#1 [internal function]: craft\web\ErrorHandler->handleError(2, 'proc_open() has...', '/home/blahblah/...', 296, Array)
#2 /home/blahblah/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php(296): proc_open('/usr/sbin/sendm...', Array, Array)
#3 /home/blahblah/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php(58): Swift_Transport_StreamBuffer->establishProcessConnection()
#4 /home/blahblah/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(126): Swift_Transport_StreamBuffer->initialize(Array)
#5 /home/blahblah/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/SendmailTransport.php(52): Swift_Transport_AbstractSmtpTransport->start()
#6 /home/blahblah/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mailer.php(67): Swift_Transport_SendmailTransport->start()
#7 /home/blahblah/vendor/yiisoft/yii2-swiftmailer/src/Mailer.php(151): Swift_Mailer->send(Object(Swift_Message))
#8 /home/blahblah/vendor/yiisoft/yii2/mail/BaseMailer.php(263): yii\swiftmailer\Mailer->sendMessage(Object(craft\mail\Message))
#9 /home/blahblah/vendor/craftcms/cms/src/mail/Mailer.php(159): yii\mail\BaseMailer->send(Object(craft\mail\Message))
#10 /home/blahblah/vendor/craftcms/contact-form/src/Mailer.php(100): craft\mail\Mailer->send(Object(craft\mail\Message))
#11 /home/blahblah/vendor/craftcms/contact-form/src/controllers/SendController.php(51): craft\contactform\Mailer->send(Object(craft\contactform\models\Submission))
#12 [internal function]: craft\contactform\controllers\SendController->actionIndex()
#13 /home/blahblah/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#14 /home/blahblah/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#15 /home/blahblah/vendor/craftcms/cms/src/web/Controller.php(76): yii\base\Controller->runAction('', Array)
#16 /home/blahblah/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction('', Array)
#17 /home/blahblah/vendor/craftcms/cms/src/web/Application.php(272): yii\base\Module->runAction('contact-form/se...', Array)
#18 /home/blahblah/vendor/craftcms/cms/src/web/Application.php(520): craft\web\Application->runAction('contact-form/se...', Array)
#19 /home/blahblah/vendor/craftcms/cms/src/web/Application.php(256): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#20 /home/blahblah/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))
#21 /home/blahblah/web/index.php(21): yii\base\Application->run()
#22 {main}
3
  • Is this Contact Form 1 (for Craft 2) or Contact Form 2 (for Craft 3). Can you edit the question to share the full stack trace leading up to the error? What mail protocol are you using under Settings->Email in the Control Panel?
    – Brad Bell
    Commented May 1, 2018 at 18:13
  • Thanks @BradBell. Have updated questions with requested info.
    – benb
    Commented May 3, 2018 at 5:00
  • Longer term, look for new hosting for your client imo. Commented Jul 7, 2018 at 16:52

1 Answer 1

1

I'm about 99% sure that if you swap from using sendmail to SMTP, or almost any of the other mail transports in the "Mail Adaptors" category in the Craft 3 Plugin Store (SES, Postmark, Mandrill), they won't end up going through proc_open.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.