Installing a Webmail Agent on Your Machine

—Joel Rennich,

Updated 24 September 2002

10.2 OK!

SquirrelMail

Apple wisely chose to include SquirrelMail in Mac OS X Server 10.2, largely obviating the need to download and install the software. Configuration is dead simple, though there is one critical caveat.

To configure SquirrelMail for Mac OS X 10.2 Server, add the directive

Include /etc/http/httpd_squirrelmail.conf

very near the top of every VirtualHost to which you would like the WebMail agent to bind. The directions in httpd_squirrelmail.conf incorrectly omit the full path name. Then, configure the general package by running the conf.pl Perl script located at /etc/squirrelmail/config. Access the newly-available Web mail by appending “/WebMail” to your site’s root URL

One other caveat to note: Apple appears to have included version 1.2.0 of SquirrelMail with Mac OS X Server 10.2; the latest stable release, as of 24 September 2002, is 1.2.8. Given the SquirrelMail team’s fantastic coding, there is little reason to doubt that overlaying the distributed version with their latest 1.2.x code will result in a seamless upgrade.

While there are a lot of webmail systems that will allow you to view your mail from a website Squirrelmail is the easiest one that I have found so far. This can be used with any IMAP server, it doesn’t have to be one that you even administer. For ease of instruction though we will be putting this on the same server as the mail lives on.

Download Squirrelmail into a folder of your choice. It is a decent idea to put this in the “/Shared Items” folder if you don’t have someplace else you keep your websites. The tarball can either be downloaded over the web from www.squirrelmail.org or using curl.

curl -O http://prdownloads.sf.net/squirrelmail/squirrelmail-1.2.4.tar.gz

now unpack it if StuffIt didn’t already do that for you.

gnutar -xzvf squirrelmail-1.2.4.tar.gz

Now to keep it simple rename the Squirrelmail folder to WebMail

mv squirrelmail-1.2.4 WebMail

Now we need to run the configure script

cd WebMail/config
sudo perl conf.pl

You now have nice menu to configure all of the settings that you need. Poke around a bit here but these are the things you really need to set.

From the main menu go to “1. Organization Preferences” Put your organization’s name in option 1 and put a path to a logo in option 2. Then return to the main menu.

Now from the main go to “2. Server Settings” Put your domain in option 1 and change option 9 to “other."

That takes care of most of the configuration. Save the changes and quit.

Next you need to make sure that the web server can access everything and make the changes necessary to the configuration files.

cd ..

This will put you into the WebMail directory

sudo chown www *

Squirrelmail uses PHP, ah HTML scripting language, to work. Apache comes with this installed but not enabled on Mac OS X Server. So go to /etc/httpd/httpd.conf and uncomment these two lines by removing the hash sign in front of the line.

#LoadModule php4_module /usr/libexec/httpd/libphp4.so
#AddModule mod_php4.c

You need to do this as root. So either make the changes with vi or emacs from the command line or change the permissions and do it with TextEdit.

cd /etc/httpd/
sudo chmod 777 httpd.conf
sudo mv httpd.conf ~/Documents
open -e ~/Documents/httpd.conf

Now make the changes in TextEdit and save the document then back to the command line.

sudo mv ~/Documents/httpd.conf /etc/httpd/httpd.conf
chmod 644 /etc/httpd/httpd.conf

Now go to Server Admin and create a website that points to /Shared Items/WebMail, or wherever you have put Squirrelmail and set the default document name to index.php.


ADDENDUM: Apple ships Mac OS X Server with PHP 4, but the version included (as late as Mac OS X Server 10.1.4) is several revisions behind the current release. If you have updated your PHP distribution using Marc Liyange’s excellent product, you will find that SquirrelMail no longer works as advertized.

In order to get SquirrelMail to work with the newer version of PHP, you will need to have a php.ini file in /usr/local/lib. Unfortunately, no one seems to supply just that file, so we’ve made the version in use here at Destiny NewMedia (where AFP548.com is hosted) available. Please note, we make NO WARRANTIES that this file will work forever (it was designed for PHP 4.2.0), or that the settings will be correct for all PHP setups. However, it should work with SquirrelMail up to version 1.2.6.

— David O’Donnell