If using Google OAuth for sending activation emails, which port must be enabled on a Linux server?

ShikiSuen

Well-known member
I am using strict ufw whitelist rules on my VPS in HK:

Code:
root@cs-cn:/users/supervisior# ufw status
Status: active
Logging: on (low)
Default: deny (incoming), deny (outgoing), disabled (routed)
New profiles: skip

To                         Action      From
--                         ------      ----
???/tcp                    ALLOW       Anywhere                   # SSH
???/tcp                    ALLOW       Anywhere                   # AAPanel (Bao-Ta)
???/tcp                     ALLOW       Anywhere                   # HTTP
???/tcp                    ALLOW       Anywhere                   # HTTPS
???/tcp                    ALLOW       Anywhere                   # FTP              
???/tcp (v6)               ALLOW       Anywhere (v6)              # SSH
???/tcp (v6)               ALLOW       Anywhere (v6)              # AAPanel (Bao-Ta)
???/tcp (v6)                ALLOW       Anywhere (v6)              # HTTP
???/tcp (v6)               ALLOW       Anywhere (v6)              # HTTPS
???/tcp (v6)               ALLOW       Anywhere (v6)              # FTP

5353/udp                   DENY OUT    Anywhere                   # disable mDNS discovery to keep this host hidden
5353/udp (v6)              DENY OUT    Anywhere (v6)              # disable mDNS discovery to keep this host hidden

root@cs-cn:/users/supervisior#
Plus dropping all ICMP packages.

However, apt doesn't work anymore... and XenForo cannot send activation emails through Google OAuth:
Code:
GuzzleHttp\Exception\ConnectException: Failed to refresh OAuth access token for emailTransport: cURL error 28: Resolving timed out after 15000 milliseconds (see http://curl.haxx.se/libcurl/c/libcurl-errors.html) src/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:185

#0 src/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(149): GuzzleHttp\Handler\CurlFactory::createRejection(Object(GuzzleHttp\Handler\EasyHandle), Array)
#1 src/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(102): GuzzleHttp\Handler\CurlFactory::finishError(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory))
#2 src/vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php(43): GuzzleHttp\Handler\CurlFactory::finish(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory))
#3 src/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php(28): GuzzleHttp\Handler\CurlHandler->__invoke(Object(GuzzleHttp\Psr7\Request), Array)
#4 src/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php(51): GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler\{closure}(Object(GuzzleHttp\Psr7\Request), Array)
#5 src/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php(66): GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler\{closure}(Object(GuzzleHttp\Psr7\Request), Array)
#6 src/vendor/guzzlehttp/guzzle/src/Middleware.php(30): GuzzleHttp\PrepareBodyMiddleware->__invoke(Object(GuzzleHttp\Psr7\Request), Array)
#7 src/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php(70): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Request), Array)
#8 src/vendor/guzzlehttp/guzzle/src/Middleware.php(58): GuzzleHttp\RedirectMiddleware->__invoke(Object(GuzzleHttp\Psr7\Request), Array)
#9 src/vendor/guzzlehttp/guzzle/src/HandlerStack.php(67): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Request), Array)
#10 src/vendor/guzzlehttp/guzzle/src/Client.php(277): GuzzleHttp\HandlerStack->__invoke(Object(GuzzleHttp\Psr7\Request), Array)
#11 src/vendor/guzzlehttp/guzzle/src/Client.php(125): GuzzleHttp\Client->transfer(Object(GuzzleHttp\Psr7\Request), Array)
#12 src/vendor/guzzlehttp/guzzle/src/Client.php(131): GuzzleHttp\Client->requestAsync('POST', Object(GuzzleHttp\Psr7\Uri), Array)
#13 src/XF/ConnectedAccount/Http/Client.php(51): GuzzleHttp\Client->request('POST', 'https://account...', Array)
#14 src/vendor/lusitanian/oauth/src/OAuth/OAuth2/Service/AbstractService.php(224): XF\ConnectedAccount\Http\Client->retrieveResponse(Object(OAuth\Common\Http\Uri\Uri), Array, Array)
#15 src/XF/Repository/Option.php(232): OAuth\OAuth2\Service\AbstractService->refreshAccessToken(Object(OAuth\OAuth2\Token\StdOAuth2Token))
#16 src/XF/App.php(1049): XF\Repository\Option->refreshEmailAccessTokenIfNeeded('emailTransport')
#17 src/XF/Container.php(28): XF\App->XF\{closure}(Object(XF\Container))
#18 src/XF/App.php(1002): XF\Container->offsetGet('mailer.transpor...')
#19 src/XF/Container.php(28): XF\App->XF\{closure}(Object(XF\Container))
#20 src/XF/App.php(2553): XF\Container->offsetGet('mailer')
#21 src/XF/Admin/Controller/Tools.php(263): XF\App->mailer()
#22 src/XF/Mvc/Dispatcher.php(350): XF\Admin\Controller\Tools->actionTestEmail(Object(XF\Mvc\ParameterBag))
#23 src/XF/Mvc/Dispatcher.php(257): XF\Mvc\Dispatcher->dispatchClass('XF:Tools', 'TestEmail', Object(XF\Mvc\RouteMatch), Object(XF\Admin\Controller\Tools), NULL)
#24 src/XF/Mvc/Dispatcher.php(113): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(XF\Admin\Controller\Tools), NULL)
#25 src/XF/Mvc/Dispatcher.php(55): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#26 src/XF/App.php(2337): XF\Mvc\Dispatcher->run()
#27 src/XF.php(488): XF\App->run()
#28 admin.php(13): XF::runApp('XF\\Admin\\App')
#29 {main}

array(4) {
  ["url"] => string(27) "/admin.php?tools/test-email"
  ["referrer"] => string(48) "https://www.cs-cn.pro/admin.php?tools/test-email"
  ["_GET"] => array(1) {
    ["tools/test-email"] => string(0) ""
  }
  ["_POST"] => array(0) {
  }
}

Code:
Email to ********@*******.com failed: Connection could not be established with host smtp.gmail.com :stream_socket_client(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution Log data: ++ Starting XF\Mail\SmtpTransport !! Connection could not be established with host smtp.gmail.com :stream_socket_client(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution (code: 0) src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/LoggerPlugin.php:124

#0 src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/SimpleEventDispatcher.php(138): Swift_Plugins_LoggerPlugin->exceptionThrown(Object(Swift_Events_TransportExceptionEvent))
#1 src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/SimpleEventDispatcher.php(116): Swift_Events_SimpleEventDispatcher->bubble(Array, Object(Swift_Events_TransportExceptionEvent), 'exceptionThrown')
#2 src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(434): Swift_Events_SimpleEventDispatcher->dispatchEvent(Object(Swift_Events_TransportExceptionEvent), 'exceptionThrown')
#3 src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(145): Swift_Transport_AbstractSmtpTransport->throwException(Object(Swift_TransportException))
#4 src/XF/Mail/Mailer.php(286): Swift_Transport_AbstractSmtpTransport->start()
#5 src/XF/Mail/Mail.php(404): XF\Mail\Mailer->send(Object(Swift_Message), Object(XF\Mail\SmtpTransport), NULL, false)
#6 src/XF/Admin/Controller/Tools.php(278): XF\Mail\Mail->send(Object(XF\Mail\SmtpTransport), false)
#7 src/XF/Mvc/Dispatcher.php(350): XF\Admin\Controller\Tools->actionTestEmail(Object(XF\Mvc\ParameterBag))
#8 src/XF/Mvc/Dispatcher.php(257): XF\Mvc\Dispatcher->dispatchClass('XF:Tools', 'TestEmail', Object(XF\Mvc\RouteMatch), Object(XF\Admin\Controller\Tools), NULL)
#9 src/XF/Mvc/Dispatcher.php(113): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(XF\Admin\Controller\Tools), NULL)
#10 src/XF/Mvc/Dispatcher.php(55): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#11 src/XF/App.php(2337): XF\Mvc\Dispatcher->run()
#12 src/XF.php(488): XF\App->run()
#13 admin.php(13): XF::runApp('XF\\Admin\\App')
#14 {main}

array(4) {
  ["url"] => string(27) "/admin.php?tools/test-email"
  ["referrer"] => string(48) "https://www.cs-cn.pro/admin.php?tools/test-email"
  ["_GET"] => array(1) {
    ["tools/test-email"] => string(0) ""
  }
  ["_POST"] => array(2) {
    ["email"] => string(21) "********@********.com"
    ["_xfToken"] => string(8) "********"
  }
}
 
Top