Squirrelmail is a very popular very fast webmail client with Imap, Pop and Smtp support. While very popular it’s also very what’s the word…. ugly yes that’s it, but considering the lightweight and speed that’s perfectly acceptable. Squirrelmail also has a huge load of ready to run plugin’s making your life easier. And it’s super easy to install as well.
Now this is one of the few applications I don’t install from ports but from source. Reason it’s not worth it. Squirrelmail works right out the tar ball with only a few configurations that needs to be changed. So basically all you need to do is unpack the thing, put it somewhere nice and then link to it from where ever you want to access it and you’re done.
As of this writing the newest version of squirrelmail is 1.4.22 It’s been that for ages, wonder if there ever will be a newer version. Never mind should a never version surface just replace “1.4.22” with the new version throughout this guide.
Before we start cd to a temporary directory /tmp springs to mind. And then download the source.
cd /tmp fetch https://sourceforge.net/projects/squirrelmail/files/latest/download/squirrelmail-webmail-1.4.22.tar.gz tar -zxvf squirrelmail-1.4.22.tar.gz
Next move squirrelmail to a propper location and rename it to something slightly easier to work with.
mv squirrelmail-webmail-1.4.22 /usr/local/www/squirrel
Now we need to set the right permissions on the “data” directory inside squirrelmail. It has to be the name of the webserver i.e. either www, apache or nobody whatever your webserver is running as.
chown -R www:www /usr/local/www/squirrel/data
Next we need to modify the configuration files that came with squirrelmail. This is a perl script that will ask you some questions.
In the menu we need to change a few things. The path to sendmail below assumes you run Qmail if not change the path accordingly.
In the menu press 2 “Server Settings” and replace example.com with your IP number.
In the menu press 3 “Sendmail Or SMTP” and then press 1 for Sendmail
In the menu press B “/usr/sbin/sendmail” then press 4 and change it to /var/qmail/bin/sendmail
Press “S” to save and then “Q” to quit squirrelmail is now configured and ready to run.
All you need to do now is a symlink to the “squirrel” directory from where you want to access it.
Let’s say you have a web page in /usr/local/www/foo/public_html and you want to be able to access squirrelmail from www.foo.com/webmail then all you have to do is create a link inside the foo directory that points to squirrel like shown below. This will give you access to squirrelmail from www.foo.com/webmail. For all others sites just repeat the process.
cd /usr/local/www/foo/public_html ln -s /usr/local/www/squirrel webmail
Possible Face Palm Alert. I once had a surprise with Squirrelmail. I blamed Squirrelmail, but it was really my fault. The error was this.
"System error: Aspell program execution failed" (`aspell -a --lang=en_US --encoding=utf-8 -H --rem-sgml-check=alt < /path/aspell_data_wiAFJG 2>&1`)
Turned out that I had never used the spell checker before, and when I tried it for the first time Squirrel was complaining because had forgotten to install it. If you run into this issue install aspell and set the correct path in the plugin called html_mail. If you need a guide on this well….. ahh well here it is then.
First we need to install the spell checker for Squirrelmail.
cd /usr/ports/textproc/aspell && make install clean BATCH=yes
Unfortunately this doesn’t quite solve the error as it seems to persist. And that’s because we need to set the absolute path for Aspell in the configuration for html_mail. So let’s do that. You need to edit this file /Path To Squirrelmail/plugins/html_mail/config.php I hope it’s obvious that you need to replace “Path To Squirrelmail” with the real path. In this file find the following line.
$html_mail_aspell_path = 'aspell';
And replace “aspell” with the absolute path for aspell. On my installation aspell resides here /usr/local/bin if so change the line to.
$html_mail_aspell_path = '/usr/local/bin/aspell';
And we are done here.