Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SOME users AUTHENTICATIONFAILED after version update #969

Closed
joergmschulz opened this issue Feb 15, 2023 · 4 comments
Closed

SOME users AUTHENTICATIONFAILED after version update #969

joergmschulz opened this issue Feb 15, 2023 · 4 comments
Labels
bug Something isn't working Nextcloud

Comments

@joergmschulz
Copy link

this is hard to reproduce as snappymail works for most users. For others, authentication does not work and the log throws (see below):

The same user can authenticate from another nextcloud instance using the same parameters.
Another nextcloud can authenticate from the failing nextcloud using another nextcloud account and the same mail account settings.
2FA has been disabled, that's not the reason.
nextcloud redis cache and snappymail data/cache have been cleared.
all browser cookies and data for the sessions have been cleared, another browser has been used.

Might content security policy be a reason - but why only for this user?

2023-02-15 10:17:57.023][8c4996c8] IMAP[WARNING]: MailSo\Imap\Exceptions\NegativeResponseException: AUTHENTICATIONFAILED Authentication failed. in /data/apps/snappymail/app/snappymail/v/2.26.1/app/libraries/MailSo/Imap/ResponseCollection.php:46
Stack trace:
#0 /data/apps/snappymail/app/snappymail/v/2.26.1/app/libraries/MailSo/Imap/ImapClient.php(538): MailSo\Imap\ResponseCollection->validate()
#1 /data/apps/snappymail/app/snappymail/v/2.26.1/app/libraries/MailSo/Imap/ImapClient.php(461): MailSo\Imap\ImapClient->getResponse()
#2 /data/apps/snappymail/app/snappymail/v/2.26.1/app/libraries/MailSo/Imap/ImapClient.php(181): MailSo\Imap\ImapClient->SendRequestGetResponse('AUTHENTICATE', Array)
#3 /data/apps/snappymail/app/snappymail/v/2.26.1/app/libraries/RainLoop/Model/Account.php(297): MailSo\Imap\ImapClient->Login(Object(MailSo\Imap\Settings))
#4 /data/apps/snappymail/app/snappymail/v/2.26.1/app/libraries/RainLoop/Model/Account.php(238): RainLoop\Model\Account->netClientLogin(Object(MailSo\Imap\ImapClient), Object(RainLoop\Plugins\Manager), Object(MailSo\Imap\Settings))
#5 /data/apps/snappymail/app/snappymail/v/2.26.1/app/libraries/RainLoop/Actions/UserAuth.php(426): RainLoop\Model\Account->ImapConnectAndLogin(Object(RainLoop\Plugins\Manager), Object(MailSo\Imap\ImapClient), Object(RainLoop\Config\Application))
#6 /data/apps/snappymail/app/snappymail/v/2.26.1/app/libraries/RainLoop/Actions/UserAuth.php(143): RainLoop\Actions->imapConnect(Object(RainLoop\Model\MainAccount), true)
#7 /data/apps/snappymail/lib/Util/SnappyMailHelper.php(77): RainLoop\Actions->LoginProcess('**@xxxxx....', '*******', false)
#8 /data/apps/snappymail/lib/Controller/PageController.php(114): OCA\SnappyMail\Util\SnappyMailHelper::startApp(true)
#9 /www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php(225): OCA\SnappyMail\Controller\PageController->indexPost()
#10 /www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php(133): OC\AppFramework\Http\Dispatcher->executeController(Object(OCA\SnappyMail\Controller\PageController), 'indexPost')
#11 /www/nextcloud/lib/private/AppFramework/App.php(172): OC\AppFramework\Http\Dispatcher->dispatch(Object(OCA\SnappyMail\Controller\PageController), 'indexPost')
#12 /www/nextcloud/lib/private/Route/Router.php(298): OC\AppFramework\App::main('PageController', 'indexPost', Object(OC\AppFramework\DependencyInjection\DIContainer), Array)
#13 /www/nextcloud/lib/base.php(1047): OC\Route\Router->match('/apps/snappymai...')
#14 /www/nextcloud/index.php(36): OC::handleRequest()
#15 {main}
[2023-02-15 10:17:59.894][8c4996c8] IMAP[ERROR]: MailSo\Net\Exceptions\SocketAlreadyConnectedException in /data/apps/snappymail/app/snappymail/v/2.26.1/app/libraries/MailSo/Net/NetClient.php:95
Stack trace:
#0 /data/apps/snappymail/app/snappymail/v/2.26.1/app/libraries/MailSo/Imap/ImapClient.php(81): MailSo\Net\NetClient->Connect(Object(MailSo\Imap\Settings))
#1 /data/apps/snappymail/app/snappymail/v/2.26.1/app/libraries/RainLoop/Model/Account.php(234): MailSo\Imap\ImapClient->Connect(Object(MailSo\Imap\Settings))
#2 /data/apps/snappymail/app/snappymail/v/2.26.1/app/libraries/RainLoop/Actions/UserAuth.php(426): RainLoop\Model\Account->ImapConnectAndLogin(Object(RainLoop\Plugins\Manager), Object(MailSo\Imap\ImapClient), Object(RainLoop\Config\Application))
#3 /data/apps/snappymail/app/snappymail/v/2.26.1/app/libraries/RainLoop/Actions/UserAuth.php(143): RainLoop\Actions->imapConnect(Object(RainLoop\Model\MainAccount), true)
#4 /data/apps/snappymail/app/snappymail/v/2.26.1/app/libraries/RainLoop/Actions/User.php(43): RainLoop\Actions->LoginProcess('**@xxxx.de', '*******', true)
#5 /data/apps/snappymail/app/snappymail/v/2.26.1/app/libraries/RainLoop/ServiceActions.php(140): RainLoop\Actions->DoLogin()
#6 /data/apps/snappymail/app/snappymail/v/2.26.1/app/libraries/RainLoop/Service.php(112): RainLoop\ServiceActions->ServiceJson('')
#7 /data/apps/snappymail/app/snappymail/v/2.26.1/app/libraries/RainLoop/Service.php(14): RainLoop\Service::RunResult()
#8 /data/apps/snappymail/lib/Util/SnappyMailHelper.php(90): RainLoop\Service::Handle()
#9 /data/apps/snappymail/lib/Controller/PageController.php(114): OCA\SnappyMail\Util\SnappyMailHelper::startApp(true)
#10 /www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php(225): OCA\SnappyMail\Controller\PageController->indexPost()
#11 /www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php(133): OC\AppFramework\Http\Dispatcher->executeController(Object(OCA\SnappyMail\Controller\PageController), 'indexPost')
#12 /www/nextcloud/lib/private/AppFramework/App.php(172): OC\AppFramework\Http\Dispatcher->dispatch(Object(OCA\SnappyMail\Controller\PageController), 'indexPost')
#13 /www/nextcloud/lib/private/Route/Router.php(298): OC\AppFramework\App::main('PageController', 'indexPost', Object(OC\AppFramework\DependencyInjection\DIContainer), Array)
#14 /www/nextcloud/lib/base.php(1047): OC\Route\Router->match('/apps/snappymai...')
#15 /www/nextcloud/index.php(36): OC::handleRequest()
#16 {main}

@the-djmaze the-djmaze changed the title SOME users cannot authenticate after version update SOME users AUTHENTICATIONFAILED after version update Feb 15, 2023
@the-djmaze the-djmaze added the bug Something isn't working label Feb 15, 2023
@the-djmaze
Copy link
Owner

I've analyzed the problem and see what is going on.

  1. Nextcloud -> Settings -> Additional the user set invalid login name + password
  2. SnappyMail does Login attempt and fails
  3. SnappyMail shows login screen
  4. User logs in
  5. Step 1 & 2 happen on each request, and so on login
  6. Login fails due to step 5 connected

I will solve the bug and as workaround the user either removes the invalid settings of step 1 or sets the right credentials.

@joergmschulz
Copy link
Author

My god, root cause has been user's fault to correct the password in the additional settings. Sorry for that one - but thank you for resolving the bug.
Additionally: using the login override plugin overcomes the issue as well.
Will you close the bug when you made the fix - or shall I do it because of your good answer?

@the-djmaze
Copy link
Owner

I will close the bug when the fix lands in the commits.

the-djmaze pushed a commit that referenced this issue Feb 16, 2023
@joergmschulz
Copy link
Author

Confirm - the current release fixes the issue. Thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Nextcloud
Projects
None yet
Development

No branches or pull requests

2 participants