SquirrelMail

Install And Configure Squirrelmail In Linux

Squirrelmail is a standards-based webmail package which allows the users to access their mails through web browser instead of any mail clients. It includes built-in pure PHP support for the IMAP and SMTP protocols and all pages render in pure HTML 4.0 (with no JavaScript required) for maximum compatibility across browsers. It comes with a large number of plugins which you can add to your squirrelmail installation according to the required features.

In this article, I imagine you have a Linux server with Apache/PHP web server support, exim mail server (SMTP) and an IMAP server (UW IMAP in our case).

Requirements for squirrelmail.

• A web server with PHP is installed. PHP needs to be at least 4.1.0. PHP 4, PHP 5 and PHP 6 are all supported.

• Access to an IMAP server which supports IMAP 4 rev 1.

• PHP gettext extension for better performance.

• The PHP mbstring extension is required for translations that uses multibytes or character sets but ISO-8859-1. Without the PHP mbstring extension the interface will remain usable, but some internationalization features and fixes won't be enabled.

• The PHP XML extension is required if the DIGEST-MD5 authentication is used.

• SquirrelMail is shipped with some Perl scripts. One of the most useful is config/conf.pl, which will help you configure your squirrelmail installation.

First two are the mandatory requirements for squirrelmail. Following PHP settings are recommended for Squirrelmail.

• register_globals off - This is a dangerous setting when enabled, and is not generally needed for most recent PHP applications.

• magic_quotes_{runtime, gpc, sybase} off - Squirrelmail may work with any of these turned on, but if you experience stray backslashes in your mail or other strange behaviour, it may be advisable to turn them off.

• file_uploads on - This is needed if your users want to attach files to their emails.

• safe_mode on or off - Turning safe mode on in squirrelmail's case is not much more secure than having it off. When it is enabled, incompatibilities with some functionality may arise.

Installation of squirrelmail.

Now, we can go through the installation of squirrelmail.

1. Download the squirrelmail package.

You can get the latest squirrelmail package from http://www.squirrelmail.org/. The latest stable version when I am writing this article is 1.4.22.

2. Unpack the squirrelmail package.

cd /usr/src

tar –jxvf squirrelmail-1.4.22.tar.bz2

mkdir /usr/local/squirrelmail

mv /usr/src/squirrelmail-1.4.22 /usr/local/squirrelmail/www

3. Change the ownership of squirrelmail directory.

You need to change the group ownership of the directory to the user/group of Apache web server. You can find it from Apache configuration file ‘httpd.conf’ (check for ‘User’ and ‘Group’ directives).

chown –R root.apache /usr/local/squirrelmail

4. Create the data and attachment directories.

You need to create data and attachment folders for squirrelmail. The ‘data’ directory is default location for squirrelmail users' preference files.

cd /usr/local/Squirrelmail

mkdir data attachments

chgrp apache data attachments

chmod 0730 data attachments

5. Configure squirrelmail.

The configuration perl script is available under the directory ‘config’. So, you need to cd to ‘config’ directory and execute,

./conf.pl

This configuration utility provides menu based configuration options:

SquirrelMail Configuration : Read: config_default.php (1.4.0)

---------------------------------------------------------

Main Menu --

1. Organization Preferences

2. Server Settings

3. Folder Defaults

4. General Options

5. Themes

6. Address Books

7. Message of the Day (MOTD)

8. Plugins

9. Database

10. Languages

D. Set pre-defined settings for specific IMAP servers

C Turn color on

S Save data

Q Quit

Command >>

Select the "D" option and then configure squirrelmail with the "uw" preset. Following are some configuration settings that you may need to edit while configuring squirrelmail.

Option 1 (organization Preferences): Give your organization name and site link

Option 2 (Server Settings):

Domain : Mention you domain name

Sendmail or SMTP : SMTP

Server software : UW

Option 4 (General Settings):

Data Directory : /usr/local/squirrelmail/data

Attachment Directory : /usr/local/squirrelmail/attachments

Make any other changes as you see fit, select "S" to save and then "Q" to quit.

6. Configure squirrelmail In Apache.

Now, you need to modify the Apache configuration file, httpd.conf to make squirrelmail available through web browser. Add the following to httpd.conf:

Alias /squirrelmail /usr/local/squirrelmail/www

Options None

AllowOverride None

DirectoryIndex index.php

Order Allow,Deny

Allow from All

7. Restart Apache.

Now, you need to restart Apache for the changes to take effect.

/usr/local/apache/bin/apachectl restart

Now, you will be able to access "http://domain.com/squirrelmail".