XF 2.2 Is there any benefit to using "Default" as email option or SMTP? (Default doenst work for me for some reason)

NandorHUN

Active member
Hi Guys!

I tried to set up "Default" email option 2 months ago, but I failed and wasnt able to make it work. I ended up using SMTP. But I wonder: Is there any benefit of using one or other? Which one is the better? And why cant I use Default?

Thanks for the help!
 
OK. I looked at the log and the error is seem to be in Xenforo.
I get the following message and Error Log:

Email to example@gmail.com failed: [E_WARNING] proc_open() has been disabled for security reasons

Rest of the log:

Stack trace​

#0 [internal function]: XF::handlePhpError(2, '[E_WARNING] pro...', '/home/www/clien...', 299, Array)
#1 src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php(299): proc_open('/usr/sbin/sendm...', Array, Array)
#2 src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php(54): Swift_Transport_StreamBuffer->establishProcessConnection()
#3 src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/SendmailTransport.php(117): Swift_Transport_StreamBuffer->initialize(Array)
#4 src/XF/Mail/Mailer.php(304): Swift_Transport_SendmailTransport->send(Object(Swift_Message), Array)
#5 src/XF/Mail/Mail.php(404): XF\Mail\Mailer->send(Object(Swift_Message), Object(Swift_SendmailTransport), NULL, true)
#6 src/XF/Service/User/AbstractConfirmationService.php(85): XF\Mail\Mail->send()
#7 src/XF/Service/User/AbstractConfirmationService.php(63): XF\Service\User\AbstractConfirmationService->sendConfirmationEmail()
#8 src/XF/Service/User/Registration.php(395): XF\Service\User\AbstractConfirmationService->triggerConfirmation()
#9 src/XF/Service/User/Registration.php(317): XF\Service\User\Registration->sendRegistrationContact()
#10 src/XF/Service/ValidateAndSavableTrait.php(40): XF\Service\User\Registration->_save()
#11 src/XF/Mvc/Dispatcher.php(350): XenSoluce\AvatarGallery\XF\Pub\Controller\Register->actionRegister(Object(XF\Mvc\ParameterBag))
#12 src/XF/Mvc/Dispatcher.php(257): XF\Mvc\Dispatcher->dispatchClass('XF:Register', 'Register', Object(XF\Mvc\RouteMatch), Object(XenSoluce\AvatarGallery\XF\Pub\Controller\Register), NULL)
#15 src/XF/Mvc/Dispatcher.php(113): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(XenSoluce\AvatarGallery\XF\Pub\Controller\Register), NULL)
#16 src/XF/Mvc/Dispatcher.php(55): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#17 src/XF/App.php(2300): XF\Mvc\Dispatcher->run()
#18 src/XF.php(488): XF\App->run()
#19 index.php(20): XF::runApp('XF\\Pub\\App')
#20 {main}

Request state​

array(4) {
["url"] => string(32) "/regisztr%C3%A1ci%C3%B3/register"
["referrer"] => string(30) "https://mysite.com/forum/"
["_GET"] => array(0) {
}
["_POST"] => array(14) {
["username"] => string(0) ""
["10b48e244bfffee505295f165647424f0378b9"] => string(15) "TestUser2021.02"
["7c04b84d11901a8f4654a51557ac04dff1554"] => string(24) "example@gmail.com"
["4ce6646599c2e918251702b3a1c6940625a5d"] => string(8) "********"
["gallery_avatar"] => string(46) "gallery_avatars/MySite avatarok/003-chef.png"
["custom_fields"] => array(1) {
["Statusz"] => array(1) {
[0] => string(1) "7"
}
}
["g-recaptcha-response"] => string(548) "03AGdBq270TBmneTIun1dWEx4dYXpIjX2XlSDcnvQuHTOnJi6v7Hvg1pMDexj2sF_Q72V5YFg-7OeyIeYG21R9JnpI4lrd3pG81NgRdeAeLx2UvXRyaU5-Z3fj8UbOW-iS3F1UbsXOYLC2SpwpUR1Z6FEA6CLZfeNC82rxwDd0ggBiBd-0JoJiGpwlvRIkgHW1FlQJftQ-M9OwPr3Rc67QNOdMyLuAuPIsEOyBMZmq9OzM5AFiPNNwLlnFLocdjf5ctFcG0vHagY5ZGi7seVxjo245O4mJQPqrgmp4_B2IVpC5pnq33HwTcdZP-fBWKl0VSiLcvRqg6FVpj79Qri5PhKRy8HFteD3MP-GuPqXmJjWYa3g-lrjYXlShhKFzNuwNQ881IBSARhqh3XwFT5ivULBSK62w3U4nPPCqq22rjdyKitCq0PDLdLWlSLWICZM-11LwrdKIJmmBuw73m5v0T6rcwmF3XFSaRYYc8w3hc4hjzMF9HnF5n9uL1iPstfHzqtyO8YsolCXL5aisEkdoxSIgWbBOv_TISQ"
["accept"] => string(1) "1"
["reg_key"] => string(16) "5TcSqBMquScT8yXx"
["86aa57c505b2df4ded9868373168b35e1bf52304"] => string(16) "Europe/Amsterdam"
["_xfToken"] => string(8) "********"
["_xfRequestUri"] => string(7) "/forum/"
["_xfWithData"] => string(1) "1"
["_xfResponseType"] => string(4) "json"
}
}


What is the reason? Can you help out?
Thanks.
 
What is the reason? Can you help out?
The reason is the way Xenforo is programmed. The proc_open in php is needed for php mail to work.

However, the notice says it's closed for security reasons, that is done by your host (as many do, next to some other thinsg).
It's a common thing on shared hosting servers.
Have a look at this thread in which things are explained:

So you have a couple of choices:
1.) Use smtp for mail
2.) Ask your host to enable proc_open (and maybe something else needed)
3.) Change host to a host where this can be enabled
4.) Put your forum on your own dedicated server or VPS
 
The reason is the way Xenforo is programmed. The proc_open in php is needed for php mail to work.

However, the notice says it's closed for security reasons, that is done by your host (as many do, next to some other thinsg).
It's a common thing on shared hosting servers.
Have a look at this thread in which things are explained:

So you have a couple of choices:
1.) Use smtp for mail
2.) Ask your host to enable proc_open (and maybe something else needed)
3.) Change host to a host where this can be enabled
4.) Put your forum on your own dedicated server or VPS
Thanks.

I asked them, they wont change that settings cos "security reasons".

In real usage or practise what disadvantages will I or my users experience using SMTP?
 
I asked them, they wont change that settings cos "security reasons".
I can't blaim them. I'm a hoster myself and refuse to enable this. In spite of the fact that maybe some might be bypassed they still offer protection say also my collegues.

In real usage or practise what disadvantages will I or my users experience using SMTP?
With a good host? None. In fact it can work better. Because now real SMTP is used. You can make use of SPF and maybe DKIM and DMARC records this way for your mails, which gives more chance to not land in spam folders, because it's authenticated and verified mail.
If there are issues with other sites on the server, since this is authenticated mail, you have more chance getting your mails still delivered with for example Gmail, who likes SPF and DKIM mails better anyway.

Downsides? Maybe limitations of number of outgoing mails. You have to check that with your host if you have a large site and do maybe a couple of thousend mails per day. Some even when doing more then several hundreds a day. I don't know your host limit.

I don't know of any disadvantages for use of SMTP.
 
Back
Top Bottom