snappymail icon indicating copy to clipboard operation
snappymail copied to clipboard

Cannot log in after updating to Nextcloud 28.0.5 and SnappyMail 2.36.1

Open icassassin opened this issue 9 months ago • 4 comments

Describe the bug I just updated Nextcloud from 28.0.4 to 28.0.5 and, I think, SnappyMail from 2.36.0 to 2.36.1 and I can no longer get mail. My mail server is still working just fine. When I go directly to the SnappyMail app, the SnappyMail loading screen spins for a good long while and then I'm asked for my password. Entering my password results in a "Request timeout" with no server message at all. My server doesn't seem to notice the login attempt.

To Reproduce Click on Snappymail.

Expected behavior Access to my mailbox.

Please complete the following information:

  • Chrome
  • IMAP daemon: dovecot
  • PHP version: 8.1.2
  • SnappyMail Version: 2.36.1
  • Mode: nextcloud

Debug/logging information

#8 [nextcloud_apps]/apps/snappymail/lib/Controller/PageController.php(50): OCA\SnappyMail\Util\SnappyMailHelper::startApp()
#9 [nextcloud_apps]/lib/private/AppFramework/Http/Dispatcher.php(230): OCA\SnappyMail\Controller\PageController->index()
#10 [nextcloud_apps]/lib/private/AppFramework/Http/Dispatcher.php(137): OC\AppFramework\Http\Dispatcher->executeController()
#11 [nextcloud_apps]/lib/private/AppFramework/App.php(184): OC\AppFramework\Http\Dispatcher->dispatch()
#12 [nextcloud_apps]/lib/private/Route/Router.php(315): OC\AppFramework\App::main()
#13 [nextcloud_apps]/lib/base.php(1069): OC\Route\Router->match()
#14 [nextcloud_apps]/index.php(39): OC::handleRequest()
#15 {main}
[2024-04-28 23:57:08.258][0256afab] smremember[WARNING]: AuthError[102]
[2024-04-28 23:57:08.937][8a9bfbce] Crypt[WARNING]: Decrypt() invalid $data or $key
[2024-04-28 23:57:14.461][8a9bfbce] IMAP[WARNING]: MailSo\Imap\Exceptions\NegativeResponseException: AUTHENTICATIONFAILED Authentication failed. in [nextcloud_apps]/apps/snappymail/app/snappymail/v/2.36.1/app/libraries/MailSo/Imap/ResponseCollection.php:46
Stack trace:
#0 [nextcloud_apps]/apps/snappymail/app/snappymail/v/2.36.1/app/libraries/MailSo/Imap/ImapClient.php(528): MailSo\Imap\ResponseCollection->validate()
#1 [nextcloud_apps]/apps/snappymail/app/snappymail/v/2.36.1/app/libraries/MailSo/Imap/ImapClient.php(166): MailSo\Imap\ImapClient->getResponse()
#2 [nextcloud_apps]/apps/snappymail/app/snappymail/v/2.36.1/app/libraries/RainLoop/Model/Account.php(264): MailSo\Imap\ImapClient->Login()
#3 [nextcloud_apps]/apps/snappymail/app/snappymail/v/2.36.1/app/libraries/RainLoop/Model/Account.php(206): RainLoop\Model\Account->netClientLogin()
#4 [nextcloud_apps]/apps/snappymail/app/snappymail/v/2.36.1/app/libraries/RainLoop/Actions/UserAuth.php(441): RainLoop\Model\Account->ImapConnectAndLogin()
#5 [nextcloud_apps]/apps/snappymail/app/snappymail/v/2.36.1/app/libraries/RainLoop/Actions/UserAuth.php(396): RainLoop\Actions->imapConnect()
#6 [nextcloud_apps]/apps/snappymail/app/snappymail/v/2.36.1/app/libraries/RainLoop/Actions/UserAuth.php(291): RainLoop\Actions->GetAccountFromSignMeToken()
#7 [nextcloud_apps]/apps/snappymail/lib/Util/SnappyMailHelper.php(71): RainLoop\Actions->getMainAccountFromToken()
#8 [nextcloud_apps]/apps/snappymail/lib/Controller/PageController.php(26): OCA\SnappyMail\Util\SnappyMailHelper::startApp()
#9 [nextcloud_apps]/lib/private/AppFramework/Http/Dispatcher.php(230): OCA\SnappyMail\Controller\PageController->index()
#10 [nextcloud_apps]/lib/private/AppFramework/Http/Dispatcher.php(137): OC\AppFramework\Http\Dispatcher->executeController()
#11 [nextcloud_apps]/lib/private/AppFramework/App.php(184): OC\AppFramework\Http\Dispatcher->dispatch()
#12 [nextcloud_apps]/lib/private/Route/Router.php(315): OC\AppFramework\App::main()
#13 [nextcloud_apps]/lib/base.php(1069): OC\Route\Router->match()
#14 [nextcloud_apps]/index.php(39): OC::handleRequest()
#15 {main}
[2024-04-28 23:57:14.461][8a9bfbce] smremember[WARNING]: AuthError[102]
[2024-04-28 23:57:14.578][dc6b7ef7] Crypt[WARNING]: Decrypt() invalid $data or $key
[2024-04-28 23:57:20.103][dc6b7ef7] IMAP[WARNING]: MailSo\Imap\Exceptions\NegativeResponseException: AUTHENTICATIONFAILED Authentication failed. in [nextcloud_apps]/apps/snappymail/app/snappymail/v/2.36.1/app/libraries/MailSo/Imap/ResponseCollection.php:46
Stack trace:
#0 [nextcloud_apps]/apps/snappymail/app/snappymail/v/2.36.1/app/libraries/MailSo/Imap/ImapClient.php(528): MailSo\Imap\ResponseCollection->validate()
#1 [nextcloud_apps]/apps/snappymail/app/snappymail/v/2.36.1/app/libraries/MailSo/Imap/ImapClient.php(166): MailSo\Imap\ImapClient->getResponse()
#2 [nextcloud_apps]/apps/snappymail/app/snappymail/v/2.36.1/app/libraries/RainLoop/Model/Account.php(264): MailSo\Imap\ImapClient->Login()
#3 [nextcloud_apps]/apps/snappymail/app/snappymail/v/2.36.1/app/libraries/RainLoop/Model/Account.php(206): RainLoop\Model\Account->netClientLogin()
#4 [nextcloud_apps]/apps/snappymail/app/snappymail/v/2.36.1/app/libraries/RainLoop/Actions/UserAuth.php(441): RainLoop\Model\Account->ImapConnectAndLogin()
#5 [nextcloud_apps]/apps/snappymail/app/snappymail/v/2.36.1/app/libraries/RainLoop/Actions/UserAuth.php(396): RainLoop\Actions->imapConnect()
#6 [nextcloud_apps]/apps/snappymail/app/snappymail/v/2.36.1/app/libraries/RainLoop/Actions/UserAuth.php(291): RainLoop\Actions->GetAccountFromSignMeToken()
#7 [nextcloud_apps]/apps/snappymail/lib/Util/SnappyMailHelper.php(71): RainLoop\Actions->getMainAccountFromToken()
#8 [nextcloud_apps]/apps/snappymail/lib/Controller/PageController.php(26): OCA\SnappyMail\Util\SnappyMailHelper::startApp()
#9 [nextcloud_apps]/lib/private/AppFramework/Http/Dispatcher.php(230): OCA\SnappyMail\Controller\PageController->index()
#10 [nextcloud_apps]/lib/private/AppFramework/Http/Dispatcher.php(137): OC\AppFramework\Http\Dispatcher->executeController()
#11 [nextcloud_apps]/lib/private/AppFramework/App.php(184): OC\AppFramework\Http\Dispatcher->dispatch()
#12 [nextcloud_apps]/lib/private/Route/Router.php(315): OC\AppFramework\App::main()
#13 [nextcloud_apps]/lib/base.php(1069): OC\Route\Router->match()
#14 [nextcloud_apps]/index.php(39): OC::handleRequest()
#15 {main}
[2024-04-28 23:57:20.104][dc6b7ef7] smremember[WARNING]: AuthError[102]
[2024-04-28 23:57:20.303][4db48fa4] Crypt[WARNING]: Decrypt() invalid $data or $key

I rebooted my server, just in case. Same thing.

icassassin avatar Apr 29 '24 00:04 icassassin

Same problem for me.

I'm on php 7.4 and I'm not using Nextcloud.

Massedil avatar Apr 29 '24 18:04 Massedil

It seems the smremember cookie is having issues when crashing.

I've modified the code a bit to drop the failing cookie. https://github.com/the-djmaze/snappymail/commit/cc360837b1df0382065ed78e2fb10335def2161c Maybe it will help prevent the issue in next release.

the-djmaze avatar Apr 29 '24 19:04 the-djmaze

It seems the smremember cookie is having issues when crashing.

I've modified the code a bit to drop the failing cookie. cc36083 Maybe it will help prevent the issue in next release.

This commit seems to do the trick. Had to refresh the page but it's working now.

icassassin avatar May 02 '24 01:05 icassassin

It seems the smremember cookie is having issues when crashing. I've modified the code a bit to drop the failing cookie. cc36083 Maybe it will help prevent the issue in next release.

This commit seems to do the trick. Had to refresh the page but it's working now.

I think this actually introduces another issue - SnappyMail doesn't seem to remember my password anymore via Nextcloud. I can log in to SnappyMail but after I close my browser I have to type my password in again.

I have Nextcloud log entries like this: [PHP] Error: Undefined variable $aTokenData at /[nextcloud]/apps/snappymail/app/snappymail/v/2.36.1/app/libraries/RainLoop/Actions/UserAuth.php#345 GET /index.php/apps/snappymail/?/Css/0/User/-/Nextcloud@custom/-/1714746443918/Hash/-/Json/ from xxx.xxx.xxx.xxx by [user] at May 3, 2024, 10:27:24 AM

icassassin avatar May 03 '24 14:05 icassassin