the-djmaze / snappymail

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

Nextcloud/Snappymail crash since update 2.30.0 #1346

Closed piotr58 closed 11 months ago

piotr58 commented 11 months ago

Describe the bug Snappymail loops indefinitely since update 2.30.0 this morning. We have a Nextcloud 26.0.9 installed.

To Reproduce Steps to reproduce the behavior:

  1. Open Nextcloud with admin login
  2. Update Snappymail in Apps
  3. test to read your mail in snappy mail

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Please complete the following information:

Debug/logging information

[2023-12-04 13:22:17.110][d9804f5c] SERVICE[WARNING]: Call to undefined method MailSo\Imap\ImapClient::FolderMyRights()
#0 /var/www/html/nextcloud/hodeia.data-terra.org/apps/snappymail/app/snappymail/v/2.30.0/app/libraries/MailSo/Imap/Commands/Folders.php(608): MailSo\Imap\ImapClient->FolderList('', '*', false, true)
#1 /var/www/html/nextcloud/hodeia.data-terra.org/apps/snappymail/app/snappymail/v/2.30.0/app/libraries/MailSo/Mail/MailClient.php(811): MailSo\Imap\ImapClient->FolderStatusList('', '*')
#2 /var/www/html/nextcloud/hodeia.data-terra.org/apps/snappymail/app/snappymail/v/2.30.0/app/libraries/RainLoop/Actions/Folders.php(58): MailSo\Mail\MailClient->Folders('', '*', false)
#3 /var/www/html/nextcloud/hodeia.data-terra.org/apps/snappymail/app/snappymail/v/2.30.0/app/libraries/RainLoop/ServiceActions.php(142): RainLoop\Actions->DoFolders()
#4 /var/www/html/nextcloud/hodeia.data-terra.org/apps/snappymail/app/snappymail/v/2.30.0/app/libraries/RainLoop/Service.php(132): RainLoop\ServiceActions->ServiceJson('')
#5 /var/www/html/nextcloud/hodeia.data-terra.org/apps/snappymail/app/snappymail/v/2.30.0/app/libraries/RainLoop/Service.php(14): RainLoop\Service::RunResult()
#6 /var/www/html/nextcloud/hodeia.data-terra.org/apps/snappymail/lib/Util/SnappyMailHelper.php(117): RainLoop\Service::Handle()
#7 /var/www/html/nextcloud/hodeia.data-terra.org/apps/snappymail/lib/Controller/PageController.php(130): OCA\SnappyMail\Util\SnappyMailHelper::startApp(true)
#8 /var/www/html/nextcloud/hodeia.data-terra.org/lib/private/AppFramework/Http/Dispatcher.php(230): OCA\SnappyMail\Controller\PageController->indexPost()
#9 /var/www/html/nextcloud/hodeia.data-terra.org/lib/private/AppFramework/Http/Dispatcher.php(137): OC\AppFramework\Http\Dispatcher->executeController(Object(OCA\SnappyMail\Controller\PageController), 'indexPost')
#10 /var/www/html/nextcloud/hodeia.data-terra.org/lib/private/AppFramework/App.php(183): OC\AppFramework\Http\Dispatcher->dispatch(Object(OCA\SnappyMail\Controller\PageController), 'indexPost')
#11 /var/www/html/nextcloud/hodeia.data-terra.org/lib/private/Route/Router.php(315): OC\AppFramework\App::main('PageController', 'indexPost', Object(OC\AppFramework\DependencyInjection\DIContainer), Array)
#12 /var/www/html/nextcloud/hodeia.data-terra.org/lib/base.php(1062): OC\Route\Router->match('/apps/snappymai...')
#13 /var/www/html/nextcloud/hodeia.data-terra.org/index.php(36): OC::handleRequest()
#14 {main}

Additional context Add any other context about the problem here.

ivnmad commented 11 months ago

See solution here: https://github.com/the-djmaze/snappymail/issues/1344

ivnmad commented 11 months ago

I just removed // from the "use Commands\ACL;" line in snappymail/v/2.30.0/app/libraries/MailSo/Imap/ImapClient.php That way I don't have to remember to rechange the settings with the next Snappymail release.

jdaviescoates commented 11 months ago

I just removed // from the "use Commands\ACL;" line in snappymail/v/2.30.0/app/libraries/MailSo/Imap/ImapClient.php That way I don't have to remember to rechange the settings with the next Snappymail release.

That worked for me too for temporarily fixing #1344

besca-red commented 11 months ago

Everything worked fine since the update of SnappyMail (2.3.0) on Nextcloud 26.0.9 (Ubuntu 20.04.6, PHP 8.1.26, PSQL 14.10). Noone is able to login anymore. In the admin panel I can successfully test the connection with the same credentials that do not work on client side - all users return to SnappyMail's login screen.

I received this debug message when I try to login:

[2023-12-07 13:09:08.488][d6de9527] IMAP[WARNING]: MailSo\Imap\Exceptions\NegativeResponseException:  Mailbox does not exist, or must be subscribed to. in /var/www/nextcloud/apps/snappymail/app/snappymail/v/2.30.0/app/libraries/MailSo/Imap/ResponseCollection.php:46
Stack trace:
#0 /var/www/nextcloud/apps/snappymail/app/snappymail/v/2.30.0/app/libraries/MailSo/Imap/ImapClient.php(544): MailSo\Imap\ResponseCollection->validate()
#1 /var/www/nextcloud/apps/snappymail/app/snappymail/v/2.30.0/app/libraries/MailSo/Imap/ImapClient.php(467): MailSo\Imap\ImapClient->getResponse()
#2 /var/www/nextcloud/apps/snappymail/app/snappymail/v/2.30.0/app/libraries/MailSo/Imap/Commands/ACL.php(133): MailSo\Imap\ImapClient->SendRequestGetResponse()
#3 /var/www/nextcloud/apps/snappymail/app/snappymail/v/2.30.0/app/libraries/MailSo/Imap/Commands/Folders.php(580): MailSo\Imap\ImapClient->FolderMyRights()
#4 /var/www/nextcloud/apps/snappymail/app/snappymail/v/2.30.0/app/libraries/MailSo/Imap/Commands/Folders.php(608): MailSo\Imap\ImapClient->FolderList()
#5 /var/www/nextcloud/apps/snappymail/app/snappymail/v/2.30.0/app/libraries/MailSo/Mail/MailClient.php(811): MailSo\Imap\ImapClient->FolderStatusList()
#6 /var/www/nextcloud/apps/snappymail/app/snappymail/v/2.30.0/app/libraries/RainLoop/Actions/Folders.php(58): MailSo\Mail\MailClient->Folders()
#7 /var/www/nextcloud/apps/snappymail/app/snappymail/v/2.30.0/app/libraries/RainLoop/ServiceActions.php(142): RainLoop\Actions->DoFolders()
#8 /var/www/nextcloud/apps/snappymail/app/snappymail/v/2.30.0/app/libraries/RainLoop/Service.php(132): RainLoop\ServiceActions->ServiceJson()
#9 /var/www/nextcloud/apps/snappymail/app/snappymail/v/2.30.0/app/libraries/RainLoop/Service.php(14): RainLoop\Service::RunResult()
#10 /var/www/nextcloud/apps/snappymail/lib/Util/SnappyMailHelper.php(117): RainLoop\Service::Handle()
#11 /var/www/nextcloud/apps/snappymail/lib/Controller/PageController.php(130): OCA\SnappyMail\Util\SnappyMailHelper::startApp()
#12 /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php(230): OCA\SnappyMail\Controller\PageController->indexPost()
#13 /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php(137): OC\AppFramework\Http\Dispatcher->executeController()
#14 /var/www/nextcloud/lib/private/AppFramework/App.php(183): OC\AppFramework\Http\Dispatcher->dispatch()
#15 /var/www/nextcloud/lib/private/Route/Router.php(315): OC\AppFramework\App::main()
#16 /var/www/nextcloud/lib/base.php(1062): OC\Route\Router->match()
#17 /var/www/nextcloud/index.php(36): OC::handleRequest()
#18 {main}
[2023-12-07 13:09:08.519][d6de9527] SERVICE[WARNING]:  Mailbox does not exist, or must be subscribed to.
#0 /var/www/nextcloud/apps/snappymail/app/snappymail/v/2.30.0/app/libraries/MailSo/Imap/ImapClient.php(544): MailSo\Imap\ResponseCollection->validate()
#1 /var/www/nextcloud/apps/snappymail/app/snappymail/v/2.30.0/app/libraries/MailSo/Imap/ImapClient.php(467): MailSo\Imap\ImapClient->getResponse()
#2 /var/www/nextcloud/apps/snappymail/app/snappymail/v/2.30.0/app/libraries/MailSo/Imap/Commands/ACL.php(133): MailSo\Imap\ImapClient->SendRequestGetResponse()
#3 /var/www/nextcloud/apps/snappymail/app/snappymail/v/2.30.0/app/libraries/MailSo/Imap/Commands/Folders.php(580): MailSo\Imap\ImapClient->FolderMyRights()
#4 /var/www/nextcloud/apps/snappymail/app/snappymail/v/2.30.0/app/libraries/MailSo/Imap/Commands/Folders.php(608): MailSo\Imap\ImapClient->FolderList()
#5 /var/www/nextcloud/apps/snappymail/app/snappymail/v/2.30.0/app/libraries/MailSo/Mail/MailClient.php(811): MailSo\Imap\ImapClient->FolderStatusList()
#6 /var/www/nextcloud/apps/snappymail/app/snappymail/v/2.30.0/app/libraries/RainLoop/Actions/Folders.php(58): MailSo\Mail\MailClient->Folders()
#7 /var/www/nextcloud/apps/snappymail/app/snappymail/v/2.30.0/app/libraries/RainLoop/ServiceActions.php(142): RainLoop\Actions->DoFolders()
#8 /var/www/nextcloud/apps/snappymail/app/snappymail/v/2.30.0/app/libraries/RainLoop/Service.php(132): RainLoop\ServiceActions->ServiceJson()
#9 /var/www/nextcloud/apps/snappymail/app/snappymail/v/2.30.0/app/libraries/RainLoop/Service.php(14): RainLoop\Service::RunResult()
#10 /var/www/nextcloud/apps/snappymail/lib/Util/SnappyMailHelper.php(117): RainLoop\Service::Handle()
#11 /var/www/nextcloud/apps/snappymail/lib/Controller/PageController.php(130): OCA\SnappyMail\Util\SnappyMailHelper::startApp()
#12 /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php(230): OCA\SnappyMail\Controller\PageController->indexPost()
#13 /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php(137): OC\AppFramework\Http\Dispatcher->executeController()
#14 /var/www/nextcloud/lib/private/AppFramework/App.php(183): OC\AppFramework\Http\Dispatcher->dispatch()
#15 /var/www/nextcloud/lib/private/Route/Router.php(315): OC\AppFramework\App::main()
#16 /var/www/nextcloud/lib/base.php(1062): OC\Route\Router->match()
#17 /var/www/nextcloud/index.php(36): OC::handleRequest()
#18 {main}
jdaviescoates commented 11 months ago

@besca-red presumably this will be fixed in the next update but for now, if you're able to access the files of your Nextcloud, you can go to:

apps/snappymail/app/snappymail/v/2.30.0/app/libraries/MailSo/Imap and then edit the file called ImapClient.php and remove the // from in front of use Commands\ACL; (which is line 23 for me).

That fixes it.

besca-red commented 11 months ago

@jdaviescoates Sorry, I forgot to mention: That didn't help. The error message is not the same as the one piotr58 posted. However, "our" error has also been occurring since the update.

the-djmaze commented 11 months ago

@besca-red

Mailbox does not exist, or must be subscribed to

Says enough. For that to debug we need 2 log entries:

  1. The STATUS command (tells which folder)
  2. The LIST command result (tells the info of the folder)

Then open a new issue. As it has something to do with \Noselect

BiglifeMatt commented 11 months ago

@besca-red presumably this will be fixed in the next update but for now, if you're able to access the files of your Nextcloud, you can go to:

apps/snappymail/app/snappymail/v/2.30.0/app/libraries/MailSo/Imap and then edit the file called ImapClient.php and remove the // from in front of use Commands\ACL; (which is line 23 for me).

That fixes it.

This did help my issue of the loading page looping and never resolving. Thanks! Saved my day!

BiglifeMatt commented 11 months ago

I spoke too soon with the solution being good. It works for me and others but is not universal. Some users are still not able to authenticate or log in fully. It just bounces back to the snappy login screen. I thought it was their browser but when I log into them on my device, I get the same result. So it is behaving different for different logins. Not sure what is happening there.

BiglifeMatt commented 11 months ago

Is there a way to roll back to a previous version? 2.30 is working for some of my users but not all.

BiglifeMatt commented 11 months ago

It looks like the new update does not like '&' in user folder names. I had one user with this set up and it was working prior to the 2.30.0 update. I renamed his folders and now he is able to log in again.

From my log:

[2023-12-08 19:18:45.084][6f7f8708] IMAP[INFO]: > TAG6 MYRIGHTS "NCPN & BUGB"\r\n [2023-12-08 19:18:45.085][6f7f8708] IMAP[INFO]: < TAG6 NO Mailbox name is not valid mUTF-7 (0.001 + 0.000 secs).\r\n

[2023-12-08 19:18:45.086][6f7f8708] IMAP[WARNING]: MailSo\Imap\Exceptions\NegativeResponseException: Mailbox name is not valid mUTF-7 (0.001 + 0.000 secs). in /var/www/nextcloud/apps/snappymail/app/snappymail/v/2.30.0/app/libraries/MailSo/Imap/ResponseCollection.php:46