ELS Howto: SquirrelMail


Synopsis

This document outlines the process for configuring an Elemental Linux Server (ELS) system for web-based email using SquirrelMail.


Prerequisites

These instructions assume that you have already configured a working email server and PHP-enabled web server. If you have not, please review the ELS Howto: Remote Mail and the ELS Howto: Apache PHP before beginning this document.

You will also need to install the perl package from the ELS 'Extra Applications' CD-ROM.


Installation

SquirrelMail is a PHP application, so there is nothing to be compiled. You simply unpack the latest version into your web server's root directory and create a couple of directories.

  1. Download the latest release of SquirrelMail from http://squirrelmail.org.
  2. Unpack the archive into httpd's document root directory.
  3. Create a symbolic link called mail that points to the squirrelmail directory you just unpacked.
  4. Create the directories /var/opt/squirrelmail/data and /var/opt/squirrelmail/attach.
  5. Set the group ownership on the directories you just created to the same group httpd runs as and set the permissions to 770.

Example

The following example shows how you might install SquirrelMail if your web server's document root is /home/httpd.

cd ~
wget http://prdownloads.sourceforge.net/squirrelmail/squirrelmail-1.4.22.tar.gz

cd /home/httpd
tar -zxf ~/squirrelmail-1.4.22.tar.gz

ln -s squirrelmail-1.4.22 mail

mkdir -p /var/opt/squirrelmail/data
mkdir -p /var/opt/squirrelmail/attach

chgrp daemon /var/opt/squirrelmail/data
chgrp daemon /var/opt/squirrelmail/attach
chmod 770 /var/opt/squirrelmail/data
chmod 770 /var/opt/squirrelmail/attach

Configuration

The following steps are for a very basic configuration. For more options, see the SquirrelMail documentation.

  1. Change directory to where ever you extracted SquirrelMail and run ./configure.
  2. Set the data directory to /var/opt/squirrelmail/data/ and the attachment directory to /var/opt/squirrelmail/attach/.
  3. Enable the administrator plug-in if you wish to use the web-based administration feature. (See the security warnings in the SquirrelMail documentation before doing this.)
  4. Save your configuration file and exit the config program.
  5. If you elected to use web-based administration, there are a few additional steps to take.
    1. Change the file ownership of config/config.php to a user you wish to designate as the SquirrelMail administrator.
    2. Change the group ownership of config/config.php to the same group that httpd runs as.
    3. Create a file config/admins and add the name of the administrative user to it.

Example

The following example shows how you could configure SquirrelMail and assign web-based administration privileges to the user "joe".

cd /home/httpd/squirrelmail-1.4.22
./configure

Main Menu
Command >> 4

General Options
Command >> 1
/var/opt/squirrelmail/data/

General Options
Command >> 2
/var/opt/squirrelmail/attach/

General Options
Command >> r

Main Menu
Command >> 8

Plugins
Command >> 1

Plugins
Command >> s

Plugins
Command >> q

chown joe config/config.php
chgrp daemon config/config.php
echo "joe" > config/admins

Testing

  1. Check the configuration by navigating to http://server-name/mail/src/configtest.php.
  2. Click the "Login now" link at the bottom of the configtest page or use the address http://server-name/mail/ to get to the login page.
  3. If you chose to use web-based administration, log in as the admin user and click Options, then Administration.

If you have follow all the steps above and things are not working out with the configuration test, try the following:

  1. Run netstat -tl to verify that daemons on the http (80), imap (143) and smtp (25) ports are listening.
  2. Check that PHP is installed properly. There is a good test script at http://www.htmlite.com/php003.php
  3. Verify that firewall rules allow unrestricted access for the localhost (127.0.0.1) on ports 25 and 143 and unrestricted access on port 80 for any hosts trying to access SquirrelMail.
  4. Test network connectivity to the server by pinging it from another machine.

For additional help, consult the SquirrelMail documentation.