XF 2.1 Email Bounce/Unsubscribe Errors

Gene Steinberg

Well-known member
I have not changed or updated the script recently.

I have not updated add-ons in the last few days.

I have not changed settings in XF or the email system we use.

But in the past few days, I've suddenly encountered an inability for the script to login to our email system to process bounces and unsubscribes.

Logging on to IONOS' webmail works fine. Connecting to the address via Apple Mail works fine.

Here's one of the typical errors:

Code:
Server error log
Zend\Mail\Protocol\Exception\RuntimeException: Unsubscribe connection error: cannot connect to host ; error = fsockopen(): unable to connect to ssl://imap.ionos.com:993 (Connection refused) (errno = 0 ) src/vendor/zendframework/zend-mail/src/Protocol/Imap.php:93
Generated by: Unknown account Oct 25, 2020 at 12:42 PM
Stack trace
#0 src/vendor/zendframework/zend-mail/src/Storage/Imap.php(215): Zend\Mail\Protocol\Imap->connect('ssl://imap.iono...', 993, 'ssl')
#1 src/XF/EmailUnsubscribe/Processor.php(142): Zend\Mail\Storage\Imap->__construct(Object(stdClass))
#2 src/XF/SubContainer/Unsubscribe.php(15): XF\EmailUnsubscribe\Processor::getDefaultUnsubscribeHandlerStorage(Object(XF\Pub\App))
#3 src/XF/Container.php(28): XF\SubContainer\Unsubscribe->XF\SubContainer\{closure}(Object(XF\Container))
#4 src/XF/SubContainer/Unsubscribe.php(33): XF\Container->offsetGet('storage')
#5 src/XF/Job/EmailUnsubscribe.php(20): XF\SubContainer\Unsubscribe->storage()
#6 src/XF/Job/Manager.php(253): XF\Job\EmailUnsubscribe->run(G)
#7 src/XF/Job/Manager.php(195): XF\Job\Manager->runJobInternal(Array, G)
#8 src/XF/Job/Manager.php(79): XF\Job\Manager->runJobEntry(Array, G)
#9 job.php(42): XF\Job\Manager->runQueue(false, 8)
#10 {main}

-------------

Previous ErrorException: fsockopen(): unable to connect to ssl://imap.ionos.com:993 (Connection refused) - src/vendor/zendframework/zend-mail/src/Protocol/Imap.php:90
#0 [internal function]: Zend\Stdlib\ErrorHandler::addError(2, 'fsockopen(): un...', '/home/theparac/...', 90, Array)
#1 src/vendor/zendframework/zend-mail/src/Protocol/Imap.php(90): fsockopen('ssl://imap.iono...', 993, 111, 'Connection refu...', 30)
#2 src/vendor/zendframework/zend-mail/src/Storage/Imap.php(215): Zend\Mail\Protocol\Imap->connect('ssl://imap.iono...', 993, 'ssl')
#3 src/XF/EmailUnsubscribe/Processor.php(142): Zend\Mail\Storage\Imap->__construct(Object(stdClass))
#4 src/XF/SubContainer/Unsubscribe.php(15): XF\EmailUnsubscribe\Processor::getDefaultUnsubscribeHandlerStorage(Object(XF\Pub\App))
#5 src/XF/Container.php(28): XF\SubContainer\Unsubscribe->XF\SubContainer\{closure}(Object(XF\Container))
#6 src/XF/SubContainer/Unsubscribe.php(33): XF\Container->offsetGet('storage')
#7 src/XF/Job/EmailUnsubscribe.php(20): XF\SubContainer\Unsubscribe->storage()
#8 src/XF/Job/Manager.php(253): XF\Job\EmailUnsubscribe->run(G)
#9 src/XF/Job/Manager.php(195): XF\Job\Manager->runJobInternal(Array, G)
#10 src/XF/Job/Manager.php(79): XF\Job\Manager->runJobEntry(Array, G)
#11 job.php(42): XF\Job\Manager->runQueue(false, 8)
#12 {main}
Request state
array(4) {
  ["url"] => string(14) "/forum/job.php"
  ["referrer"] => string(69) "https://www.theparacast.com/forum/admin.php?cron/emailUnsubscribe/run"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}
 
You will most likely have to seek support from your host or email provider on this one.

XF is attempting to make the connection to your mail server but the connection is being refused. This could be something on the server itself refusing the connection or something on the mail server end which is refusing the connection.
 
I did have a conversation with them. They cannot find anything wrong. There is no way for me to reproduce the problem since it works outside of XF.

What would you suggest I ask them to check?
 
From a software point of view, we just make an IMAP connection with the details you've provided to the software. There's nothing we can do differently that would avoid the far end from refusing the connection.

So what they need to check is why when all of the connection details are apparently correct, is a connection that we attempt to make from the software refused by them?

You said it yourself, you have not changed the software or any settings so there's nothing on our side that has changed to cause this so the strong likelihood is that the issue is on their side either on the web server itself or the mail server.
 
What I thought. Thanks Chris.

As a test, I might enter another one of my "returns" addresses, from my other two forums, and see if it still makes the error. I know the others work.
 
All right, this is really strange.

I have two other forums with two other addresses used to process bounces. They are both running XF 2.2, but I haven't upgraded the one that exhibits the problem because some of my add-ons aren't compatible.

The XF 2.2 forums work fine processing bounces.

If I apply one of those addresses to the forum with the problem, I still receive the very same login error.

Again, the other forum works fine with that address — just not this one. So it would seem something in the affected version is at fault.

They are all hosted on the same cPanel/WHM server. The settings are, so far as I can see, identical for each account.

Is there anything in the error message above I might check to see what's going on? Doesn't seem as if the IONOS mail server could cause this problem with one of my forums, but not the other two.
 
That's a slightly different error -- "Network unreachable" -- though the overall issue is still the same: it's a networking issue, rather than something XF can really control.

It's worth noting that with "network unreachable", one possibility is that the server is trying to use IPv6 (which Google does advertise) but the connection itself then fails. This is something that needs to be resolved at the server level, so only your host can really resolve these issues.
 
Back
Top Bottom