Last year I posted some details on running the SquirrelMail (SM) webmail system under Mac OS X. These have been read by a great many — which is very gratifying — and I have had some very positive feedback via email: many thanks!
The instructions I gave were for SquirrelMail 1.2.7 running under OS X 10.1.x. Both SM and OS X have upgraded since then. This has introduced a major new issue (SSL) but has otherwise simplified installation. The notes below are intended to update my previous instructions, and are good for both Jaguar (10.2) and Panther (10.3). As before, they relate primarily to using the UW IMAP server, but using a different server (e.g. Cyrus) should not be a problem: just make sure the SM configuration knows which server you are using.
Get IMAP working first
You must install a working IMAP server and test it before running SquirrelMail: this will save headaches later! I recommend you ensure that the setup works with mail.app or Entourage clients (but see comments on SSL below).
Once you have a working IMAP server, then installing SM is now pretty straightfoward.
Secure authentication
The current version of UW imapd follows the current IESG security requirements and by default builds with plaintext password authentication (port 143) disabled, and SSL enabled (port 993).
OS X 10.2.x (Jaguar) and 10.3.x (Panther) have SSL already installed, and there is no problem building and deploying imapd with SSL. There are excellent instructions here, including how to create the necessary security certificate. You will of course have to configure your IMAP client to use SSL on port 993. There are options for this in mail.app and Entourage. Unfortunately, however, SquirrelMail doesn't 'do' SSL and some strategy or other is necessary to get them working together.
The advice from the SM site is to use stunnel or an SSH tunnel to listen for material on 143 and forward it using SSL to 993. I have not tried this, and reportedly it has a significant performance overhead.
The approach I have taken is simply to build imapd with SSL but allow plain password authenticated sessions on port 143:
# make osx SSLTYPE=unix
This gives you the best of both worlds, provided you can firewall off external access to port 143 on the machine(s) running SM and imapd.
Apache and PHP
OS X comes with a functional Apache server, but this needs to be updated to run PHP. Marc Linyage's excellent package does this simply and perfectly. It also installs a php.ini that works fine for SM.
Apache and SSL
The benefits of having your IMAP server work via SSL are rather wasted if your web session does not, so it is advisable to set up a secure server. There are good instructions for doing so here.
Install SquirrelMail
The directions on the SM site seem to work fine. I will not attempt to repeat them here as your webserver directory structure will probably differ from mine.
Outgoing mail
SM will need to access to an SMTP server in order to send mail to others: this can be a local or remote server. The SM config script allows you to choose between calling sendmail (running on the same machine) directly, or SMTP in which case you need to supply the address of the SMTP server. this of course may be running on the same machine (it might even be sendmail) in which case you can specify localhost.
Prior to Panther, OS X came wih Sendmail installed (but usually not correctly configured). With Panther, Apple has switched to Postfix. (I don't use either, and prefer Exim, for reasons outlined elsewhere). Whichever you use, you should test it properly with a regular mail client before trying to send mail from SM. Whether or not it is running on the same machine as SM, I recommend configuring SM to use SMTP, not sendmail directly.
Note the you may have to configure your SMTP server explicitly to accept (relay) mail from the SM machine, even if it is localhost.
If you have MySQL installed and want to use it as a backend to SM for address book and user preferences storage, there are instructions here.
Good luck!
[Updated 17/04/2004; 20/05/2004]