+ Reply to Thread
Page 1 of 4 1 2 3 ... LastLast
Results 1 to 10 of 37

Thread: New File Added: Qmail+Mysql+Vpopmail Password Change Patch v1.0

  1. #1
    lucifer's Avatar
    lucifer is offline Registered User
    Join Date
    Nov 2008
    Posts
    8
    Downloads
    3
    Uploads
    1

    Default New File Added: Qmail+Mysql+Vpopmail Password Change Patch v1.1 (Updated)

    After a long searching I have found Andy and Natasha Wheatley’s Blog. They have made a virtual host password change for roundcube 0.2-stable. But I tried to use it but having some problem. Then I have modified again for them who are using qmail, mysql and vpopmail for their mail server. Thanks all the people who have worked for this password plug-in.

    Downloads: A new patch file has been added

    Qmail+Mysql+Vpopmail Password Change Patch v1.0

    Note: Please follow the instruction before using
    Last edited by lucifer; 02-25-2009 at 07:38 PM. Reason: More Information

  2. #2
    crazy is offline Registered User
    Join Date
    Feb 2009
    Posts
    2
    Downloads
    1
    Uploads
    0

    Default nice job

    It Worked!

    This is really nice. but have some question.

    what would be the proper permission for the roundcube database user to use vpopmail database ??

    can you make a vacation and forwarder for qmail.

  3. #3
    lucifer's Avatar
    lucifer is offline Registered User
    Join Date
    Nov 2008
    Posts
    8
    Downloads
    3
    Uploads
    1

    Default

    for database just give select and update permission to roundcube db user.

    I am working on vacation plug-in. soon you will get it.

  4. #4
    myrrhh is offline Registered User
    Join Date
    Feb 2007
    Posts
    3
    Downloads
    3
    Uploads
    0

    Default Multiple Domains

    Hello,
    Thanks so much for your excellent documentation and patch.

    I have a question about how to select and update one of multiple domain tables from the vpopmail mysql database. Is there a way to extract the domain from the $emailuser variable (in password.inc) and select and update the proper domain table contained in the vpopmail DB? In my vpopmail database the domains are stored as tables containing the user information fields (pw_name,pw_passwd...etc) The table names have an underscore substituted for the dot in the domain name.

    Example: email user domain= exdomain.com - vpopmail domain table name= exdomain_com

    I have tried my primitive abilities with php and regex and am unable to get this to work properly. Any help or direction that anyone can offer is much appreciated. Thanks again.

    Cheers

  5. #5
    lucifer's Avatar
    lucifer is offline Registered User
    Join Date
    Nov 2008
    Posts
    8
    Downloads
    3
    Uploads
    1

    Default

    open /program/steps/settings/password.inc

    and edit $passwordquery = "UPDATE vpopmail.domain_table SET pw_passwd = '$crypted',pw_clear_passwd='".$new_password."' WHERE pw_name = '$username';";

    you can see red one is database name ie. vpopmail. and blue one is your table name ie. exdomain_com

    just upadte this two value, I hope it will work.

  6. #6
    myrrhh is offline Registered User
    Join Date
    Feb 2007
    Posts
    3
    Downloads
    3
    Uploads
    0

    Default Multiple Domains

    Thank you so much. That does work for one domain... but if the vpopmail DB has multiple domains and users within those domains using one Round Cube interface then for each domain the "domain_table" must be different. Since the $emailuser variable is set for each user after login can it be used to set the "domain_table" name within the vpopmail DB during a password change?

    Perhaps there could be a section of code within the function rcube_save_password that takes the $emailuser variable, splits out the email username and domain as two variables - $username and $domain. then another line that replaces the dot(.) in the domain name variable $domain with an underscore and then assign it as variable $vdom. Then lastly set up the mysql query string using the $vdom variable as the vpopmail."domain_table" name and the $username variable as the $pw_name variable(similar to below). My poor regex, PHP and mysql skills prevent me from being able to modify this section properly.

    I have tried adding code something like with no success...
    just after the line-

    $cryptedpw = mkpasswd3($new_password,$crypted);

    list ($user,$domain) = split ( '@',$emailuser);
    my bad php and regex
    $vdom = preg_replace ("/^[a-zA-Z0-9]+[\.][a-zA-Z]+/", "/^[a-zA-Z0-9]+[_][a-zA-Z]+/", $domain); (I am soooo bad at regex)

    $username = preg_replace( "/^([^@]+)(@.*)$/", "$1", $emailuser);

    $passwordquery = "UPDATE vpopmail.'"$vdom"' SET pw_passwd = '$crypted',pw_clear_passwd='".$new_password."' WHERE pw_name = '$username';";

    I can't figure out the php and regex necessary for substituting the "_ " in the place of the "." in the $domain variable? and calling it $vdom

    and then using this variable $vdom as the table name in the mysql query(or update)

    I have no clue if something like this will work and am not the person to figure this out but perhaps you can help. Any assistance with the regex and query string is greatly appreciated. Many thanks to you for your consideration.
    Cheers

  7. #7
    lucifer's Avatar
    lucifer is offline Registered User
    Join Date
    Nov 2008
    Posts
    8
    Downloads
    3
    Uploads
    1

    Default

    Sorry I didn't notice that you are asking for multiple domain. Just give me some time i am fixing it. it should be dynamic and have to make another function. no porbs. give you the update soon. and thanks again for pointing this issue.

  8. #8
    fritz001 is offline Registered User
    Join Date
    Mar 2008
    Posts
    22
    Downloads
    4
    Uploads
    0

    Default

    It seems there is a problem patching latest myroundcube !!

    patch -p1 <Qmail+Mysql+Vpopmail\ Password\ Change\ Patch\ v1.0.patch
    patching file index.php
    Hunk #1 succeeded at 293 (offset 100 lines).
    patching file program/js/app.js
    Hunk #1 FAILED at 235.
    Hunk #2 FAILED at 904.
    2 out of 2 hunks FAILED -- saving rejects to file program/js/app.js.rej
    patching file program/localization/en_GB/labels.inc
    patching file program/localization/en_GB/messages.inc
    patching file program/localization/en_US/labels.inc
    patching file program/localization/en_US/messages.inc
    patching file program/steps/settings/password.inc
    patching file skins/default/includes/settingstabs.html
    patching file skins/default/templates/password.html

  9. #9
    crazy is offline Registered User
    Join Date
    Feb 2009
    Posts
    2
    Downloads
    1
    Uploads
    0

    Default

    It worked for me. I think you have already updated something in your app.js file. It's better you use a fresh roundcube folder and use the patch! or you can do it manually and just replace the patched password.inc file

  10. #10
    lucifer's Avatar
    lucifer is offline Registered User
    Join Date
    Nov 2008
    Posts
    8
    Downloads
    3
    Uploads
    1

    Default

    UPDATE FOR MULTIPLE DOMAIN

    just update the function. It will work for multiple domain. I will update my patch soon.

    function rcube_save_password($current_password, $new_password)
    {
    global $OUTPUT, $RCMAIL;

    $emailuser=$_SESSION['username'];

    $db = rcmail::get_instance()->get_dbh();

    $crypted = '';
    $cryptedpw = mkpasswd3($new_password,$crypted);

    $domain = split("@",$emailuser);

    $dom_table = str_replace(".","_",$domain[1]);

    // ONLY CHANGE YOUR vpopmail DATABASE NAME !!!!!

    $passwordquery = "UPDATE vpopmail.$dom_table SET pw_passwd = '$crypted',pw_clear_passwd='".$new_password."' WHERE pw_name = '$domain[0]';";

    $db->query($passwordquery);

    $_SESSION['password'] = encrypt_password($new_password);

    $OUTPUT->show_message('successfullysaved', 'confirmation');
    }



    -Thanks
    Last edited by lucifer; 02-25-2009 at 07:25 AM.

+ Reply to Thread
Page 1 of 4 1 2 3 ... LastLast

LinkBacks (?)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts