RoundCube Webmail 0.1-beta changepassword patch

When I was deploying the new corporate mailserver I needed to re-install the webmail client. We used to work with SquirrelMail (http://www.squirrelmail.org/), a very decent and extendable webmail client. But we all know that the UI of SquirrelMail is ugly, really ugly.

So after some googling I came across this new great webmail client named RoundCube (http://www.roundcube.net/). This is a new fully featured AJAX-based webmail client with a very slick UI. From the first moment I saw that RoundCube was the way to go.

After I did the installation and played around with the webclient I wanted to extend it and give the ability to my users to change their password. The basic idea was to add a tab ‘Password’ in the settings window. Since I’ve configured my mailserver (postfix) with mysql (user fields are created dynamically) it’s just a matter of updating the correct row in the database and reconnect to the IMAP server (courier-imap).
The only problem is that the framework of RoundCube is creap, and I mean really crap. It took me 6 hours to create the tab and the underlaying forms / code. Not because I work that slow but because it’s not intuitive and you have to mess in 5 files in order to add a new action (Ok, I only worked at night on it so my mind wasn’t that clear but anyway).
Below I’ve attached the patch, so if some of you want to make your own tab you can read through the patch and see how it works.

It uses an external script (ext/change_password_function.inc) with one function in it: change_password_function ($user, $currentpass, $newpass).
In my case, it just updates the postfix mailbox database but you can modify this code to fit your needs (eg. if you use the courierpassd you can connect to the password-daemon and change the user’s password here).
Enjoy it,
Nicolas

RoundCube Webmail 0.1-beta changepassword patch

5 Responses to “RoundCube Webmail 0.1-beta changepassword patch”

  1. Roman Says:

    Hello!

    And first, thanks for this patch, how can i install it correctly?

  2. nicolas Says:

    Hi,

    Unzip the roundcube source, cd in to that directory and apply the patch with the following command:
    patch -p1 < roundcubemail-0.1beta-changepassword.patch

    When it’s done you will notice a new folder in the roundcube’s root directory called ‘ext’.
    There is one php file in it: change_password_function.inc. This php file contains only one function: function change_password_function ($user, $currentpass, $newpass);

    Now you have to change it according to your mailserver. I don’t know exactly how this must be done for all kinds of mailservers, but I’m using postfix with a mysql database. All my users are stored in that database. I just update the password for the user in that database and it’s done.
    But again: you’ll probably have to change this function to fit your mailserver.

    Kind regards,
    Nicolas

  3. Ivan Says:

    Hi Nicolas,

    your patch work for me very well, i don’t have any objection :) It’s true that i patch my files “by da hand” cause i have version 0.1_beta-r1 but anyway patch does my roundcube nice and shiny with this new option ;) I know one guy who work on this project and maybe your patch will go in next release, i don’t promise but if a have sucess i contact you via mail to take credit terms for that. At last, thank you for great job!

    Cheers,

    Ivan

  4. LedHed Says:

    Thanks for this patch, I’ve been putting off using RoundCube because it lacked a way for my uses to change their password.

    Previously I used Squirrelmail with a Password Plugin that had the option to require the user to change their password at next login. Which basically works by quering a field in the mailbox table called change_password that is set to 0 or 1, and when the user logs in if change_password is set to 1 then they are taken directly to the change password screen. I find this feature very useful when setting up new accounts with generic passwords and need to force the users to change them.

    If you think this feature would be useful and add it to your patch, please let me know.

    Thanks again for this patch,

    LedHed

  5. nicolas Says:

    test

Leave a Reply

*
To prove that you're not a bot, enter this code
Anti-Spam Image