ddavness / power-mailinabox

A Mail-in-a-Box with extra capabilities and more customizability. Not just for power users!
Creative Commons Zero v1.0 Universal
168 stars 31 forks source link

Roundcube: Use Mail-in-a-Box admin API to drive password changes #92

Closed ddavness closed 1 year ago

ddavness commented 1 year ago

Fixes #85 Related to mail-in-a-box/mailinabox#2185

The Mail-in-a-Box driver has a fallback mode where it can use the logged-in user's credentials to authenticate itself against the API. This is our next best solution (the first would be getting the root API key from /var/lib/mailinabox/api.key, but the driver does not support this and there isn't a fix we can do on our end).

Right now there are two problems with this approach:

ddavness commented 1 year ago

Alright so we're at this point where everything is more or less implemented. I'll be leaving this PR open for comments for a day or two before merging.

The only thing that I see being potentially an issue is that if you have 2FA enabled, changing the password in Roundcube will not work anymore with a very unclear messaging ("Password could not be saved" or some line along that).

kiekerjan commented 1 year ago

I like the idea of using the MiaB API to change the user's password. I'm a bit out of my depth for reviewing that code though :( Is there much added value to adding 2FA for normal users? It is only applicable to the admin portal and not to mail access.

ddavness commented 1 year ago

Is there much added value to adding 2FA for normal users?

Right now? Not really. But later down the road when we figure out how to enforce 2FA everywhere, it'll start being useful for once.

It's more along the lines of "the work is already there, so it's not too much effort to bring it to normal users"