SquirrelMail needs a webserver with PHP support. Check
PHP install manual for
information about supported web servers and install procedures.
Some Linux and Unix distributions provide precompiled web server and php packages.
We recommend the following PHP settings:
register_globals off - a dangerous setting, not needed. We do
not release security advisories for issues only exploitable with this
setting on. Note that you can easily enable it only for some legacy
site that may need it and turn it off globally.
magic_quotes_{runtime,gpc,sybase} off - SquirrelMail may work
with any of these 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 - needed if your users want to attach files to
their mails.
safe_mode on or off - safe_mode on is only a tiny bint more
secure, in the SquirrelMail case. There may be some incompatibilities
with some functionality (see
Safe mode).
Install IMAP server
It depends on used email system. Email server needs IMAP service that knows
used email system layout. If you use Unix with standard sendmail server, you
might have to install UW IMAP, Dovecot or other IMAP server, that can use email
stored in /var/spool/mail/ directory. If you use Windows, you might have to
enable IMAP service that is bundled with your email server. If your email server
does not support IMAP, you might have to find some other email server product.
Unpack SquirrelMail package
Unpack the SquirrelMail package in a web-accessible location.
Prepare data and attachment directories
Select a data-dir and attachment dir, outside the webtree (e.g. in /var).
The data-dir (for user prefs) should be owned by the user the webserver
runs as (e.g. www-data). The attachment dir (for uploading files as
attachments) should be file mode 0730 and in the same group as the
webserver.
If you use PHP with safe mode enabled, check chapter about safe mode.
Configure SquirrelMail
Run config/conf.pl from the command line. Use the D option to load
predefined options for specific IMAP servers, and edit at least the
Server Settings and General Options (datadir).
Check your SquirrelMail configuration
Browse to http://example.com/yourwebmaillocation/src/configtest.php
to test your configuration for common errors.
Log into SquirrelMail
Browse to http://example.com/yourwebmaillocation/ to log in.
This chapter covers installation of SquirrelMail on generic Unix or Linux
system. It does not cover installation of operating system or tools required to
install web server or PHP.
Any version numbers used in examples are specific to the time when this
documentation is written. If current version numbers differ, make sure that you
are not using old, obsolete or vulnerable software.
Guide uses UW IMAP server as example. This IMAP server can be used in generic
email setup when incoming mail is stored in /var/spool/mail
directory. If you are planning to use webmail with big number of users or with
bigger mailboxes, consider using different IMAP server and redesign entire email
system.
# cd /usr/local/src
# tar -xzvf /usr/local/src/downloads/httpd-2.0.54.tar.gz
# cd httpd-2.0.54
# ./configure --prefix=/usr/local/apache --enable-module=so
# make
# make install
Unpack and install php
# cd /usr/local/src
# tar --bzip2 -xvf /usr/local/src/downloads/php-4.3.11.tar.bz2
# cd php-4.3.11
# ./configure --prefix=/usr/local/php \
> --with-apxs2=/usr/local/apache/bin/apxs
# make
# make install
If you configure PHP compilation with --disable-all option, you must add
--enable-session and --with-pcre-regex options.
# cd /usr/local/src
# tar -xzvf /usr/local/src/downloads/imap.tar.Z
Compile UW IMAP
cd /usr/local/src/imap-<someversion>
make port-name EXTRADRIVERS='' SSLTYPE=unix
Replace port-name with name that matches your system. Check Makefile
for possible values. If you haven't installed OpenSSL libraries and headers, use
SSLTYPE=none instead of SSLTYPE=unix.
# mkdir /usr/local/squirrelmail
# cd /usr/local/squirrelmail
# mkdir data temp
# chgrp nogroup data temp
# chmod 0730 data temp
Unpack SquirrelMail
# cd /usr/local/squirrelmail
# tar --bzip2 -xvf /usr/local/src/downloads/squirrelmail-1.4.5.tar.bz2
# mv squirrelmail-1.4.5 www
Configure SquirrelMail
Start SquirrelMail configuration utility. Configure SquirrelMail with UW
preset. Set data and attachment directories.
Configure access to SquirrelMail in Apache
Modify httpd.conf
Alias /squirrelmail /usr/local/squirrelmail/www
<Directory /usr/local/squirrelmail/www>
Options Indexes
AllowOverride none
DirectoryIndex index.php
Order allow,deny
allow from all
</Directory>
Log into SquirrelMail
After you add alias to SquirrelMail in apache configuration and restart apache,
you should be able to access SquirrelMail by going to
http://your-server/squirrelmail.
If your operating system distribution provides prepackaged SquirrelMail, it
might be a good idea to use that. The drawback is that you probably don't have
the latest and greatest version. But on the plus side: the whole installation
step is managed for you, it integrates better with the rest of your system
and you're provided with security updates automatically.
SquirrelMail provides RPM packages. There are two packaging flavors. Standard
package that can be used on RedHat 8.x or later. 7.x.noarch.rpm package is
designed for RedHat 7.x systems. Main difference between packages - standard
package contains standard Apache configuration file with /webmail/ alias in
/etc/httpd/conf.d and different package dependencies. There are other
SquirrelMail packages created by RedHat, Fedora, SuSE and other RPM
distributions.
Debian packages can be downloaded from
the Debian website or you can
install them with your favorite Debian package manager. For example: apt-get
install squirrelmail. If you use Debian stable and SquirrelMail package is
a little bit outdated, you might be able to install newer SquirrelMail package
from testing or unstable. This is not guaranteed to work though.
FreeBSD includes two different SquirrelMail packages in their ports collection.