XF 2.2 Trouble with bounce handler

Tom McIntyre

Active member
We are set up to use AWS SES for out outbound mail and are using a MS Exchange server to handle the bounce messages.
The problem is that we get the error
Laminas\Mail\Exception\RuntimeException: Bounce connection error: cannot login, user or password wrong
src/XF/Mail/Storage/Imap.php:34
We believe we have the correct bounce@mydomain.org email address for bounce but we do not know much about Exchange.
Is it necessary to have the bounce handler on the same domain as the site? Our site is running on KnownHost and our MS Exchange is an inhouse system.
The Exchange server is the mail service for our inhouse staff and is used for outbound mail from our iMIS membership system as well. That inhouse system uses mimecast for security.

Any help or pointer to where to find it would be appreciated.
 
Can you access the bounce inbox from a regular email client using the same credentials? XF is just using POP3/IMAP to check for incoming bounce emails. There is no requirement that it's on the same domain (or email server, or anything other than a valid return-path which can be accessed over POP3/IMAP).
 
I think we are about to get this sorted out. Since bounce can be anywhere we created a bounce account on our KH server that is hosting the Forum.
Now I am trying to figure out how to test this setup.
I thought that sending a password request to one of my test accounts after changing its email to a spurious address would work, but I am having a hard time figuring what email domain to use.
 
About a week ago, I started getting this error. I have no idea on how to deal with it.
Server error log
  • Laminas\Mail\Protocol\Exception\RuntimeException: Bounce connection error: read failed - connection closed?
  • src/vendor/laminas/laminas-mail/src/Protocol/Pop3.php:155
  • Generated by: Unknown account
  • Oct 8, 2024 at 11:53 AM

Stack trace​

#0 src/vendor/laminas/laminas-mail/src/Protocol/Pop3.php(105): Laminas\Mail\Protocol\Pop3->readResponse()
#1 src/vendor/laminas/laminas-mail/src/Protocol/Pop3.php(50): Laminas\Mail\Protocol\Pop3->connect('outlook.office3...', 995, 'tls')
#2 src/XF/Mail/Storage/Pop3.php(26): Laminas\Mail\Protocol\Pop3->__construct('outlook.office3...', 995, 'TLS')
#3 src/XF/EmailBounce/Processor.php(252): XF\Mail\Storage\Pop3::setupFromHandler(Array)
#4 src/XF/SubContainer/Bounce.php(15): XF\EmailBounce\Processor::getDefaultBounceHandlerStorage(Object(XF\Pub\App))
#5 src/XF/Container.php(31): XF\SubContainer\Bounce->XF\SubContainer\{closure}(Object(XF\Container))
#6 src/XF/SubContainer/Bounce.php(43): XF\Container->offsetGet('storage')
#7 src/XF/Job/EmailBounce.php(20): XF\SubContainer\Bounce->storage()
#8 src/XF/Job/Manager.php(260): XF\Job\EmailBounce->run(8)
#9 src/XF/Job/Manager.php(202): XF\Job\Manager->runJobInternal(Array, 8)
#10 src/XF/Job/Manager.php(86): XF\Job\Manager->runJobEntry(Array, 8)
#11 job.php(43): XF\Job\Manager->runQueue(false, 8)
#12 {main}

Request state​

array(4) {
["url"] => string(8) "/job.php"
["referrer"] => string(21) "https://mb.nawcc.org/"
["_GET"] => array(0) {
}
["_POST"] => array(0) {
}
}
 
The Office 365 mail account permissions will have to be set to allow external programs access to SMTP, POP3 and IMAP.

You can turn these on in the account itself, but that won't work unless the admin sets those permissions too. I've been through this recently with Office 365, trying to access an email account through Thunderbird that someone created for me to access their team.
 
Back
Top Bottom