How to install a webmail
Introduction
This is a short document to show you how to install a webmail on eBox.
Note that you have to do this manually until we have a proper ebox-webmail module ready.
Steps
Log into the machine console or ssh.
Execute the following commands:
# echo 'deb http://ftp.rediris.es/debian/ sarge main' >> /etc/apt/sources.list # apt-get update # apt-get install squirrelmail
The above commands will install squirrelmail which is the webmail package we will be using.
If the command apt-get update gets stuck, check if your firewall allows connections from eBox to http servers.
# ln -s /etc/squirrelmail/apache.conf /etc/apache2/conf.d/squirrelmail.conf
Edit /etc/squirrelmail/apache.conf and change the the lines which contain the entry VirtualHost?. Note we have removed the comments and changed 1.2.3.4 for 0.0.0.0 to listen on all the IPs, and the server name to webmail.mydomain.com. Both might be changed to adapt them to your configuration.
Alias /squirrelmail /usr/share/squirrelmail
<Directory /usr/share/squirrelmail>
php_flag register_globals off
Options Indexes FollowSymLinks
<IfModule mod_dir.c>
DirectoryIndex index.php
</IfModule>
# access to configtest is limited by default to prevent information leak
<Files configtest.php>
order deny,allow
deny from all
allow from 127.0.0.1
</Files>
</Directory>
# users will prefer a simple URL like http://webmail.example.com
<VirtualHost 0.0.0.0>
DocumentRoot /usr/share/squirrelmail
ServerName webmail.mydomain.com
</VirtualHost>
# redirect to https when available (thanks omen@descolada.dartmouth.edu)
#
# Note: There are multiple ways to do this, and which one is suitable for
# your site's configuration depends. Consult the apache documentation if
# you're unsure, as this example might not work everywhere.
#
#<IfModule mod_rewrite.c>
# <IfModule mod_ssl.c>
# <Location /squirrelmail>
# RewriteEngine on
# RewriteCond %{HTTPS} !^on$ [NC]
# RewriteRule . https://%{HTTP_HOST}%{REQUEST_URI} [L]
# </Location>
# </IfModule>
#</IfModule>
Now you have to edit /etc/apache2/ports.conf and modify to have the following:
Listen 0.0.0.0:80
Enable mod-php:
$ a2enmod php4
Restart apache2 by executing:
# /etc/init.d/apache2 restart
The last steps are about configuring eBox properly and that involves the mail server and the firewall.
You will need to install ebox-mail and enable IMAP.
On the firewall side you will have to add a rule to allow your clients to connect to apache2. To do so: add an HTTP service in services: TCP, destination->single port->80.
Add a firewall rule in Filtering rules from internal networks to eBox to allow connections to apache2. Save changes.
Go to http://your_ebox_ip and you should see the squirrelmail login page.
Note that you can set up a proper domain like webmail.myorganisation.com, allow external access and things like that.
Do not forget to remove the line deb http://ftp.rediris.es/debian/ sarge main from /etc/apt/sources.list
