2012年9月11日 星期二

Squirrelmail postfix admin change password

Postfixadmin Squirellmail Plugins To Change Postfix User Password


What is Postfixadmin Squirellmail Plugins ?

This plugin is used to help postfix user to be able to change their password, autovacation and forwarding via squirellmail webmail without need to asking admin to change their needs.

Prepare anything to start

1. Zend Framework Minimal. We can download it from this URL http://framework.zend.com/releases/ZendFramework-1.10.8/ZendFramework-1....

2. We need to recompile / install php to support XMLRPC

3. We need to install PHP MDB2 library using PEAR

4. Download and Install postfixadmin-squirellmail plugins, we can download it via SVN command below :
#svn co  http://squirrelmail-postfixadmin.palepurple.co.uk/svn

I Assume we already have apache, php, mysql and webmail install and running properly in the server

Download and Copy Zend Framework Library to PHP Include Path

Note :
My php Include Path is stored in /usr/local/lib/php

Login into the server as root
#cd /root
#wget http://framework.zend.com/releases/ZendFramework-1.10.8/ZendFramework-1....
#tar -zxvf ZendFramework-1.10.8-minimal.tar.gz
#cd /root/ZendFramework-1.10.8-minimal/library
#mv Zend /usr/local/lib/php/

Recompile PHP to support PHP XMLRPC Extensions

Previously i have php-5.2.14 in my root directory, so i can just recompile it using the sources

#cd /root
#cd php-5.2.14
#./configure '--enable-fpm' '--enable-fastcgi' '--with-mcrypt' '--with-zlib' '--enable-mbstring' '--disable-debug' '--enable-inline-optimization' '--enable-sockets' '--enable-zip' '--with-curl' '--with-mysql=/usr/local' '--with-xmlrpc'
#make
#make install

Install PHP MDB2 Library Using PEAR

#pear install MDB2#mysql

Download and Install Postfixadmin-squirellmail plugins

#cd /root
#svn co  http://squirrelmail-postfixadmin.palepurple.co.uk/svn
#cd svn/tags
#mv squirrelmail-postfixadmin-0.4.3 /home/users1/webmail/plugins/postfixadmin

Edit the plugins

#cd /home/users1/webmail/plugins/postfixadmin
#cp config.php.sample config.php
#pico config.php

$CONF['database_type'] = 'mysql'; /* or mysql or other db as supported by MBD2 */
$CONF['database_host'] = 'localhost';
$CONF['database_user'] = 'postfix';
$CONF['database_password'] = 'yourpostfixpassword';
$CONF['database_name'] = 'postfix';
$CONF['vacation_domain'] = 'autoreply.my.domain.com';
$AllowVacation = true;
$AllowChangePass = true;

Edit plugin function
sudo vim /usr/share/squirrelmail/plugins/postfixadmin/functions.inc.php

line 24: add 
ini_set('include_path',ini_get('include_path').':/usr/share/php:'); 

Configure Squirellmail Plugins

#cd /home/users1/webmail/config
#./conf.pl

Press 8 for plugins
You will see an Available Plugins there. Example if "postfixadmin" plugin is in number 2 then
Press 2 for postfixadmin
Press S for Save data
Press Q for Quit

Restart Your Webserver.

#/usr/local/apache/bin/apachectl stop
#/usr/local/apache/bin/apachectl start
Open your browser and try to access your webmail
Login into the webmail and click Options
You will see 3 new options there like : Auto Response, Forwarding and Change Password

Click Change Password
Input your old password
Input twice your new password.
Logout from squirellmail