SquirrelMail - Web Based Email
 

It actually all began after reading the "Linux Magazine" issue for January 2003. It had a whole slew of good articles, but the one that was my driving force for this project was the article on Squirrel Mail - page 14. Its actually a very small excerpt really (the project-of-the-month one-pager), not a complete how-to, but it was just the catalyst I needed.

So after seeing what could be done with this product, I took a look at what I needed to do to make it work in MY environment. I already run solaris 8 on intel for my email server. I had used POP3 for this for a very long time, but with the amount of computers I have now, and the amount of locations I need to view email from, POP was really limiting. I had put up with it and its problems for a LONG time, but this was it - finally a robust and free product - just what I needed.

My solaris8 for intel server is basically a 04/01 release of solaris8 for intel architecture. In the solaris media kit, there is a cd known as the companion cd. On this companion cd is a product called IMAP. Simply adding that product allowed the use of IMAP for email. I configured it with this single modification to /etc/inetd.conf :


imap    stream  tcp     nowait  root    /opt/sfw/sbin/imapd imapd 

I had done this a little while back, but finding the right IMAP clients was tougher than it sounded. When using outlook, I had to permanently remove my old account settings and that sort of bothered me. When using Mozilla from one host and Evolution from another, changes were made to the mailbox which screwed me up from one box or the other. I have a LARGE mix of Unix, Linux and Windows machines, so finding a consistent look and feel, and predictability was paramount. That is the main reason I stuck with Outlook for all these past 7 or so years.

So after reading this article my direction was now clear. To date, after having it all setup, I am more than happy with the results. My only remaining challenge is to convert my 1Gb+ currently stored pop mailboxes into IMAP format. I have my spare 9Gb drive installed and waiting, so its only a matter of time now.

So without further ado, here is the process I used to configure web mail in my environment :


First step is to go to www.squirrelmail.org and pick up the latest release. As of this writing I am using 1.2.10. I also downloaded a series of their plugins to extend the functionality - they are listed below and will be discussed later - I didnt know what they involved, only that I wanted them :

From there, you need to pick a directory where to do the install/compile work. I use a directory of /usr/local/Install as my parent for all downloaded and to-be-installed software, so this was no exception. I created a directory of /usr/local/Install/squirrelmail and extracted the file there. Since this was solaris8 and solaris8 comes with the zip/unzip tools, I downloaded the much smaller squirrelmail-1.2.10.zip file and unzipped that here.

At this point, I thought it would be a good idea to review the INSTALL and README type files, since the magazine article was really short and lacking in spots. Luckily the INSTALL file is very detailed and almost completely spells out what needs to be done. It basically explains that PHP, a web server (preferably apache) and possibly SSL should be installed. I anticipated a slight bit of difficulty with PHP so I went to www.sunfreeware.com under the solaris 8 for intel area, and I downloaded the latest apache. My thinking was that since I am running an older 1.3.12 version, the newer versions should have as much of the fixin's as possible, so that is exactly what I did. I tried to do SSL as well, but ran into a few blocks, so that will be completed at a later date.

To install apache, it was standard stuff - I copied all my old apache files somewhere safe, and de-installed version 1.3.12. Then I applied the new SMCapache version 1.3.27 . I had a slight bit of difficulty getting apache running for some odd reason. I think this version of apache is compiled with support for mysql which I didnt have, so I tried my old 1.3.12 httpd.conf file, and found success in that. So now its on to php.

In the INSTALL file for squirrel mail - which incidently is a great how-to manual for this whole excersize - it recommends getting PHP from the php main site, so I did. That needs to be extracted and compiled. So I made a new directory of /usr/local/Install/php and extracted the tgz file there. So after cd'ing to /usr/local/Install/php/php-4.2.3, I ran the configure statement as described in the Squirrel Mail doc, NOT the php doc. It says to run the configure as follows :


./configure --enable-track-vars --enable-force-cgi-redirect --with-gettext

Ok, so now its time to run the make and make install for the php install. I ran the configure as shown above, and then I ran the "make" command. The newly generated Makefile worked perfect first time and that is just fantastic. So then its time to "make install" - the instructions for squirrel mail dont neccessarily state that you should do this, but I did it by accident in all honesty. Such a long history of "make followed by make install" that its apparently very difficult not to do that. What it DOES say I had to do was to copy the newly generated php binary to the cgi-bin directory. In my case its in /usr/local/apache/cgi-bin .

I took the advice regarding the php.ini file and copied it into the /usr/local/lib area. I truly dont recall if I made any edits to this file, so I will post a copy here for review. Just look for my trademark comment area which is prefixed by the famous five comment signs - ";;;;;". Anywhere you see them, I made changes. I am pretty sure the only changes I made were for the session temp area. The cookies flag was already correct. (Note that I wasnt concerned at all with the file uploads or the other areas that are discussed.)

There were some edits I needed to make for the apache httpd.conf file because even though I thought it would come ready-to-run for php4 it didnt really do what I thought it should. Granted, I am basically a novice at this, so maybe there were other ways to achieve what I wanted. I just made some edits to httpd.conf, restarted apache, and walked away. So, here is my httpd.conf file for review as well. Same thing goes for the edits, only this time its five pound signs not five semicolons. By the way, feel free to use or ignore the other changes I made in this file .....

So luckily enough that all went well - as far as I know. Nothing choked yet, but I also have not yet tested the php binary. That is all yet to come ...

After reading thru the INSTALL document, I confess that half the information didnt truly make sense to me, but I can tell you that about a week after I have been playing with the preferences, address book, signature files, etc - its all understandable now after rereading it. Either way, following the steps in the document, this was performed next to ensure that the webserver would be able to perform the writes without difficulty - I had checked the ownership/permissions on the apache process and most of the tmp files generated by the web server to discover that it was nobody:nobody that ran my processes :

If this is going to be a large user system, please heed the warning about attachments left behind as discussed around line 150 in the INSTALL doc. I am paying close attention to it initially to see what happens. However, in all liklihood, I will create the cron job as recommened.

I had looked at the two different ways of configuring the perl config file, but settled in on the menu method (running /usr/local/Install/squirrelmail/squirrelmail-1.2.10/config/conf.pl script) for an unknown reason. Only after I did it that way did I realize that the default file would probably have been preferred because I love comments and that file is littered with them. The menu method deletes all comments. In samba, I stick with the commentable format and avoid all swat and other like tools. However, its kinda strange that after doing all that, I still needed to make some manual edits because the plugins wouldnt work.

Speaking of the plugins, I couldnt find any good documentation on how to use them, so I made a best guess effort that worked - for better or worse .... Basically I untarred/unzipped/extracted all the plugins that I downloaded into the /usr/local/Install/squirrelmail/squirrelmail-1.2.10/plugins directory. Then after reviewing the /usr/local/Install/squirrelmail/squirrelmail-1.2.10/config/config_default.php file, I found out how to properly configure them - at least I thought so - it did work, but not very reassuring where there is all this guessing going on. I am including that config.php file here as well since its had quite a few manual hacks by me to get it just where I wanted it. You can see I copied some of the comments over too, so that means no more conf.pl runs anymore. The main thing to mention here is that on solaris 8 - at least in my configuration where I used the companion cd's IMAP, its the UW version of IMAP - University of Washington (I discovered this by running the "pkginfo -l SFWimap" to find out).

Ok, so the last few steps to do for this to work are not documented, but I guess assumed. I had to create a link for my web server to know how to find these new php pages. I did the following :


ln -s /usr/local/Install/squirrelmail/squirrelmail-1.2.10 /usr/local/apache/htdocs/squirrelmail
ln -s /usr/local/Install/squirrelmail/squirrelmail-1.2.10 /usr/local/apache/htdocs/email

I made the initial link to the subdirectory named squirrelmail on my webserver, but since I realized I have to type this each time I login, I decided to shorten it up a bit, hence the second link. And since I hate the long directory name, I also made a link as follows for future support :


ln -s /usr/local/Install/squirrelmail/squirrelmail-1.2.10 /usr/local/squirrelmail

The last thing that "needs" to be done for this to all work was to correct the missing logo in the left frame of my folder view. Since one of my plugins is used to add graphics, I needed to make sure that they would work correctly. I used the GIMP to convert the sm_logo.png to sm_logo.jpg for now, but will eventually replace all sm_logo's with my own images of some nature - just be sure to save it in the /usr/local/apache/htdocs/email/images area (yes, I am using the short name now). To run the gimp on solaris8 just be sure that the companion cd is loaded, and run it from the /opt/sfw/bin area.

Well thats all there is to it. It seems long a long read, but I really believe it took less time to download and install everything than it did to write this up - all in all it was about 2 hours of effort if I factor out the time lost trying to configure ssl with apache.

Future updates will be for ssl with apache. Who knows when that will be though, as there are SO many other projects I need to get completed first.


I figured out a way to convert all of my existing outlook express email from its pop (locally stored) email messages to the unix/linux mbox format. It required some downloads from sourceforge - the product is known as ol2mbox and I used the two library packages shown on that page. I downloaed the libpst* and libdbx* stuff and compiled them. I copied the binaries to my bin directory and ran them against the manually copied outlook dbx files. It converts them fine. Then I copied them to my own folders in my home directory and viola !!! It worked great, so I now have access to ALL my email from anywhere.

In a nutshell, here is the jist of it all :

One note though - I had a few folders that had new email in them already, so I didnt want to lose that. To get around this problem, I created a new folder via squirrel mail called "conversions". I copied the dbx converted email to that "conversions" folder instead, and then used squirrel mail's regular interface to move the messages from one folder to another. Kind of a hack, but it worked for me.

If anyone really and truly needs information on how to do this, I can assist I guess, I just got tired of writing all this stuff down.....


One last note ... dont use outlook express directly against these IMAP folders or you will end up with a "corrupted" .mailboxlist file with extra entries that display incorrectly in squirrel mail. Whether the bug is with UW IMAP, Squirrel Mail, or Outlook - I am unsure, but I know that avoiding this mishap is best done by not using Outlook for this.


This page last updated on 12-30-2002