Author Topic: New File Added: Qmail+Mysql+Vpopmail Password Change Patch v1.1 (Updated)  (Read 31351 times)

Offline nadir

  • Newbie
  • *
  • Posts: 6
I did it :)
« Reply #15 on: February 26, 2009, 01:42:10 AM »
Who-ho!! i did it. Now my roundcube works with postfix+dovecot. :D
Just change this line:
$passwordquery = "UPDATE vpopmail.$dom_table SET pw_passwd = '$crypted',pw_clear_passwd='".$new_password."' WHERE pw_name = '$domain[0]';";

to:
$passwordquery = "UPDATE postfix.mailbox SET password = '$crypted'  WHERE username = '$domain[0]@$domain[1]' and domain = '$domain[1]';"

postfix version: 2.5.6,1

Offline fritz001

  • Jr. Member
  • **
  • Posts: 22
New File Added: Qmail+Mysql+Vpopmail Password Change Patch v1.0
« Reply #16 on: March 03, 2009, 01:23:34 PM »
it might be a good idea to modify password.inc to increase password complexity

something like that

rc_passwd_len
rc_passwd_uppcase_special_chars

to test somehow the password len and if password contains uppercases and special chars

Offline tjm74

  • Jr. Member
  • **
  • Posts: 10
mods to handle aliased domain, old vpopmail schema
« Reply #17 on: March 05, 2009, 09:28:19 PM »
I guess I have an old version of vpopmail, my schema just has one table "vpopmail" but it has a pw_domain column and all users are stored there.

Also, I log in using an alias domain so for this to work it needs to resolve the domain alias.  I hacked together a new version of the function rcube_save_password (in program/steps/settings/password.inc) that works in my setup, maybe somebody else will find this useful:

Code: [Select]
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);
        $true_domain = $domain[1];
        // resolve any domain aliasing (FIXME I should sanitize the dynamic part of this command)
        $true_domain = exec("/home/vpopmail/bin/vdominfo -n ".$true_domain);

        $dom_table = str_replace(".","_",$true_domain);

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

        $passwordquery = "UPDATE vpopmail.vpopmail SET "
            . "pw_passwd = " . $db->quote($crypted) . ","
            . "pw_clear_passwd = " . $db->quote($new_password)
            . " WHERE pw_domain = " . $db->quote($true_domain)
            . " AND pw_name = " . $db->quote($domain[0]) . ";";

        $db->query($passwordquery);

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

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


Watch out, I hardcoded the path to vdominfo (not sure how to grok it) and left a somewhat insecure "exec" call in there.

OTOH, the author should really use $db->quote as shown above to prevent SQL injection hacks (unlikely in this case but you never know).  But otherwise, nice mod!!!  Thanks,

 -tom

Offline Unatine

  • Newbie
  • *
  • Posts: 2
New File Added: Qmail+Mysql+Vpopmail Password Change Patch v1.0
« Reply #18 on: March 26, 2009, 05:40:08 PM »
Hi!
Some troubles with this patch (v1.1)
Use latest stable release of RoundCube.

After applying patch (app.js applied manualy), new tab appear in Settings, but when try click on Password tab, nothing happend.

If enter path like this: "?_task=settings&_action=password", password change form appear.

Offline Unatine

  • Newbie
  • *
  • Posts: 2
New File Added: Qmail+Mysql+Vpopmail Password Change Patch v1.0
« Reply #19 on: March 27, 2009, 01:50:28 AM »
Quote from: Unatine;18075
Hi!
Some troubles with this patch (v1.1)
Use latest stable release of RoundCube.

After applying patch (app.js applied manualy), new tab appear in Settings, but when try click on Password tab, nothing happend.

If enter path like this: "?_task=settings&_action=password", password change form appear.


Solved. Sorry :)

Offline nadir

  • Newbie
  • *
  • Posts: 6
i have same problem.
« Reply #20 on: April 06, 2009, 01:22:51 PM »
hi. i have a same problem too... password tab not works on new stable verion :(
anybody can give me new patch?
thanks

Offline nadir

  • Newbie
  • *
  • Posts: 6
New File Added: Qmail+Mysql+Vpopmail Password Change Patch v1.0
« Reply #21 on: April 15, 2009, 06:20:41 AM »
Quote from: Unatine;18081
Solved. Sorry :)


Hi, how did you fixed it?

Offline alex_time

  • Newbie
  • *
  • Posts: 3
New File Added: Qmail+Mysql+Vpopmail Password Change Patch v1.0
« Reply #22 on: April 17, 2009, 02:01:51 PM »
Quote from: nadir;18448
Hi, how did you fixed it?


I too would like to know how Unatine has solved the problem with the lastest 0.2.1 version.

Furthermore, I have another, maybe Bigger problem. My mail server is not on the same machine roundcube run, so the Mysql database is not on local host but on the mail server. There is a way to manually specify the host where vpopmail database is, before open the connection to the mysql server?

Offline demomm

  • Newbie
  • *
  • Posts: 1
New File Added: Qmail+Mysql+Vpopmail Password Change Patch v1.0
« Reply #23 on: April 22, 2009, 06:49:04 AM »
Quote from: nadir;18448
Hi, how did you fixed it?


I too would like to know how Unatine has solved the problem with the lastest 0.2.1 version.

I have the same problem :(
Anybody help me??

Thx.

Offline xoma

  • Newbie
  • *
  • Posts: 1
New File Added: Qmail+Mysql+Vpopmail Password Change Patch v1.0
« Reply #24 on: April 23, 2009, 08:53:39 AM »
try add file roundcube/skins/default/includes/settingscripts.html
Code: [Select]
<script type=&quot;text/javascript&quot;>

if (window.rcmail && rcmail.env.action)
  {
  var action = rcmail.env.action=='preferences' ? 'default' : (rcmail.env.action.indexOf('identity')>0 ? 'identities' : rcmail.env.action);
  var tab = document.getElementById('settingstab'+action);
  }
else
  var tab = document.getElementById('settingstabdefault');

if (tab)
  tab.className = 'tablink-selected';

</script>

Offline EugeneXXX

  • Newbie
  • *
  • Posts: 2
New File Added: Qmail+Mysql+Vpopmail Password Change Patch v1.0
« Reply #25 on: April 26, 2009, 09:07:26 AM »
Quote from: xoma;18648
try add file roundcube/skins/default/includes/settingscripts.html
Code: [Select]
<script type=&quot;text/javascript&quot;>

if (window.rcmail && rcmail.env.action)
  {
  var action = rcmail.env.action=='preferences' ? 'default' : (rcmail.env.action.indexOf('identity')>0 ? 'identities' : rcmail.env.action);
  var tab = document.getElementById('settingstab'+action);
  }
else
  var tab = document.getElementById('settingstabdefault');

if (tab)
  tab.className = 'tablink-selected';

</script>


Doesn't work.

Offline DJManas

  • Jr. Member
  • **
  • Posts: 13
New File Added: Qmail+Mysql+Vpopmail Password Change Patch v1.0
« Reply #26 on: April 26, 2009, 12:50:16 PM »
Quote from: fritz001;17270
It seems there is a problem patching latest myroundcube !!

patch -p1 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


Same problem for me. Roundcube version roundcubemail-0.2.1 how to solve this problem? All files are fresh.

Offline EugeneXXX

  • Newbie
  • *
  • Posts: 2
New File Added: Qmail+Mysql+Vpopmail Password Change Patch v1.0
« Reply #27 on: April 27, 2009, 01:29:47 AM »
Quote from: DJManas;18709
Same problem for me. Roundcube version roundcubemail-0.2.1 how to solve this problem? All files are fresh.


Replace a file app.js with my file

Offline sport

  • Jr. Member
  • **
  • Posts: 14
find a bug
« Reply #28 on: May 30, 2009, 11:05:53 AM »
Hi,

I've placed my roundcube installation with vpopmail and mysql.

The change password plugin works very well, but it has a problem with the domain with a " - " in the middle

Ex: user@some-domain.ext

I've make my solution to correct this bug

This in my code to replace in password.inc file


$dom_table_1 = str_replace(".","_",$domain[1]);
        $dom_table_2 = str_replace("-","_",$dom_table_1);

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

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


Bye bye :)

Offline nadir

  • Newbie
  • *
  • Posts: 6
for new release v0.2.2
« Reply #29 on: June 03, 2009, 04:07:46 AM »
Hi. can anybody help me? have the password change patch for new release?
old patch not works.
Why roundcube does not add this function to the project? :confused: