the-djmaze / snappymail

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

Authentication Failed @ Nextloud 2.36.2 #1602

Open TheCuteFoxxy opened 1 month ago

TheCuteFoxxy commented 1 month ago

Describe the bug Unable to login after updating Snappymail - Nextcloud to 2.36.2

To Reproduce Steps to reproduce the behavior:

  1. Update to 2.36.2 from a prior version.
  2. Attempt to login using confirmed correct credentials
  3. Observe unable to authenticate error

Expected behavior Snappymail returns an unable to authenticate error

Screenshots https://cdn.thecutefoxxy.com/WwNuuA.png

Please complete the following information:

Debug/logging information Undefined variable $aTokenData at /usr/share/nginx/nextcloud/apps/snappymail/app/snappymail/v/2.36.2/app/libraries/RainLoop/Actions/UserAuth.php#345

Additional context Appears to be similar to other issues reported and we have no clear way to rollback with Nextcloud like we can on a standalone or cpanel instance.

majick commented 1 month ago

Note that manually applying df1e592 has not actually fixed this for me; the error in your log is a red herring as best I can tell — whatever is broken with this new update may be more than that.

schmidt1024 commented 1 month ago

Confirm issue on Nextcloud Hub 8 (29.0.1) with SnappyMail 2.36.2 - Same debug info (see above)

schmidt1024 commented 1 month ago

Related https://github.com/the-djmaze/snappymail/issues/1598

HenkVirtual commented 1 month ago

the same here, from what i can see, it strips the domain-part from the loginname. We reverted back to version 2.36.1, and all is working fine.

the-djmaze commented 1 month ago

Found the problem!

Go to Nextcloud -> Admin -> Additional Settings -> SnappyMail Admin -> Extensions. Then update the Nextcloud extension to 2.36.1

Uri like: /nextcloud/apps/snappymail/?admin#/packages

When only 2.36 is available, clear the cache at nextcloud/data/appdata_snappymail/_data_/_default_/cache/

ToBeHH commented 1 month ago

Still does not work for me. In my mailserver logfile, I see the auth is being tried with just the username. However, my mailserver requires username@domain. The @domain is removed by SnappyMail. I know there are certain options in the admin panel, but they have no effect. Problem only occurred since 2.36.2, has been working flawlessly since yesterday.

extobi commented 1 month ago

My Extension is the Version 2.36.1 and it don't work. and the latest/new version 2.36.3 don't resolve the problem. in my mailserver logfile snappymail use the nextcloud login, not the (configured/or filled in) email adress login. and so also the wrong mail server.

dmitrystu commented 1 month ago

Have a same problem. Found that Nextcloud login was used instead of user-provided credentials. Nextcloud v.29.0.1 standalone SnappyMail v2.36.2 Nextcloud plugin 2.36.1 using "Attempt to automatically login users with their Nextcloud email and password, or user-defined credentials, if set." option

dmitrystu commented 1 month ago

By the way, the domain test works well.

HeldvonKosmos commented 1 month ago

There is a new version uploaded https://apps.nextcloud.com/apps/snappymail. I will try it, when it will be available for my nextcloud instance.

dmitrystu commented 1 month ago

Same issue with v2.36.3

cwm77 commented 1 month ago

Same issue with v2.36.3

Same here.

Piefje01 commented 1 month ago

Done upgrade to new snappy, but still cannot login. Nc29.*

Undefined variable $sEmail at /var/www/nextcloud/apps/snappymail/app/snappymail/v/2.36.3/app/libraries/RainLoop/Actions/AdminDomains.php#74 --
Bloodsoul commented 1 month ago

Found the problem!

Go to Nextcloud -> Admin -> Additional Settings -> SnappyMail Admin -> Extensions. Then update the Nextcloud extension to 2.36.1

Uri like: /nextcloud/apps/snappymail/?admin#/packages

When only 2.36 is available, clear the cache at nextcloud/data/appdata_snappymail/_data_/_default_/cache/

I tried to follow this after accessing the admin site before and could not reach it anymore. I always get redirected to the nextcloud dashboard. Anyhow, the mail login worked afterwards. But I still cannot acces the admin site anymore.

I found out, that some of the configurations of snappymail have changed. allow_admin_panel was switched off, other configurations vanished too.

Piefje01 commented 1 month ago

How do it this in AIO version?

martintm86 commented 1 month ago

Same Problem here.

juliadin commented 1 month ago

Uninstalling the nextcloud integration plugin in /nextcloud/apps/snappymail/?admin#/packages helped for the time being. It was @2.36.1 before I removed it. Special case here: Users do not use any of their nextcloud credentials to log into mail, so any integration that would be provided by the plugin on that side was not useful for me. If you depend on that, uninstalling the plugin might break login. YMMV

Bloodsoul commented 1 month ago

Uninstalling the nextcloud integration plugin in /nextcloud/apps/snappymail/?admin#/packages helped for the time being. It was @2.36.1 before I removed it. Special case here: Users do not use any of their nextcloud credentials to log into mail, so any integration that would be provided by the plugin on that side was not useful for me. If you depend on that, uninstalling the plugin might break login. YMMV

Thats it! The plugin vanished too. That's why I was able to log in again :)

the-djmaze commented 1 month ago

I'm working on this.

The integration became very complex due to all the different Nextcloud setups and user preferences.

I'm going to test the following:

And set priorities:

  1. user-defined credentials
  2. Nextcloud (username or email) + pass (or OIDC)
Piefje01 commented 1 month ago

Uninstall Snappy, install again Server bericht: AUTHENTICATE failed Unbox Extensions

InvalidArgumentExceptionProvider snappymail is unknown -- InvalidArgumentExceptionProvider snappymail is unknown --
extobi commented 1 month ago

Uninstalling the nextcloud integration plugin in /nextcloud/apps/snappymail/?admin#/packages helped for the time being. It was @2.36.1 before I removed it. Special case here: Users do not use any of their nextcloud credentials to log into mail, so any integration that would be provided by the plugin on that side was not useful for me. If you depend on that, uninstalling the plugin might break login. YMMV

yes this works, thanks :)

the-djmaze commented 1 month ago

I've tested and removed some changes that were made by other requests. It should be the old behavior again now with v2.36.2 of the extension.

The requested changes are dropped as they also gave more issues.

juliadin commented 1 month ago

I can confirm that with 2.36.3 of the nextcloud extension and 2.36.2 of the snappymail nextcloud integration extension I can login again normally. Thank you for your swift action! <3

croulibri commented 1 month ago

Thanks also for your quick reaction, everything is working again on my side also. Just to contribute: in my case, I don't use Nextcloud login at all but I do appreciate Nextcloud addressbook integration into Snappymail (very useful for me). Good luck and many thanks in advance for future evolution of Snappymail 🤗

Piefje01 commented 1 month ago

I dont see 2.36.3

daniu-de commented 1 month ago

I still cannot login with 2.36.3

majick commented 1 month ago

The updated 2.36.3 Nextcloud "App" does resolves my issue, and the unchecked "Use 'short' login" setting is now being obeyed when that setting should be disabled. This causes Dovecot to actually receive the correct (full) username now.

dagtk05 commented 1 month ago

The updated 2.36.3 Nextcloud "App" does resolves my issue, and the unchecked "Use 'short' login" setting is now being obeyed when that setting should be disabled. This causes Dovecot to actually receive the correct (full) username now.

Thanks friend, it helped me too.

Piefje01 commented 1 month ago

2.36.3 dont resolve the issue ...

Nextcloud⚙☑2.36.2Integrate with Nextcloud v20+ | 2.36.2 |   -- | -- | --
HeldvonKosmos commented 1 month ago

For me the 2.36.3 update solved it. The nextcloud only went some times in maintainance mode after install, but after useing backup and install the update again it worked.

Piefje01 commented 1 month ago

I think its related to

{"reqId":"eQ6zCuQjxaluqo6gOmzm","level":3,"time":"2024-05-27T16:25:03+02:00","remoteAddr":"","user":"--","app":"core","method":"","url":"--","message":"Error while running background job OCA\GroupFolders\BackgroundJob\ExpireGroupVersions (id: 158, arguments: null)","userAgent":"--","version":"29.0.1.1","exception":{"Exception":"TypeError","Message":"OCA\GroupFolders\Versions\VersionsBackend::getVersionFolderForFile(): Argument #1 ($file) must be of type OCP\Files\File, OC\Files\FileInfo given, called in /var/www/nextcloud/apps/groupfolders/lib/Versions/VersionsBackend.php on line 92","Code":0,"Trace":[{"file":"/var/www/nextcloud/apps/groupfolders/lib/Versions/VersionsBackend.php","line":92,"function":"getVersionFolderForFile","class":"OCA\GroupFolders\Versions\VersionsBackend","type":"->"},{"file":"/var/www/nextcloud/apps/groupfolders/lib/Versions/GroupVersionsExpireManager.php","line":81,"function":"getVersionsForFile","class":"OCA\GroupFolders\Versions\VersionsBackend","type":"->"},{"file":"/var/www/nextcloud/apps/groupfolders/lib/Versions/GroupVersionsExpireManager.php","line":60,"function":"expireFolder","class":"OCA\GroupFolders\Versions\GroupVersionsExpireManager","type":"->"},{"file":"/var/www/nextcloud/apps/groupfolders/lib/BackgroundJob/ExpireGroupVersions.php","line":43,"function":"expireAll","class":"OCA\GroupFolders\Versions\GroupVersionsExpireManager","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/Job.php","line":80,"function":"run","class":"OCA\GroupFolders\BackgroundJob\ExpireGroupVersions","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php","line":102,"function":"start","class":"OCP\BackgroundJob\Job","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php","line":92,"function":"start","class":"OCP\BackgroundJob\TimedJob","type":"->"},{"file":"/var/www/nextcloud/cron.php","line":176,"function":"execute","class":"OCP\BackgroundJob\TimedJob","type":"->"}],"File":"/var/www/nextcloud/apps/groupfolders/lib/Versions/VersionsBackend.php","Line":78,"message":"Error while running background job OCA\GroupFolders\BackgroundJob\ExpireGroupVersions (id: 158, arguments: null)","exception":[],"CustomMessage":"Error while running background job OCA\GroupFolders\BackgroundJob\ExpireGroupVersions (id: 158, arguments: null)"},"id":"6654a4cb725a7"}

Piefje01 commented 1 month ago

Oke i got it, go to personal settings and set the password for snappy mail

HenkVirtual commented 1 month ago

2.36.3 solved the problem on the frontend, but now I cannot get to the snappymail webadmin panel. I see the adminpanel starting but then it opens the nextcloud dashboard. In the meanwhile I managed to set the setting manually in the application.ini but it would be nice to get the webadminpanel going again.

Bloodsoul commented 1 month ago

2.36.3 solved the problem on the frontend, but now I cannot get to the snappymail webadmin panel. I see the adminpanel starting but then it opens the nextcloud dashboard. In the meanwhile I managed to set the setting manually in the application.ini but it would be nice to get the webadminpanel going again.

There is a way to activate it again. https://github.com/the-djmaze/snappymail/issues/1601#issuecomment-2133351465

daffydock commented 1 month ago

Hi, not fully sure if it is related. I updated to 2.36.3 and I will seemingly get hit with a password prompt which sometimes it will take, sometimes it won't. Also, if I want to check my folder or if I want to change to switch to a different address, it will either hang forever, or I will the following error:

"Your login passphrase has changed. Please fill in your old login passphrase to decrypt data"

It really does matter if I enter the current, or previous password. It will maybe go away for a few seconds and then it will pop up again. I am not able to switch accounts. However, if I press cancel on the prompt, it will let me access the folder of the account Snappymail defaults open to. As per OP, on 2.36.2, I was being prompted by a password and despite entering it, it would simply not take.

Disabling/enabling any and all extentions makes no difference. I am able to log in to the Admin settings and I can add domains, plus I know the password to be correct since I can access them direction through my email server's portal.

cm-schl commented 1 month ago

Hi, not fully sure if it is related. I updated to 2.36.3 and I will seemingly get hit with a password prompt which sometimes it will take, sometimes it won't. Also, if I want to check my folder or if I want to change to switch to a different address, it will either hang forever, or I will the following error:

"Your login passphrase has changed. Please fill in your old login passphrase to decrypt data"

It really does matter if I enter the current, or previous password. It will maybe go away for a few seconds and then it will pop up again. I am not able to switch accounts. However, if I press cancel on the prompt, it will let me access the folder of the account Snappymail defaults open to. As per OP, on 2.36.2, I was being prompted by a password and despite entering it, it would simply not take.

Not sure what is the source of your problem and how you're using SnappyMail but you could try this: https://github.com/the-djmaze/snappymail/issues/1570 . But keep in mind that deleting the .cryptkey file deletes all passwords of all your mailboxes and your gpg keys. So it depends on your situation if you can try this without loosing data.

daffydock commented 1 month ago

Hi, not fully sure if it is related. I updated to 2.36.3 and I will seemingly get hit with a password prompt which sometimes it will take, sometimes it won't. Also, if I want to check my folder or if I want to change to switch to a different address, it will either hang forever, or I will the following error: "Your login passphrase has changed. Please fill in your old login passphrase to decrypt data" It really does matter if I enter the current, or previous password. It will maybe go away for a few seconds and then it will pop up again. I am not able to switch accounts. However, if I press cancel on the prompt, it will let me access the folder of the account Snappymail defaults open to. As per OP, on 2.36.2, I was being prompted by a password and despite entering it, it would simply not take.

Not sure what is the source of your problem and how you're using SnappyMail but you could try this: #1570 . But keep in mind that deleting the .cryptkey file deletes all passwords of all your mailboxes and your gpg keys. So it depends on your situation if you can try this without loosing data.

I have no certain idea why this started happening. With my admin account having issues with switching email IDs while the user ID I use for my own stuff worked without issues, until the last 2 updates. This is why I changed the password on one of the ID's, which I believe made the issue more obtuse. Nevertheless, I tried the fix on #1570 and while less than optimal to input all the passwords back, it seems to be working now. I am now able to log on and switch accounts without issues or any prompts.

Thanks @cm-schl for the suggestion.

Piefje01 commented 1 month ago

Still the icon is nog good, you must click next to the mail icon to go to snappy. Otherwise it opens a different menu

daniu-de commented 1 month ago

I still cannot login with 2.36.3

sorry - no idea why but after trying again it did work for me ...

nmk-freelance commented 1 month ago

After updating to 2.36.3, it did not work for me. But only recently, I came across the Nextcloud extension which you may find under Extensions in the admin panel. It says it could be updated to 2.36.2. The extension was 2.36.1. So I downloaded the updated and tried to log in again and it just worked.

mmallejac commented 1 month ago

On a server we have also experienced this issue. A user had to add an email account to his own, and we were hit by #1561

So we did:

So probably I will try to manually patch the code without upgrading to get around #1561 , while a fix is found.