Setting up IMP Webmail
Updated: 06/05/2005
General Information
When I first set up my mail server, I was faced with a dilemma -- which webmail program should I use? I started out with SquirrelMail, but I soon installed vpopmail and needed a webmail client that could support virtual users. So, my next stop was NuralStorm, but it lacked some features I wanted. I had always heard about Horde's webmail client, but I was always afraid of it because of it's complexity. This guide aims to ease your mind about IMP and help you install it and get it running from a base system and an updated ports tree.Requirements
Installation
Web server
In order for a webmail system to actually be useful, we need to install Apache and MySQL. MySQL is used to store user preferences within Horde. If you want SSL support, just follow the Apache+SSL Guide for the Apache and MySQL installation.|
# # # # |
cd /usr/ports/www/apache13 make install distclean cd /usr/ports/databases/mysql40-server make install distclean |
Horde
Now we are going to install the Horde framework and all of its dependencies. This will install Horde, some pear stuff, and php4 with the necessary extensions. You can always add more extensions easily by installing /usr/ports/lang/php4-extensions.|
# # |
cd /usr/ports/www/horde make install distclean |
IMP
It is finally time to install the Internet Messaging Program. This will install IMP (webmail) and Turba (addressbook).|
# # |
cd /usr/ports/mail/imp make install distclean |
Configuration
Web server
Now that PHP is installed, we need to edit the apache config file (httpd.conf) to support PHP by adding the following lines after all the "LoadModule" lines.|
# nano -w /usr/local/etc/apache/httpd.conf AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps |
ServerName flag to your domain.tld in order for apache to actually work properly. You will also want to either create a virtualhost for your webmail or change the DocumentRoot as follows:|
ServerName domain.tld .. DocumentRoot "/usr/local/www/horde" .. <Directory "/usr/local/www/horde"> |
|
# # |
/usr/local/sbin/apachectl start /usr/local/etc/rc.d/mysql-server.sh start |
MySQL
By default, MySQL's root user comes with a blank password. This is not safe to keep so we need to set a password for the root user. You will want to login to MySQL, then set the password, and finally exit like this:|
# mysql -u root -p Enter password: <Just hit enter> Welcome to the MySQL monitor. Commands end with ; or g. Your MySQL connection id is 3 to server version: 4.0.20 Type 'help;' or 'h' for help. Type 'c' to clear the buffer. mysql> SET PASSWORD FOR root = PASSWORD('secret'); Query OK, 0 rows affected (0.04 sec) mysql> quit Bye |
|
# cd /usr/local/www/horde/scripts/db # nano -w mysql_create.sql REPLACE INTO user (host, user, password) VALUES ( 'localhost', 'horde', -- IMPORTANT: Change this password! PASSWORD('horde') ); |
| # | mysql -u root -p < mysql_create.sql |
Horde
Horde installs itself in/usr/local/www/horde/ and all additional programs get installed recursively. Such as, IMP gets installed in /usr/local/www/horde/imp/ and so on.| # | cd /usr/local/www/horde/config |
horde.php as it contains the connection information. For example, you edit your MySQL connection information here and how you want your users to authenticate when logging it - whether imap, ftp, smb, etc. Feel free to look at the other files and tune them if you would like. I cannot go into great depth of each file and setting, especially since the config files are well documented.IMP
| # | cd /usr/local/www/horde/config |
servers.php. You need to go through conf.php to configure how you want your mail handled. For instance, you can append a trailer to every outbound e-mail. You can also restrict users to login to one server and protocol, or you can leave it open for them to select. You can choose to have Horde log in the MySQL database, or log in /var/log/horde.log. By editing motd.php, you can put up your own message on the login screen.http://domain.tld/ and you should be faced with a login screen. If you are unable to log in, check your config files to make sure they are connecting to the right server. You can also view the Horde System Capabilities Test page at http://domain.tld/horde/imp/test.php and try to log in. It should either be a success or display the error.Author: Jon LaBass
jon at bsdguides dot org