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.
You must be logged in to the O'Reilly Network to post a talkback.
Showing messages 1 through 12 of 12.
-
login problems
2005-08-05 14:00:26 angierosewood [Reply | View]
MY LOGIN DETAILS WONT WORK TO ACCESS MY SQUIRREL EMAIL ACCOUNTS
CAN ANYBODY HELP
-
Squrrelmail vs Openwebmail
2003-09-25 15:50:52 anonymous2 [Reply | View]
Hello.
I want to know what is the best Web-based Mail: Open WebMail or Squirrelmail.
Why ?
What does it have more features ?
Thanks.
-
More on SquirrelMail
2002-11-01 15:51:19 rickc [Reply | View]
I noticed that the version of SquirrelMail used in this article was version 1.2.6. I'm happy to announce that stable version 1.2.9 was just released a couple days ago, along with development version 1.3.2.
More info on SquirrelMail:
* Just won PHPKitchen's Best Of award for Best PHP Email Client with 49.88% of 3340 votes
* Now included in Apple's OS X Server install image
* Now included on RedHat's install image
* Now included on Mandrake's install image
* Now included on Debian's install image
* Now included in BSD Ports
We're proud of our project, and of the great response it's been getting out there. Thanks for the excellent article, and keep watching http://squirrelmail.org for great new features!
-Rick Castello
"Head Nut" of the SquirrelMail Project
-
Corrections and Information
2002-11-01 15:18:57 jangliss [Reply | View]
Being one of the developers for the stable release version of SquirrelMail, it's certainly nice to see it getting some good recognition. However, there are some tiny corrections that should really be made to this article.
The first is mainly the requirements. In your article you stated that you need to be running sendmail, and imapd via inetd. This is incorrect in respect that SquirrelMail was designed to be as flexible as possible and will work with any IMAP server, and SMTP server. This means that you don't need sendmail, you could use postfix, or qmail if you wished. You can also use Courier-IMAP as an alternative for example. Because of this, it may not necessarily mean that your server needs to use inetd to run, and could run as a stand alone daemon.
Another small correction on the requirements. You don't necessarily have to be running apache. Apache is probably the prefered method, but PHP is available for IIS, PWS, and some other web servers as well.
The second is method of authentication. The articles says that SquirrelMail uses /etc/passwd. This is partially incorrect as it really depends on how the imap server authenticates. For example, the University of Washington's imapd (referenced as a requirement) uses /etc/passwd, while courier-imap can use a number of different methods from userdb to mysql databases, and even ldap or PAM.
As with authentication, where the article says it polls mail is also incorrect. That is totally dependant on where you tell your mail server to store it. Most mail servers allow modifications to where files are stored.
Now for a little information. :)
Some things that aren't mentioned about SquirrelMail are it's functionality. Apart from being a simple mail client you can use to send and receive mail, it has support for plugins. With plugins you can extend the features of SquirrelMail itself, for example POP3 collection, or SpamFiltering. There is even a nice little plugin for use with your spamcop account, allowing you to submit with a simple click of a link.
Don't be alarmed by the screenshot either. That isn't how SquirrelMail looks. SquirrelMail actually has the ability to allow the user to change colours for their own preferences. You can also alter the size of fonts, colours, and such.
pmccann asked how passwords are sent. Just like any web based form submission they are normally sent via plain text. This is fixable by installing your webserver with SSL support and allowing logins to SquirrelMail from the secured login page. There are plenty of documents on how to setup apache with mod_ssl flying about (even on the mod_ssl page too).
Currently developers are working on a method of support cram-md5 and digest-md5 authentication for IMAP servers so that we reduce the amount of plaintext data that is sent between points.
Further information about SquirrelMail can be seen at the website, http://www.squirrelmail.org, including some basic installation guides. There is also the squirrelmail irc channel on the openprojects network (now freenode) on irc.openprojects.net in the channel #squirrelmail.
Thanks to the author for the original article.
-
Check out IMP - much better
2002-10-25 23:13:36 dan.a [Reply | View]
If you're looking for webmail to deploy and haven't seen the IMP, you should. Its part of a bigger project called "horde":
http://www.horde.org
http://www.horde.org/imp/
and in my view one of the best webmails around.
Dan
-
Correction to requirements
2002-10-25 06:18:01 guppie [Reply | View]
Squirrelmail does not require sendmail or imapd,
it just requires an SMTP server and an IMAP
server. Due to historical security issues, we
are running qmail instead of squirrelmail. We
also chose Courier IMAP instead of imapd.
Squirrelmail works flawlessly with both.
Another thing not mentioned is that Squirrelmail
has support to run over secured IMAP and HTTP.
It's a bit trickier to configure, as you have to
know a bit about ports, but far from impossible.
All in all, I have been running squirrelmail for
over a year on several machines, and I am quite
happy with it.
-Josh
-
ZOE
2002-10-25 04:40:58 anonymous2 [Reply | View]
For your personal needs, you might be better of with ZOE. Here is a review by Jon Udell:
"Googling Your Email"
http://www.oreillynet.com/pub/a/network/2002/10/07/udell.html
-
Openwebmail
2002-10-25 00:45:38 anonymous2 [Reply | View]
IMHO another very good web based mail client is Openwebmail (www.openwebmail.org), its main feature for me is that does not require IMAP, it works nicley with POP3 and/or mailboxes.
Ale
-
Check that screenshot...
2002-10-24 21:34:03 bcantoni [Reply | View]
I'm not a prude or anything, but I think you should have a better screenshot for the sample mail interface. The sample "inbox" looks like it's full of spam, some of which is pretty raunchy.
-
Rate Squirrelmail...
2002-10-24 18:57:53 Steve Mallett |
[Reply | View]
Rate Squirrelmail here on OSDir.com Leave your squirrelmail tips 'n' tricks too.







Do you have a suggestion(s) for me; I am somewhat of a novice.
Many thanks,
John C. Swallow