[TUTORIAL] How to allow your SnappyMail users to change their mailbox passwords

CyberPanel uses Snappymail and the ChangePassword feature (now re-implemented as plugin) was removed from core.

However, you can install Change Password plugin which adds change password capability to webmail.

Install the Change Password plugin

  1. Run in SSH Terminal
$ cd /usr/local/lscp/cyberpanel/rainloop/data/_data_/_default_/plugins && wget https://github.com/josephgodwinkimani/cyberpanel-mods/raw/main/change-password.zip && unzip change-password.zip && rm -f change-password.zip 
  1. Login to SnappyMail as admin https://SERVER_URL/snappymail/?admin

  2. Go to https://SERVER_URL/snappymail/?admin#/packages activate Change Password plugin

  3. Press the gear icon besides the title of plugin and add the mariadb root and password from nano /usr/local/CyberCP/CyberCP/settings.py CTRL+W (search for) DATABASES =

  4. Change mysql statement to UPDATE e_users SET password = :newpass WHERE email = :email AND emailOwner_id = :domain

  5. Under Encrypt options In what way do you want the passwords to be encrypted? choose bcrypt and prefix as {CRYPT} (Optional encrypted password prefix, like {ARGON2I} or {BLF-CRYPT} or {SHA512-CRYPT})

  6. Change DSN from mysql:host=localhost;dbname=snappymail;charset=utf8 to mysql:host=localhost;dbname=cyberpanel;charset=utf8

Now the plugin is ready to activate. Activate it and test it will a mailbox user.

Hello,
this “ispconfig” should remain unflagged?
Do I need to enable “pdo” only?
thanks

Hello @Domenico ISPConfig settings are meant for ISPConfig panel not CyberPanel. They should remain unchecked. Use PDO instead:

thanks a lot!

Hi team
Is the right and last update version for Change Password is 2.17 ?
if it’s right one i don’t understand on tutirial this mention ; " add the mariadb root and password from nano /usr/local/CyberCP/CyberCP/settings.py CTRL+W (search for) DATABASES ="
WHERE i have to search ? not clear for me sorry ?

I do all change requested but it still not working
let me know
what i miss please
Thanks a lot for your effort

Hello @Fraleu

Add mariadb root password you see on this file /usr/local/CyberCP/CyberCP/settings.py. If you have the Root File Manager addon then you can access it and search for DATABASES = directive you will see root password here in list of database connections/configurations

it’s done
i make change and get confirmation it’s done
below error when i perform test
Capture d’écran 2023-04-17 223235

I test with all one
i test with new one

oups with old one

The encrypt prefix is wrong check the tutorial for the right option {CRYPT}

i followed the tutorial, but my users still cannot change their password

for me all working fine
thanks very much

where we can set the username and password ?
or what are the default username and password ?

I don’t see the MariaDB on the directory you mentioned!

Hello @evonet

No I did not. You download it straight from official repo.

This is the version I used for this tutorial. Maybe try the new version and report back here if it works for you.