Documents
Howtos — Webmail
This document describes the procedure on how to install and configure a webmail system that will run on top of Horde framework.Tools used are: httpd-2.2.6, php-5.2.4, horde-3.2.1, dimp-h3-1.0, imp-h3-4.2, turba-h3-2.1.1, kronolith-h3-2.2, mnemo-h3-2.2, passwd-h3-3.0.1, and gollem-h3-1.0.3
Prepare Apache httpd
- Get an rpm version of Apache httpd at http://download.fedora.redhat.com/pub/fedora/linux
-
Install Apache httpd and its dependencies by executing this command:
# rpm -Uvh httpd-x.x.x.rpm -
Edit /etc/httpd/conf/httpd.conf, and add these entries:
Listen 80
User apache
Group apache
ServerAdmin howard@mu.edu.ph
-
Permamently include Apache httpd during system boot-up sequence by executing these:
# /sbin/chkconfig --add httpd
# /sbin/chkconfig --level 12345 httpd off
# /sbin/chkconfig --level 3 httpd on
Prepare PHP
- Get an rpm version of PHP at http://download.fedora.redhat.com/pub/fedora/linux
-
Install PHP and its dependencies by executing this command:
# rpm -Uvh php-x.x.x.rpm php-pgsql-x.x.x.rpm -
Edit /etc/php.ini, and add these entries:
memory_limit 64M
post_max_size 28M
file_uploads = On
upload_tmp_dir = /var/tmp
upload_max_filesize = 25M
allow_url_include = On
Prepare PHP-Pear and some required modules
-
Install PHP-Pear using this command:
# yum install php-pear -
Install PHP-Pear modules:
# pear install Mail
# pear install Mail_Mime
# pear install Log
# pear install DB
# pear install Net_Socket
# pear install Date
# pear install Auth_SASL
# pear install HTTP_Request
# pear install File
# pear install Net_SMTP
# pear install Services_Weather
# pear install Cache
# pear install -a channel://pear.php.net/XML_Serializer-0.18.0
Prepare Horde
- Get an tgz version of Horde at http://www.horde.org/download/app/?app=horde
-
Extract Horde at /var/www/html by executing this command:
$ tar xvzf horde-x.x.x.tgz
$ mv horde-x.x.x horde
- Read and follow instructions provided in /var/www/html/horde/docs/INSTALL
Prepare IMP, Turba, Kronolith, Mnemo, Gollem, and Passwd
- Get an tgz version of IMP at http://www.horde.org/download/app/?app=imp, Turba at http://www.horde.org/download/app/?app=turba, Kronolith at http://www.horde.org/download/app/?app=kronolith, Mnemo at http://www.horde.org/download/app/?app=mnemo, Gollem http://www.horde.org/download/app/?app=gollem, and Passwd http://www.horde.org/download/app/?app=passwd
-
Extract them all at /var/www/html/horde by executing these commands:
$ tar xvzf imp-x.x.x.tgz
$ mv imp-x.x.x imp
$ tar xvzf turba-x.x.x.tgz
$ mv turba-x.x.x imp
$ tar xvzf kronolith-x.x.x.tgz
$ mv kronolith-x.x.x imp
$ tar xvzf mnemo-x.x.x.tgz
$ mv mnemo-x.x.x imp
$ tar xvzf gollem-x.x.x.tgz
$ mv gollem-x.x.x imp
$ tar xvzf passwd-x.x.x.tgz
$ mv passwd-x.x.x imp
- Read and follow instructions provided in /var/www/html/horde/_modules_/docs/INSTALL.
Configure Horde
-
Let Horde users authenticate to IMP by adding this entry in horde/config/conf.php:
$conf['auth']['params']['app'] = 'imp';
$conf['auth']['driver'] = 'application';
-
Let Horde suffix usernames with @mu.edu.ph instead of @mail.mu.edu.ph, by adding these
codes at horde/imp/config/hooks.php file:
if (!function_exists('_imp_hook_vinfo')) {
function _imp_hook_vinfo($type = 'username')
{
$vdomain = getenv('HTTP_HOST');
if( $vdomain == "mail.mu.edu.ph" ) {
$vdomain = "mu.edu.ph";
}
$vdomain = String::lower($vdomain);
if ($type == 'username') {
return $_SESSION['imp']['user'] . '@' . $vdomain;
} elseif ($type == 'vdomain') {
return $vdomain;
} else {
return PEAR::raiseError('invalid type: ' . $type);
}
}
} -
Let Horde display custom welcome message at the left side of the screen. How? Add these codes at line 2 of horde/templates/portal/sidebar.inc:
[?php
// added by: Howard R. Bagcat After adding above codes, comment out line 15 to line 30.
// added on: 2008.07.23
$userID = Auth::getAuth();
$userName = substr($userID,0,strpos($userID,'@'));
echo "[br /]\n";
echo "[font face=Georgia,\"Trebuchet MS\" size="2"]\n";
echo " [b]Welcome, " .$userName. "![/b][br /]\n";
echo "[/font]\n";
echo "[font face=Arial size=\"-2\"]\n";
echo " (" .$userID. ")[br /]\n";
echo "[/font]\n";
?]
Configure IMP
-
Set IMP to send email via localhost's port 10025 to go thru Altermime setup, by adding these lines at horde/config/conf.php file:
$conf['mailer']['params']['host'] = 'localhost';
$conf['mailer']['params']['port'] = 10025;
$conf['mailer']['params']['auth'] = '0';
$conf['mailer']['type'] = 'smtp';
and at horde/imp/config/servers.php file:
'smtphost' => 'localhost',
'smtpport' => 10025,
-
Don't display .spamassassin folder in Horde's side bar menu and in IMP's folder menu. How? Edit /horde/imp/lib/IMAP/Tree.php,
and modify _getList() function at line 352:
if ($box->name && !isset($unique[$box->name])) {
$unique[$box->name] = $box;
}
with:
if ($box->name && !isset($unique[$box->name]) && $box->name != "INBOX.spamassassin") {
$unique[$box->name] = $box;
}
Configure Passwd
- Don't let Passwd detect old password. How? Open /horde/passwd/main.php and comment out lines: 52 to 58 and lines 75 to 78. And in /horde/passwd/templates/main/main.inc and comment out lines: 6 to 9 and lines 31 to 32.
-
Modify /horde/password/lib/Driver/sql.php not to include old password. Open the file and comment out these lines in changePassword() function:
//$res = $this->_lookup($username, $old_password);
//if (is_a($res, 'PEAR_Error')) {
// return $res;
//}
-
Modify /horde/password/config/backends.php and add these lines:
'query_lookup' => 'SELECT password FROM mailbox WHERE username = %u',
'query_modify' => 'UPDATE mailbox SET password = %p, crypt = \'\' WHERE username = %u'
Configure Gollem
This configuration assumes that Gollem is installed away from where FTP server is located. In this case, Gollem is at sinai.mu.edu.ph and FTP is at zion.mu.edu.ph (where www is hosted). The purpose is to make user's file viewable at http://www.mu.edu.ph/~user/.At zion, an account should be created to serve for Gollem. User directory should be owned by 'gollem' and it should be associated with the group 'apache'. 'mod_userdir' should be enabled and /etc/httpd/conf/httpd.conf should be configured to point to /var/www/html/uw/
-
Let Gollem do auto-login in an FTP server. How? Open /horde/gollem/config/backends.php and add these lines:
$backends['ftp'] = array(
'name' => 'My Page',
'driver' => 'ftp',
'preferred' => '',
'hordeauth' => true,
'params' => array(
'hostspec' => 'zion.mu.edu.ph',
'port' => 21,
'pasv' => false,
'username' => 'gollem',
'password' => 'gollem'
),
'loginparams' => array(),
'root' => '/'.substr(Auth::getAuth(),0,strpos(Auth::getAuth(),'@')) ,
'home' => './',
'clipboard' => true,
'attributes' => array('type', 'name', 'download', 'modified', 'size')
); -
Let the user know that directory is web-viewable. How? Edit /horde/gollem/manager.php and add these lines at line 262, before
$template->set... instructions:
$strUser = substr(Auth::getAuth(),0,strpos(Auth::getAuth(),'@'));
$template->set('webpageurl','This directory is viewable at this URL: http://www.mu.edu.ph/~' .$strUser. '/[br /]');
Open up /horde/gollem/templates/manager/manager.html and these lines at line 100:
[div class="notice"]
[tag:webpageurl /]
[/div]
[br /]
Just replace `[' with `<', and `]' with `>'.