diff -ruN roundcubemail-0.1beta.orig/ext/change_password_function.inc roundcubemail-0.1beta/ext/change_password_function.inc
--- roundcubemail-0.1beta.orig/ext/change_password_function.inc	1970-01-01 01:00:00.000000000 +0100
+++ roundcubemail-0.1beta/ext/change_password_function.inc	2006-05-21 05:19:43.000000000 +0200
@@ -0,0 +1,74 @@
+<?php
+
+/*
+ +-----------------------------------------------------------------------+
+ | program/steps/settings/change_password.inc                            |
+ |                                                                       |
+ | This file is part of the RoundCube Webmail client                     |
+ | Copyright (C) 2005, RoundCube Dev. - Switzerland                      |
+ | Licensed under the GNU GPL                                            |
+ |                                                                       |
+ | PURPOSE:                                                              |
+ |   Show edit form for a identity record or to add a new one            |
+ |                                                                       |
+ +-----------------------------------------------------------------------+
+ | Author: Nicolas Van Eenaeme <nicolas@poison.be>                       |
+ +-----------------------------------------------------------------------+
+
+ $Id: edit_identity.inc,v 1.1 2006/05/21 05:19:43 roundcube Exp $
+
+*/
+
+  // The host of the database
+  define ('RCUBE_EXT_CHANGE_PASS_HOST',  'localhost');
+
+  // The username to connect to the database
+  define ('RCUBE_EXT_CHANGE_PASS_USER',  'postfix');
+
+  // The password to connect to the database
+  define ('RCUBE_EXT_CHANGE_PASS_PASS',  'password');
+
+  // The name of the database
+  define ('RCUBE_EXT_CHANGE_PASS_NAME',  'postfix');
+
+  // The update query. You can use '%clear%'  for the clear password,
+  //                               '%md5%'    for the md5 encrypted password,
+  //                               '%user%'   for the username,
+  //                               '%old%'    for the old password and
+  //                               '%oldmd5%' for the old md5 encrypted password.
+  define ('RCUBE_EXT_CHANGE_PASS_UPDATEQUERY', 'UPDATE mailbox SET password = "%md5%" WHERE username = "%user%" AND password = "%oldmd5%"');
+
+  // The select query (needed to verify the md5.
+  define ('RCUBE_EXT_CHANGE_PASS_SELECTQUERY', 'SELECT password FROM mailbox WHERE username = "%user%"');
+
+
+  function change_password_function ($user, $currentpass, $newpass)
+    {
+    $dbh =& mysql_connect (RCUBE_EXT_CHANGE_PASS_HOST, RCUBE_EXT_CHANGE_PASS_USER, RCUBE_EXT_CHANGE_PASS_PASS);
+    if (!is_resource ($dbh))
+      return FALSE;
+
+    if (!mysql_select_db (RCUBE_EXT_CHANGE_PASS_NAME, $dbh))
+      return FALSE;
+
+    $q = str_replace ('%user%', $user, RCUBE_EXT_CHANGE_PASS_SELECTQUERY);
+    $dbr =& mysql_query ($q, $dbh);
+    if (!is_resource ($dbr))
+      return FALSE;
+
+    $data = mysql_fetch_row ($dbr);
+    mysql_free_result ($dbr);
+
+    $newpassmd5 = crypt ($newpass, $data[0]);
+    $currentpassmd5 = crypt ($currentpass, $data[0]);
+    $q = str_replace (array ('%user%', '%clear%', '%md5%', '%old%', '%oldmd5%'), array ($user, $newpass, $newpassmd5, $currentpass, $currentpassmd5), RCUBE_EXT_CHANGE_PASS_UPDATEQUERY);
+
+    $dbr =& mysql_query ($q, $dbh);
+    if (!$dbr || mysql_affected_rows ($dbh) != 1)
+        return FALSE;
+
+    mysql_close ($dbh);
+    return TRUE;
+    }
+
+?>
diff -ruN roundcubemail-0.1beta.orig/index.php roundcubemail-0.1beta/index.php
--- roundcubemail-0.1beta.orig/index.php	2006-02-21 00:29:13.000000000 +0100
+++ roundcubemail-0.1beta/index.php	2006-05-21 03:46:20.000000000 +0200
@@ -330,6 +330,8 @@
   if ($_action=='folders' || $_action=='subscribe' || $_action=='unsubscribe' || $_action=='create-folder' || $_action=='delete-folder')
     include('program/steps/settings/manage_folders.inc');
 
+  if ($_action=='password' || $_action=='change-password')
+    include('program/steps/settings/change_password.inc');
   }
 
 
--- roundcubemail-0.1beta.orig/program/include/main.inc	2006-02-21 00:29:13.000000000 +0100
+++ roundcubemail-0.1beta/program/include/main.inc	2006-05-20 02:04:38.000000000 +0200
@@ -1072,7 +1072,8 @@
         'identityform' => 'rcube_identity_form',
         'foldersubscription' => 'rcube_subscription_form',
         'createfolder' => 'rcube_create_folder_form',
-        'composebody' => 'rcmail_compose_body'
+        'composebody' => 'rcmail_compose_body',
+        'changepassform' => 'rcmail_change_pass_form'
       );
 
       
diff -ruN roundcubemail-0.1beta.orig/program/js/app.js roundcubemail-0.1beta/program/js/app.js
--- roundcubemail-0.1beta.orig/program/js/app.js	2006-02-19 21:21:58.000000000 +0100
+++ roundcubemail-0.1beta/program/js/app.js	2006-05-21 15:37:23.000000000 +0200
@@ -194,7 +194,7 @@
 
 
       case 'settings':
-        this.enable_command('preferences', 'identities', 'save', 'folders', true);
+        this.enable_command('preferences', 'identities', 'save', 'folders', 'password', true);
         
         if (this.env.action=='identities' || this.env.action=='edit-identity' || this.env.action=='add-identity')
           this.enable_command('edit', 'add', 'delete', true);
@@ -205,6 +205,9 @@
         if (this.env.action=='folders')
           this.enable_command('subscribe', 'unsubscribe', 'create-folder', 'delete-folder', true);
           
+        if (this.env.action=='password')
+          this.enable_command('change-password', true);
+          
         var identities_list = this.gui_objects.identitieslist;
         if (identities_list)
           this.init_identitieslist(identities_list);
@@ -946,6 +949,41 @@
           this.delete_folder(props);
         break;
 
+      case 'password':
+        location.href = this.env.comm_path+'&_action=password';
+        break;
+
+      case 'change-password':
+        if (this.gui_objects.editform)
+          {
+          var input_currentpass = rcube_find_object('_currentpass');
+          var input_newpass  = rcube_find_object('_newpass');
+          var input_confirmpass = rcube_find_object('_confirmpass');
+
+          if (input_currentpass.value == "")
+            {
+            alert(this.get_label('nocurrentpasswarning'));
+            input_currentpass.focus();
+            break;
+            }
+
+          if (input_newpass.value == "")
+            {
+            alert(this.get_label('nonewpasswarning'));
+            input_newpass.focus();
+            break;
+            }
+
+          if (input_newpass.value != input_confirmpass.value)
+            {
+            alert(this.get_label('nomatchpasswarning'));
+            input_confirmpass.focus();
+            break;
+            }
+
+          this.gui_objects.editform.submit();
+          }
+        break;
       }
 
     return obj ? false : true;
diff -ruN roundcubemail-0.1beta.orig/program/localization/en_US/labels.inc roundcubemail-0.1beta/program/localization/en_US/labels.inc
--- roundcubemail-0.1beta.orig/program/localization/en_US/labels.inc	2006-02-04 19:05:36.000000000 +0100
+++ roundcubemail-0.1beta/program/localization/en_US/labels.inc	2006-05-21 03:53:49.000000000 +0200
@@ -179,6 +179,12 @@
 $labels['newitem']  = 'New item';
 $labels['edititem']  = 'Edit item';
 
+$labels['changepassword'] = 'Change your password';
+
+$labels['currentpass'] = 'Current password';
+$labels['newpass'] = 'New password';
+$labels['confirmpass'] = 'Confirm new password';
+
 $labels['setdefault']  = 'Set default';
 $labels['language']  = 'Language';
 $labels['timezone']  = 'Time zone';
diff -ruN roundcubemail-0.1beta.orig/program/localization/en_US/messages.inc roundcubemail-0.1beta/program/localization/en_US/messages.inc
--- roundcubemail-0.1beta.orig/program/localization/en_US/messages.inc	2006-01-25 21:10:12.000000000 +0100
+++ roundcubemail-0.1beta/program/localization/en_US/messages.inc	2006-05-21 14:46:15.000000000 +0200
@@ -88,4 +88,12 @@
 
 $messages['nosearchname'] = 'Please enter a contact name or email address';
 
+$messages['nocurrentpasswarning'] = 'Please enter your current password';
+
+$messages['nonewpasswarning'] = 'Please enter your new password';
+
+$messages['nomatchpasswarning'] = 'The new password and it\'s confirmation doesn\'t match';
+
+$messages['invalidpassword'] = 'Your current password is invalid';
+
 ?>
diff -ruN roundcubemail-0.1beta.orig/program/steps/settings/change_password.inc roundcubemail-0.1beta/program/steps/settings/change_password.inc
--- roundcubemail-0.1beta.orig/program/steps/settings/change_password.inc	1970-01-01 01:00:00.000000000 +0100
+++ roundcubemail-0.1beta/program/steps/settings/change_password.inc	2006-05-21 14:46:33.000000000 +0200
@@ -0,0 +1,103 @@
+<?php
+
+/*
+ +-----------------------------------------------------------------------+
+ | program/steps/settings/change_password.inc                            |
+ |                                                                       |
+ | This file is part of the RoundCube Webmail client                     |
+ | Copyright (C) 2005, RoundCube Dev. - Switzerland                      |
+ | Licensed under the GNU GPL                                            |
+ |                                                                       |
+ | PURPOSE:                                                              |
+ |   Change the current password into a new one                          |
+ |                                                                       |
+ +-----------------------------------------------------------------------+
+ | Author: Nicolas Van Eenaeme <nicolas@poison.be>                       |
+ +-----------------------------------------------------------------------+
+
+ $Id: edit_identity.inc,v 1.1 2006/05/21 14:46:33 roundcube Exp $
+
+*/
+
+// init IAMP connection
+rcmail_imap_init(TRUE);
+
+if ($_POST['_action'] == 'change-password')
+  {
+  include ('ext/change_password_function.inc');
+  if ($_SESSION['password'] != encrypt_passwd($_POST['_currentpass']))
+    {
+    show_message('invalidpassword', 'error');
+    }
+  elseif (false || change_password_function ($_SESSION['username'], $_POST['_currentpass'], $_POST['_newpass']))
+    {
+    $IMAP->pass = $_POST['_newpass'];
+    $IMAP->reconnect ();
+    $_SESSION['password']  = encrypt_passwd($_POST['_newpass']);
+
+    show_message('successfullysaved', 'confirmation');
+    }
+  else
+    show_message('errorsaving', 'error');
+
+    // go to next step
+    $_action = 'password';
+
+    // overwrite action variable
+    $OUTPUT->add_script(sprintf("\n%s.set_env('action', '%s');", $JS_OBJECT_NAME, $_action));
+    }
+
+  $PAGE_TITLE = rcube_label('changepassword');
+
+
+function rcmail_change_pass_form($attrib)
+  {
+  global $IDENTITY_RECORD, $JS_OBJECT_NAME;
+
+  // add some labels to client
+  rcube_add_label('nocurrentpasswarning');
+  rcube_add_label('nonewpasswarning');
+  rcube_add_label('nomatchpasswarning');
+
+  list($form_start, $form_end) = get_form_tags($attrib, 'change-password');
+  unset($attrib['form']);
+
+
+  // return the complete edit form as table
+  $out = "$form_start<table>\n\n";
+
+  // show the current password field
+  $field_id = 'rcmfd_currentpass';
+  $input_currentpass = new passwordfield(array('name' => '_currentpass', 'id' => $field_id, 'size' => 20));
+
+  $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n",
+                  $field_id,
+                  rep_specialchars_output(rcube_label('currentpass')),
+                  $input_currentpass->show());
+
+  // show the new password field
+  $field_id = 'rcmfd_newpass';
+  $input_newpass = new passwordfield(array('name' => '_newpass', 'id' => $field_id, 'size' => 20));
+
+  $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n",
+                  $field_id,
+                  rep_specialchars_output(rcube_label('newpass')),
+                  $input_newpass->show());
+
+  // show the confirm password field
+  $field_id = 'rcmfd_confirmpass';
+  $input_confirmpass = new passwordfield(array('name' => '_confirmpass', 'id' => $field_id, 'size' => 20));
+
+  $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n",
+                  $field_id,
+                  rep_specialchars_output(rcube_label('confirmpass')),
+                  $input_confirmpass->show());
+
+  $out .= "\n</table>$form_end";
+
+  return $out;  
+  }
+
+
+  parse_template('changepassword');
+?>
\ No newline at end of file
diff -ruN roundcubemail-0.1beta.orig/skins/default/includes/settingstabs.html roundcubemail-0.1beta/skins/default/includes/settingstabs.html
--- roundcubemail-0.1beta.orig/skins/default/includes/settingstabs.html	2005-09-25 16:18:58.000000000 +0200
+++ roundcubemail-0.1beta/skins/default/includes/settingstabs.html	2006-05-17 20:12:34.000000000 +0200
@@ -1,3 +1,4 @@
 <div id="tabsbar">
 <span id="settingstabdefault" class="tablink"><roundcube:button command="preferences" type="link" label="preferences" title="editpreferences" /></span><span id="settingstabfolders" class="tablink"><roundcube:button command="folders" type="link" label="folders" title="managefolders" class="tablink" /></span><span id="settingstabidentities" class="tablink"><roundcube:button command="identities" type="link" label="identities" title="manageidentities" class="tablink" /></span>
+<span id="settingstabpassword" class="tablink"><roundcube:button command="password" type="link" label="password" title="changepassword" class="tablink" /></span>
 </div>
diff -ruN roundcubemail-0.1beta.orig/skins/default/templates/changepassword.html roundcubemail-0.1beta/skins/default/templates/changepassword.html
--- roundcubemail-0.1beta.orig/skins/default/templates/changepassword.html	1970-01-01 01:00:00.000000000 +0100
+++ roundcubemail-0.1beta/skins/default/templates/changepassword.html	2006-05-21 03:33:05.000000000 +0200
@@ -0,0 +1,27 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title><roundcube:object name="pagetitle" /></title>
+<roundcube:include file="/includes/links.html" />
+<link rel="stylesheet" type="text/css" href="/settings.css" />
+</head>
+<body>
+
+<roundcube:include file="/includes/taskbar.html" />
+<roundcube:include file="/includes/header.html" />
+<roundcube:include file="/includes/settingstabs.html" />
+
+<div id="userprefs-box">
+<div id="userprefs-title"><roundcube:label name="changepassword" /></div>
+
+<div style="padding:15px">
+<roundcube:object name="changepassform">
+
+<p><br /><roundcube:button command="change-password" type="input" class="button" label="save" /></p>
+</div>
+</div>
+
+<roundcube:include file="/includes/settingscripts.html" />
+
+</body>
+</html>
