XF 1.5 Errors related to bounce handler?

Floyd R Turbo

Well-known member
I haven't changed anything in a while, but al of the sudden, I'm getting all kinds of server errors that seem related to the bounce handler system. The look like this

Code:
Zend_Mail_Protocol_Exception: cannot connect to host; error = (errno = 0 ) - library/Zend/Mail/Protocol/Imap.php:100
Generated By: Unknown Account, 4 minutes ago
Stack Trace

#0 /home/***/public_html/library/Zend/Mail/Storage/Imap.php(273): Zend_Mail_Protocol_Imap->connect('***.***.co...', 993, 'SSL')
#1 /home/***/public_html/library/XenForo/Model/EmailBounce.php(304): Zend_Mail_Storage_Imap->__construct(Array)
#2 /home/***/public_html/library/XenForo/Deferred/EmailBounce.php(19): XenForo_Model_EmailBounce->openBounceHandlerConnection()
#3 /home/***/public_html/library/XenForo/Model/Deferred.php(295): XenForo_Deferred_EmailBounce->execute(Array, Array, 7.99999904633, '')
#4 /home/***/public_html/library/XenForo/Model/Deferred.php(429): XenForo_Model_Deferred->runDeferred(Array, 7.99999904633, '', false)
#5 /home/***/public_html/library/XenForo/Model/Deferred.php(374): XenForo_Model_Deferred->_runInternal(Array, NULL, '', false)
#6 /home/***/public_html/deferred.php(23): XenForo_Model_Deferred->run(false)
#7 {main}

Request State

array(3) {
  ["url"] => string(51) "https://www.***.org/deferred.php"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(4) {
    ["_xfRequestUri"] => string(28) "/admin.php?logs/server-error"
    ["_xfNoRedirect"] => string(1) "1"
    ["_xfToken"] => string(8) "********"
    ["_xfResponseType"] => string(4) "json"
  }
}

or this (when I manually run the cron to check for bounces, which is says it runs successfully, but it doesn't actually clear out the mailbox and import the bounces)

Code:
Zend_Mail_Protocol_Exception: cannot connect to host; error = (errno = 0 ) - library/Zend/Mail/Protocol/Imap.php:100
Generated By: Unknown Account, 21 minutes ago
Stack Trace

#0 /home/***/public_html/library/Zend/Mail/Storage/Imap.php(273): Zend_Mail_Protocol_Imap->connect('***.***.co...', 993, 'SSL')
#1 /home/***/public_html/library/XenForo/Model/EmailBounce.php(304): Zend_Mail_Storage_Imap->__construct(Array)
#2 /home/***/public_html/library/XenForo/Deferred/EmailBounce.php(19): XenForo_Model_EmailBounce->openBounceHandlerConnection()
#3 /home/***/public_html/library/XenForo/Model/Deferred.php(295): XenForo_Deferred_EmailBounce->execute(Array, Array, 7.99999785423, '')
#4 /home/***/public_html/library/XenForo/Model/Deferred.php(429): XenForo_Model_Deferred->runDeferred(Array, 7.99999785423, '', false)
#5 /home/***/public_html/library/XenForo/Model/Deferred.php(374): XenForo_Model_Deferred->_runInternal(Array, NULL, '', false)
#6 /home/***/public_html/deferred.php(23): XenForo_Model_Deferred->run(false)
#7 {main}

Request State

array(3) {
  ["url"] => string(51) "https://www.***.org/deferred.php"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(4) {
    ["_xfRequestUri"] => string(16) "/admin.php?cron/"
    ["_xfNoRedirect"] => string(1) "1"
    ["_xfToken"] => string(8) "********"
    ["_xfResponseType"] => string(4) "json"
  }
}

somtimes the request state is with a thread (not sure what request state means or if that matters)

Code:
Zend_Mail_Protocol_Exception: cannot connect to host; error = (errno = 0 ) - library/Zend/Mail/Protocol/Imap.php:100
Generated By: Unknown Account, Today at 6:23 AM
Stack Trace

#0 /home/***/public_html/library/Zend/Mail/Storage/Imap.php(273): Zend_Mail_Protocol_Imap->connect('***.***.co...', 993, 'SSL')
#1 /home/***/public_html/library/XenForo/Model/EmailBounce.php(304): Zend_Mail_Storage_Imap->__construct(Array)
#2 /home/***/public_html/library/XenForo/Deferred/EmailBounce.php(19): XenForo_Model_EmailBounce->openBounceHandlerConnection()
#3 /home/***/public_html/library/XenForo/Model/Deferred.php(295): XenForo_Deferred_EmailBounce->execute(Array, Array, 7.99999785423, '')
#4 /home/***/public_html/library/XenForo/Model/Deferred.php(429): XenForo_Model_Deferred->runDeferred(Array, 7.99999785423, '', false)
#5 /home/***/public_html/library/XenForo/Model/Deferred.php(374): XenForo_Model_Deferred->_runInternal(Array, NULL, '', false)
#6 /home/***/public_html/deferred.php(23): XenForo_Model_Deferred->run(false)
#7 {main}

Request State

array(3) {
  ["url"] => string(51) "https://www.***.org/deferred.php"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(4) {
    ["_xfRequestUri"] => string(30) "/threads/diy-food.27848/page-2"
    ["_xfNoRedirect"] => string(1) "1"
    ["_xfToken"] => string(8) "********"
    ["_xfResponseType"] => string(4) "json"
  }
}

Any idea? I reached out to the host to see if they could see anything wrong.

When I run
 
The place it happens doesn't have much relevance - it can happen anywhere the deferred system is run (which is run automatically on any page when needed).

This would seem to indicate that the bounce server settings are wrong, or that something is stopping your server connecting to the bounce server - either a firewall or a connectivity issue.

It could just be a transient issue, that'll solve itself soon (such as your email provider being down), or you may need to make sure your providers haven't changed anything.

Liam
 
Ok thanks @Liam W I appreciate the education (I thought it was that...) and the info.

I have no problem sending email to anything on that server, nor any problem pulling it into an email client (Thunderbird) via an IMAP connection. It doesn't seem like anything is wrong on my end, it's just that the forum can't connect to the bounce server.

Also all outbound emails (default, with -f parameter) seem to be working fine. However I do recall I was having issue getting that to work when using SMTP when I first moved over to this server/host (that was several months ago)
 
And another: gravatar error

Code:
Error Info
Zend_Http_Client_Adapter_Exception: Unable to Connect to ssl://secure.gravatar.com:443. Error #0: - library/Zend/Http/Client/Adapter/Socket.php:235
Generated By: Unknown Account, 29 minutes ago
Stack Trace

#0 /home/***/public_html/library/Zend/Http/Client.php(973): Zend_Http_Client_Adapter_Socket->connect('secure.gravatar...', 443, true)
#1 /home/***/public_html/library/XenForo/Model/Avatar.php(457): Zend_Http_Client->request('HEAD')
#2 /home/***/public_html/library/XenForo/ControllerPublic/Register.php(374): XenForo_Model_Avatar::gravatarExists('chelly1988.kd@g...')
#3 /home/***/public_html/library/ThemeHouse/JoinUserGroup/Extend/XenForo/ControllerPublic/Register.php(64): XenForo_ControllerPublic_Register->actionRegister()
#4 /home/***/public_html/library/Andy/RegisterEmail/ControllerPublic/Register.php(7): ThemeHouse_JoinUserGroup_Extend_XenForo_ControllerPublic_Register->actionRegister()
#5 /home/***/public_html/library/XenForo/FrontController.php(351): Andy_RegisterEmail_ControllerPublic_Register->actionRegister()
#6 /home/***/public_html/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#7 /home/***/public_html/index.php(13): XenForo_FrontController->run()
#8 {main}
 
I would be asking them (your host) about the firewall. It almost looks like the ports are being blocked.
They need to make sure that 443 outbound and 143 and 993 for IMAP are configured. They may have done a firewall change/upgrade and those sometimes are blocked by default.

As for logs, you need to check the mail logs (/var/log/mail typically) and also any related PHP logs. Your server admin should know which logs to be looking at honestly.
 
Also he's looked at every log that he could see and there's really nothing. The ACP XF server error log is what I was referring to. This is not "dumped" to a file that is similar to the server side log. That's what I was referring to

I.e. My server admin does know what he's doing. I was asking because I am trying to help him see what I am seeing. Ended up jut giving him ACP access
 
If there isn't something blocking outbound connections, then it could be an issue with PHP's SSL configuration causing the SSL handshake to fail. You'd need to confirm that PHP is picking up a proper certificate file (the openssl.cafile option in PHP).
 
Gravatar itself is not a real surprise. I've seen transient issues before with it and it was on their end.

This is not "dumped" to a file that is similar to the server side log.
No, it is kept in the DB. It does not dump out a TXT log file.
My server admin does know what he's doing. I was asking because I am trying to help him see what I am seeing. Ended up jut giving him ACP access
Sometimes stuff does not have a "simple" answer. You (meaning the server admin) sometimes has to just sit down and trouble shoot it "shooting from the hip" so to speak. It was one of the things that I enjoyed - and hated - about running a server.

If it "suddenly" started happening, odds are its due to an upgrade/change that was processed, either on the server itself or cPanel related.

The Gravatar, if transient, is not really abnormal behavior I've found. The mail related has been typically a blocked port in the firewall OR the other end has a block on the server IP for what it deemed suspicious/abusive behavioral patterns from my dealing with similar issues.
 
So I also have a 3rd forum on the same server, vanilla install (private board) and same things were happening, but to a lesser extent due to no traffic.

I bumped the PHP version on that install (1.5.14) to 7.0 and got the 'an unexpected database error has occurred" message. Same with 7.1.

Here are the php handler settings

phphandlers.webp

Everything is running on ea-php56 by default

phpversions.webp

Except for the one, which you will notice is php55. When I switched the 3rd forum to php55, the bounce handler started working.

I didn't want to switch php56 to the cgi handler as that would affect all domains, and I'm not confident enough in my knowledge to not break things. But at least this narrows down the issue
 
xenpushover started working
gravatar checking stopped throwing errors
XenAtendo 2 events creation stopped throwing the google API error

Either the handler got changed from cgi to dso (not likely, I think it was dso to start) or something changed the way dso handled things, this is out of my league but changing to php55 (which runs via cgi) was like flipping a switch on all 3 boards, everything is working again.

So now I throw this out there to those in the know...anyone have a possible explanation now that this is pinned down? I'm really very interested. Also I can't be the only one affected by this.
 
That to me sounds like an SSL issue. PHP 5.6 started checking SSL certificates by default.

It could be that there's something untoward happing with the connections, or your servers' certificate store is outdated and/or missing.

Liam
 
For clarification, I have SSLs purchased via a 3rd party and installed & running properly for the first 2 forums/sites where I discovered this issue.

The 3rd site has no 3rd party SSL but I think WHM/cPanel started doing something recently where everything is covered by some kind of SSL, I think that is "autoSSL" and I remember seeing notification when that became an option as I was logging into WHM as some point. Could be related to that?

That to me sounds like an SSL issue. PHP 5.6 started checking SSL certificates by default.
Thanks, that certainly could also be it still!
 
Top Bottom