Author Topic: RoundCube Webmail 0.1-beta changepassword patch  (Read 26115 times)

Offline rgonzalez

  • Newbie
  • *
  • Posts: 4
Re: RoundCube Webmail 0.1-beta changepassword patch
« Reply #15 on: September 11, 2006, 11:24:42 AM »
what if the user/pass is stored in a corporate ms-sql database..? can I rewrite mysql_connect to eqivalent php mssql_connect...? keeping the logic is my concern, how to access the database should be irrelevant if the logic is not affected while doing so.

am I on the right track here..?

regards and thanks for a real webmail interface !

Offline ledhed

  • Newbie
  • *
  • Posts: 2
Re: RoundCube Webmail 0.1-beta changepassword patch
« Reply #16 on: September 21, 2006, 02:22:32 PM »
I decided to upgrade to beta2.
I applied this patch to roundcube-beta2, and all seems to have gone well except that when I go to change my password, there are no fields to change the password.

I had this patch working on the previous version of Roundcube.

Any ideas???




-LedHed

Offline bozhe

  • Newbie
  • *
  • Posts: 8
Re: RoundCube Webmail 0.1-beta changepassword patch
« Reply #17 on: September 22, 2006, 02:13:11 PM »
When I got the error 'An error occured while saving' I checked the logs/errors file which told me 'PHP Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'postfix'@'localhost' (using password: YES) in /opt/lampp/htdocs/rc/ext/change_password_function.inc on line 47' . I checked that location and it seems one is supposed to enter info about the mysql database of the imap server (assumed to be postfix). I hope that this info help others in solving this problem ('An error occured while saving'). Unfortunately, the imap server I use is a squirrelmail server, which uses a mysql database but I dont think that passwords are stored there (squirrelmail, at least the way it's set up by me, uses the servers user database in /etc/passwd and /etc/shadow).
 I am not a programmer; Is there a way to modify the change_password_function to change a squirelmail password which is actually a linux system password?(when we change user's passwords, we [the system admins] have to log on to the linux/squirrel mail server and use the passwd command).
 This is a great add-on to roundcube; if only it could be easily configured to change passwords on a few types of imap servers (postfix, squirrelmail, exim, etc.) with various database configurations (mysql, postgres,ldap, etc) it would be a MAGNIFICENT add-on.

 bozhe

Offline dfitch

  • Newbie
  • *
  • Posts: 1
Re: RoundCube Webmail 0.1-beta changepassword patch
« Reply #18 on: September 22, 2006, 02:44:14 PM »
Thanks for the Contrib, works great with beta2 and hMailServer!! ;)

Offline kali

  • Jr. Member
  • **
  • Posts: 57
Re: RoundCube Webmail 0.1-beta changepassword patch
« Reply #19 on: September 23, 2006, 04:03:35 PM »
Quote from: bozhe
I am not a programmer; Is there a way to modify the change_password_function to change a squirelmail password which is actually a linux system password?(when we change user's passwords, we [the system admins] have to log on to the linux/squirrel mail server and use the passwd command).
 This is a great add-on to roundcube; if only it could be easily configured to change passwords on a few types of imap servers (postfix, squirrelmail, exim, etc.) with various database configurations (mysql, postgres,ldap, etc) it would be a MAGNIFICENT add-on.

 bozhe

Hi Bozhe,

See my thread on "changing /etc/shadow" password plug-in. It works and is finalized (and I have it in production). Just as a note - different imap servers maintain user data differently. Cyrus IMAP keeps it in the sasl database (non-local users) and therefore pretty easy to change. Others keep mysql databases for user id/pw. UW-imap and other services like samba, ftp etc. require you have "local users" and changing those passwords is not as easy (requiring that user access - as in setuid - or root access). This is difficult to impossible for the web server to do and is best achieved with cgi. This is how squirrel did it - and how I approached it.

If you are running local users - and want pw change functionality built right into the preferences tab - check this thread - try it and let me know if you have any comment!!

http://roundcubeforum.net/forum/index.php?topic=551.msg2925#msg2925

Offline bozhe

  • Newbie
  • *
  • Posts: 8
Re: RoundCube Webmail 0.1-beta changepassword patch
« Reply #20 on: September 25, 2006, 12:12:10 PM »
Thank you, kali, for the info and for taking the time to respond to my post. I will try out what you suggest and let you know what happens.

 bozhe :)

Offline bozhe

  • Newbie
  • *
  • Posts: 8
Re: RoundCube Webmail 0.1-beta changepassword patch
« Reply #21 on: October 03, 2006, 01:25:50 PM »
Hi Kali,

 Your changepassword patch worked wonderfully. Thank you so much for writing what is an elegant and bug-free (I haven't found any) patch.

bozhe

 

Offline kali

  • Jr. Member
  • **
  • Posts: 57
Re: RoundCube Webmail 0.1-beta changepassword patch
« Reply #22 on: October 03, 2006, 02:53:54 PM »
Quote from: bozhe
Hi Kali,

 Your changepassword patch worked wonderfully. Thank you so much for writing what is an elegant and bug-free (I haven't found any) patch.

bozhe

Thanks bozhe! 8)

I'm hoping that - like some other webmail apps - the RC "owners" can set up a plugin area where links to various plugins (downloads and updates) could be found - rather than having to search through postings on the forum.

Offline jeeth

  • Newbie
  • *
  • Posts: 2
Re: RoundCube Webmail 0.1-beta changepassword patch
« Reply #23 on: October 04, 2006, 06:04:53 AM »
Quote from: SKaero
Thanks For posting this, It will be a good tool!

I have chaged the function rcmail_save_passwd() in file program/steps/settings/passwd.inc , which now can accept the imap password change through the port 106, let me know if it is usefull.

Thanks
jeeth
-----------------------------------------------------------------
function rcmail_save_passwd($new_pw){
 global $CONFIG, $_SESSION;
 $poppassd_server = "localhost"; //imap server address

 $old_pw = decrypt_passwd($_SESSION['password']);
 $username = $_SESSION['username'];

 $pop_socket = fsockopen($poppassd_server, 106, $errno, $errstr);
  if (!$pop_socket) {
    $messages[] = _("ERROR") . ': ' . "$errstr ($errno)";
    return FALSE;
    return $messages;
  }

  cpw_poppassd_readfb($pop_socket, $result, $messages, $debug);
  if(!preg_match('/^2\d\d/', $result) ) {
    cpw_poppassd_closeport($pop_socket, $messages, $debug);
    return FALSE;
    return $messages;
  }

  fputs($pop_socket, "user $username\r\n");
  cpw_poppassd_readfb($pop_socket, $result, $messages, $debug);
  if(!preg_match('/^[23]\d\d/', $result) ) {
    cpw_poppassd_closeport($pop_socket, $messages, $debug);
    return FALSE;
    return $messages;
  }


 fputs($pop_socket, "pass $old_pw\r\n");
  cpw_poppassd_readfb($pop_socket, $result, $messages, $debug);
  if(!preg_match('/^[23]\d\d/', $result) ) {
    cpw_poppassd_closeport($pop_socket, $messages, $debug);
    return FALSE;
    return $messages;
  }
 fputs($pop_socket, "newpass $new_pw\r\n");
  cpw_poppassd_readfb($pop_socket, $result, $messages, $debug);
  cpw_poppassd_closeport($pop_socket, $messages, $debug);
   $_SESSION['password'] = encrypt_passwd($new_pw);
  if(!preg_match('/^2\d\d/', $result) ) {
    return FALSE;
    return $messages;
  }

  return TRUE;

}
//-- following function have been added ---//

function cpw_poppassd_closeport($pop_socket, &$messages, $debug = 0) {
  if ($debug) {
    array_push($messages, _("Closing Connection"));
  }
  fputs($pop_socket, "quit\r\n");
  fclose($pop_socket);
}

function cpw_poppassd_readfb($pop_socket, &$result, &$messages, $debug = 0) {
  $strResp = '';
  $result = '';

  if (!feof($pop_socket)) {
   $strResp = fgets($pop_socket, 1024);
   $result = substr(trim($strResp), 0, 3); // 200, 500
   if(!preg_match('/^[23]\d\d/', $result) || $debug) {
     $messages[] = "--> $strResp";
   }
  }
}

Offline fredanthony

  • Newbie
  • *
  • Posts: 1
Re: RoundCube Webmail 0.1-beta changepassword patch
« Reply #24 on: October 12, 2006, 04:29:51 PM »
Quote from: ledhed
I decided to upgrade to beta2.
I applied this patch to roundcube-beta2, and all seems to have gone well except that when I go to change my password, there are no fields to change the password.

I had this patch working on the previous version of Roundcube.

Any ideas???




-LedHed

Yep, I got the same issue, latest install no form fileds showing, only the save button.

Offline knarph

  • Newbie
  • *
  • Posts: 1
Re: RoundCube Webmail 0.1-beta changepassword patch
« Reply #25 on: October 28, 2006, 02:40:30 AM »
Quote from: jeeth
I have chaged the function rcmail_save_passwd() in file program/steps/settings/passwd.inc , which now can accept the imap password change through the port 106, let me know if it is usefull.

Thanks
jeeth

I've applied this patch to roundcubemail 0.1b2 and made it available for download. It should be a way simpler install for those of you who had trouble applying jeeth's patch.

You can find the tarball at http://iacovino.org/