ELS Howto: SquirrelMail Web Mail


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 CD-ROM's /extra directory. This is required to run the SquirrelMail configuration utility.


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 stable 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.20.tar.gz

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

ln -s squirrelmail-1.4.20 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. Change the server's domain address to match your network settings.
  3. Switch to using the sendmail binary directly instead of SMTP. (This is not strictly neccessary, but can make troubleshooting easier if you run into problems.)
  4. Change the IMAP server type to University of Washington (uw).
  5. Remove the INBOX prefix from default folder names.
  6. Set the data directory to /var/opt/squirrelmail/data/ and the attachment directory to /var/opt/squirrelmail/attach/.
  7. Save your configuration file and exit the config program.

Example

The following example shows how you might configure your SquirrelMail installation.

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

Main Menu
Command >> 2

Server Settings
Command >> 1
[example.com]: localnet.lan

Server Settings
Command >> 3
Your choice [1/2] [2]: 1

Server Settings
Command >> a

IMAP Settings
Command >> 8
[other]:uw

IMAP Settings
Command >> r

Main Menu
Command >> 3

Folder Defaults
Command >> 3
[INBOX.Trash]: Trash

Folder Defaults
Command >> 4
[INBOX.Sent]: Sent

Folder Defaults
Command >> 5
[INBOX.Trash]: Drafts

Folder Defaults
Command >> r

Main Menu
Command >> 4

General Options
Command >> 1
[/var/local/squirrelmail/data/]: /var/opt/squirrelmail/data/

General Options
Command >> 2
[/var/local/squirrelmail/attach/]: /var/opt/squirrelmail/attach/

General Options
Command >> r

Main Menu
Command >> s

Main Menu
Command >> q

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.


Additional Information

There are many plugins available to customize your installation of SquirrelMail. The official ones can be downloaded from http://squirrelmail.org/plugins.php. Message Flags & Icons is a particularly nice one that adds some simple graphics to the otherwise text-only interface.