the-djmaze / snappymail

Simple, modern & fast web-based email client
https://snappymail.eu
GNU Affero General Public License v3.0
998 stars 121 forks source link

Cannot log in after updating to Nextcloud 28.0.5 and SnappyMail 2.36.1 #1567

Closed icassassin closed 4 months ago

icassassin commented 5 months ago

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:

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.

Massedil commented 5 months ago

Same problem for me.

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

the-djmaze commented 5 months ago

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.

icassassin commented 5 months ago

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 commented 5 months ago

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