SquirrelMail, a Web-Based Mail Server
by Glenn Graham10/24/2002
Client-based Mail Vs. Web-based Mail: A Case in Point
Historically, email has been the primary source of Internet communications. First there were text-based programs such as elm, pine, and mutt (for Unix). With the rise of Windows, email software such as Eudora, Netscape, and Outlook Express took the stage. All of these programs use the POP3 protocol to download messages from a remote server to the local drive.
As people (and laptops) become increasingly mobile, email solutions have become more demanding. Road warriors are tired of spending hours in hotel rooms configuring their email software.
Last year while traveling through Southern California, I stayed at a hotel that offered high-speed access. I connected my laptop to their network, attempted to send a message, and found my home (SMTP) settings wouldn't work. Next I tried changing my setting to the hotel's network, however it wouldn't accept outgoing connections. Luckily I had root access to my home system and was able to configure it to accept my SMTP request. What would an average user have done that, though?
Enter Webmail. It's simple, easy, and attractive to the average user. It doesn't require software (beyond a browser), configuration or headaches. Simply log in to the Web site and read your mail. This goes a long way to explain the popularity of advertising-supported services from major Internet companies.
The Application
I started my search for a Webmail solution at Freshmeat. After sifting through over 65 programs, I stumbled across SquirrelMail. It didn't have fancy screenshots, but to my surprise, had everything I needed. It's easy to install, runs right out of the box, and my clients love it. What else could I ask for?
SquirrelMail runs under Apache with PHP4 support installed. It requires
sendmail and imapd running via inetd. In
the event you need to run a database, you might consider compiling PHP with
MySQL support. Most commercial systems already have these features built in.
(If your Apache server hasn't already been built with PHP, see Darrell
Brogdon's article on the
subject, or read the PHP support documentation in the INSTALL file.)
SquirrelMail polls the mail queue, /var/mail via imapd and
parses the output via PHP to HTML using the Apache server. Authentication takes
place within the /etc/passwd file when the user logs in with a
matching username and password. The administrator must add an
entry for each user. (Note: It's not yet possible to add accounts through the
Web interface.)
Building and Installing Under FreeBSD 4.6.2-RELEASE (Latest version)
Before installing SquirrelMail, carefully read the documentation on their site. It outlines system and software requirements. Before installation, you must have the following components installed and operational:
Apache with PHP support (PHP4). Under FreeBSD, install
PHP4from the ports collection. Optionally, PHP4 may be downloaded from http://www.php.net/sendmailversion 8.9.1 or laterimapdrunning frominetd. Under FreeBSD installcyrus-imapdfrom the ports collection
After that, you're ready to install SquirrelMail.
First, download the installation tarball and untar it to
/usr/src/.Next, read the
INSTALLfile, noting the PHP compilation instructions. The installation doc is self-explanatory. If you're building PHP from source, though, you may wish to use either:./configure --enable-track-vars --enable-force-cgi-redirect --with-gettextor
./configure --with-apxs=/usr/local/sbin/apxs --with-mysqlNow, run the
./configurescript. Figure 1 below shows an example.
Figure 1: An example configuration screenRemember to save your changes.
Move the directory structure (
./squirrelmail/) to the DocumentRoot directory from which you wish to serve SquirrelMail. The FreeBSD default is/usr/local/www/data/.Create a directory to store your attachments.
mkdir /usr/local/www/data/squirrelmail/attachments/Change the mode of the
dataandattachmentsdirectories to 755.chmod 755 /usr/local/www/data/squirrelmail/data/ chmod 755 /usr/local/www/data/squirrelmail/attachments/Edit your
php.inifile to enable cookies, by settingsession.use_cookiesto1.Enable
imapdvia/etc/inetd.conf. Add or modify the appropriate line to read:imap4 stream tcp nowait root /usr/local/libexec/imapd imapd-
Set your
imapdsecurity to allow only connections from the localhost. This may be accomplished through tcpwrappers via/etc/hosts.allow, or by building a custom firewall rule. (Note: If you do not haveimapdrunning, SquirrelMail will not function. Instead, you'll see PHP code in your browser.)The appropriate entries in
/etc/hosts.alloware:# Imapd imapd : 127.0.0.1 : allow imapd : ALL : deny
Logging In and Testing for the First Time
Before logging in to test the system, remember to restart your Apache
server. To test your setup, visit the URL
http://YourServer.Com/squirrelmail/index.php. You should see a
login window resembling Figure 2.

Figure 2: The login window
To log in, simply enter a valid username and password for an existing email account on your system. As seen in Figure 3, the resulting page will show the contents of the default mail folder. You can click on the image for a larger view.

Figure 3: The mail folder view
Before using SquirrelMail, remember to click on the options menu and edit (at a minimum) personal information containing your email address, signature, and other preferences.
It's a Nice Package
SquirrelMail is robust and featureful. For example, it effectively blocks HTML images embedded in mail from being downloaded to your desktop without permission. This is a customizable feature available under the options menu. Any unauthorized images will be replaced with a security block.
SquirrelMail also performs well. My first installation used a 200 MHz box with only 64MB of RAM. Although fine for development and testing, it was hardly powerful enough to run the application to serve several users at once. Within a day I upgraded the server to a 500 MHz machine with 128 megabytes of RAM and an ultra fast SCSI drive. The system comfortably accommodates 75 to 100 simultaneous logins without any noticeable loss to performance. The processor utilization averages between 30 to 40 percent.
As users become more and more finicky about the level of service they receive from providers, ISPs are under increased pressure to provide the access their clients demand. If you operate an ISP and don't support Webmail, perhaps it is time to start. SquirrelMail is an excellent solution.
Resources:
Glenn Graham has been working with telecommunications since 1977.
Return to ONLamp.com.
-
retention of "In" messages
2005-09-22 07:00:17 Crans [View]
-
login problems
2005-08-05 14:00:26 angierosewood [View]
-
Squrrelmail vs Openwebmail
2003-09-25 15:50:52 anonymous2 [View]
-
More on SquirrelMail
2002-11-01 15:51:19 rickc [View]
-
Corrections and Information
2002-11-01 15:18:57 jangliss [View]
-
Check out IMP - much better
2002-10-25 23:13:36 dan.a [View]
-
Correction to requirements
2002-10-25 06:18:01 guppie [View]
-
Looking for help on Squirrelmail and IMAP
2003-11-19 07:42:49 anonymous2 [View]
-
Squirrelmail and Apache
2003-07-16 09:07:55 anonymous2 [View]
-
ZOE
2002-10-25 04:40:58 anonymous2 [View]
-
Openwebmail
2002-10-25 00:45:38 anonymous2 [View]
-
Check that screenshot...
2002-10-24 21:34:03 bcantoni [View]
-
Check that screenshot...
2003-06-04 12:34:28 anonymous2 [View]
-
Rate Squirrelmail...
2002-10-24 18:57:53 Steve Mallett |
[View]
-
Password sent as...?
2002-10-24 17:28:45 pmccann [View]