XF 1.4 Testing Bounce email settings?

Fred.

Well-known member
Is there a way to test the bounce email settings?

If I login with my browser it works perfect.
But it looks like Xenforo can't login to the account.

I always get these.
Code:
Server Error Log
Error Info
Zend_Mail_Storage_Exception: cannot login, user or password wrong - library/Zend/Mail/Storage/Imap.php:279
Generated By: Unknown Account, Sunday at 1:53 PM
Stack Trace
#0 /home/admin/domains/example.com/private_html/library/XenForo/Model/EmailBounce.php(292): Zend_Mail_Storage_Imap->__construct(Array)
#1 /home/admin/domains/example.com/private_html/library/XenForo/Deferred/EmailBounce.php(19): XenForo_Model_EmailBounce->openBounceHandlerConnection()
#2 /home/admin/domains/example.com/private_html/library/XenForo/Model/Deferred.php(256): XenForo_Deferred_EmailBounce->execute(Array, Array, 7.99999809265, '')
#3 /home/admin/domains/example.com/private_html/library/XenForo/Model/Deferred.php(390): XenForo_Model_Deferred->runDeferred(Array, 7.99999809265, '', false)
#4 /home/admin/domains/example.com/private_html/library/XenForo/Model/Deferred.php(335): XenForo_Model_Deferred->_runInternal(Array, NULL, '', false)
#5 /home/admin/domains/example.com/private_html/deferred.php(23): XenForo_Model_Deferred->run(false)
#6 {main}
Request State
array(3) {
  ["url"] => string(39) "https://www.example.com/deferred.php"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(3) {
    ["_xfRequestUri"] => string(31) "/forums/test.25/"
    ["_xfNoRedirect"] => string(1) "1"
    ["_xfResponseType"] => string(4) "json"
  }
}

I use google apps
These are my settings.

Enable automated bounced email handler --> on
Connection Type: IMAP
Host : imap.gmail.com : 993
Username and password is correct
and Encryption: SSL
 
It could also be that IMAP hasn't been enabled for that Gmail account (don't think it's on by default).

You can test by running the bounce handler cron, viewing a couple pages and then checking the server error log. If you send an email directly to the bounce account (don't read it), then it should show up on in the log on a successful check (or a server error log entry otherwise).
 
IMAP is enabled for that account.

I tested by running the bounce handler cron, viewing a couple pages and then checking the server error log. Nothing shows up in the server log.
Sending an email to the bounce account seems to work perfect. It shows up in the log. :confused:

So that means Xenforo can login and read the email.
Maybe is was just a time-out or something that caused the errors.
I'll see how it goes the next days / weeks. I don't have that many bounces.
 
If it only happened once, it sounds like a temporary error. If your forum is active, the bounce account is checked every 30 minutes so you would see a constant error if it's more fundamental.
 
Hello

I'm also getting this error, however seems it's not temporar. All details are correct, IMAP is enabled inside gmail.

It's a fresh xenforo install by the way.

Code:
Error Info
Zend_Mail_Storage_Exception: cannot login, user or password wrong - library/Zend/Mail/Storage/Imap.php:279
Generated By: Unknown Account, A moment ago
Stack Trace
#0 /var/www/example.com/library/XenForo/Model/EmailBounce.php(292): Zend_Mail_Storage_Imap->__construct(Array)
#1 /var/www/example.com/library/XenForo/Deferred/EmailBounce.php(19): XenForo_Model_EmailBounce->openBounceHandlerConnection()
#2 /var/www/example.com/library/XenForo/Model/Deferred.php(294): XenForo_Deferred_EmailBounce->execute(Array, Array, 7.9999959468842, '')
#3 /var/www/example.com/library/XenForo/Model/Deferred.php(428): XenForo_Model_Deferred->runDeferred(Array, 7.9999959468842, '', false)
#4 /var/www/example.com/library/XenForo/Model/Deferred.php(373): XenForo_Model_Deferred->_runInternal(Array, NULL, '', false)
#5 /var/www/example.com/deferred.php(23): XenForo_Model_Deferred->run(false)
#6 {main}
Request State
array(3) {
  ["url"] => string(44) "http://example.com/deferred.php"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(4) {
    ["_xfRequestUri"] => string(1) "/"
    ["_xfNoRedirect"] => string(1) "1"
    ["_xfToken"] => string(8) "********"
    ["_xfResponseType"] => string(4) "json"
  }
}
 
After moving to the new server. I receive a lot of mistakes
"cannot login, user or password wrong"
Code:
Zend_Mail_Storage_Exception: cannot login, user or password wrong - library/Zend/Mail/Storage/Imap.php:279
Generated By: Unknown Account, A moment ago
Stack Trace
#0 /home/www/site.com/library/XenForo/Model/EmailBounce.php(292): Zend_Mail_Storage_Imap->__construct(Array)
#1 /home/www/site.com/library/XenForo/Deferred/EmailBounce.php(19): XenForo_Model_EmailBounce->openBounceHandlerConnection()
#2 /home/www/site.com/library/XenForo/Model/Deferred.php(295): XenForo_Deferred_EmailBounce->execute(Array, Array, 7.9999988079071, '')
#3 /home/www/site.com/library/XenForo/Model/Deferred.php(429): XenForo_Model_Deferred->runDeferred(Array, 7.9999988079071, '', false)
#4 /home/www/site.com/library/XenForo/Model/Deferred.php(374): XenForo_Model_Deferred->_runInternal(Array, NULL, '', false)
#5 /home/www/site.com/deferred.php(23): XenForo_Model_Deferred->run(false)
#6 {main}
Request State
array(3) {
  ["url"] => string(34) "https://site.com/deferred.php"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(3) {
    ["_xfRequestUri"] => string(46) "/threads/xxx.148842/"
    ["_xfNoRedirect"] => string(1) "1"
    ["_xfResponseType"] => string(4) "json"
  }
}
Tell me what to do
For e-mail I use https://xenforo.com/community/resources/bd-mails.2313/
 
That would indicate your IMAP details are incorrect. We can't really guide you there. You'd need to contact your IMAP server provider for more details.
 
For anyone that comes across this in future, specifically with Gmail - but possibly others like Outlook too now - as a security precaution if Gmail things the login attempt from the board is suspect - it will not allow the connection. However, XF still reports this as incorrect user/pass.

Make sure you have done the following with the Gmail account:
  1. Enable IMAP
  2. Enable "Less secure app access" in https://myaccount.google.com/security?gar=1
  3. Most importantly, go to: https://accounts.google.com/DisplayUnlockCaptcha - click continue. When "Account access enabled. Please try signing in to your Google Account again from your new device or application." appears - go to XF2 Admin -> Tools -> Cron Entries ->and click the refresh icon for "Process email bounces" to make XF connect. You shouldn't receive an error anymore.
 
A quick update to this folks. Google recently removed "Less secure app access": https://support.google.com/accounts/answer/6010255. Confusingly, the help page still suggests you can turn on "less secure app access" if it's turned off:

1654958298471.png

However in trying to do so you'll now see this:

1654958359748.png

This change prevents you from logging into the Gmail account via XF (or any app for that matter) using the account's username and password. You can however still login using an app password instead.

If you've been receiving incorrect user/password errors over the last week or so - but nothing's changed at your board end and you can still login to the Gmail bounce account you've setup via a browser just fine - this will likely be why. Thankfully the solution is fairly straight forward. You need to:
  1. Enable 2FA on the Gmail bounce account: https://support.google.com/accounts/answer/185839, https://myaccount.google.com/signinoptions/two-step-verification. You have to do this in order to be able to create app passwords)
  2. Go to app passwords (https://myaccount.google.com/apppasswords) and generate a password for your app and copy it:
    Xe8Jt.gif
  3. When the new 16 character password appears, go to XF Admin options -> Email options. Next to "Automated bounced email handler" click change -> select IMAP -> click continue.
  4. Paste/enter the new app password you generated then click "Save".
  5. Go to: https://accounts.google.com/DisplayUnlockCaptcha - click continue. When "Account access enabled. Please try signing in to your Google Account again from your new device or application." appears - go to XF2 Admin -> Tools -> Cron Entries ->and click the refresh icon for "Process email bounces" to make XF connect. You shouldn't receive an error anymore.
Important note: Whenever you're clicking these link shortcuts for google account management - make sure the active google account your logged into is the actual bounce email account you've setup - not your normal one (if you use one)! Login to the Google bounce account either in an incognito window and copy paste links or use a different browser and make the necessary account changes there.
 
Last edited:
Top Bottom