March 10, 2003

BZZT! You LOSE!

So SquirrelMail isn’t real editable. SqWebMail has nice HTML template files with simple placeholders for values. (OK, that’s an overstatement. There is some weird shit that goes on in SqWebMail templates. Still, they can be loaded in to FrontPage.) (Let me go on to emphasize that I do not use FrontPage but many foolish people do.) Editability may quickly become very important. OTOH, it might not, and SquirrelMail was way easy. I’ve decided to complicate my life instead and install IMP.

First thing I noticed about IMP? It requires the Horde Application Framework. Fuck me.

So I grab the Horde Framework. Install instructions start out by telling me that, without a database, my “user preferences” will not be maintained between sessions. Yay! A database, just what I wanted to install. apt-get install mysql-server php-mysql. Also requires IMAP support in PHP; apt-get install php-imap.

Horde actually has a lot of requirements. There’s Gettext and XML support, which I hope were built in by Red Hat. There’s Mcrypt support, which is supposedly maybe optional. Then there’s PEAR modules. PEAR, as near as I can tell, is PHP’s answer to CPAN. Apparently it has a cute command line utility called, unsurprisingly, pear. The instructions tell me I need the Log, Mail_Mime, and Net_Socket (optional) modules. I can install any of these modules like pear install <module name>. Riiight, so pear install Log yields:

'DB' PEAR package is not installed

OK, no problem. pear install DB goes swimmingly as near as I can tell. So we try pear install Log again and get:

Relation 'has' with requirement '' is not supported
Dependencies failed

Kick ASS. That is a fucking awesome error message. Thankfully I found someone that says to disable dependency checking. OK, great, pear install -n Log and we feel successful. Net_Socket installs easily. There is some chattering about how this method requires a static PHP or something, blah blah blah. RH8 users can ignore this I think; I believe it’s talking about how the php binary isn’t normally built with a dynamic Apache module or something.

service mysqld start, mysqladmin -u root password my-new-password for MySQL. I hope that’s enough to make it happy, and me too. Untar the Horde tarball into our (new) root directory. (See previous SquirrelMail tree for the root directory; I moved my SquirrelMail root over to a backup directory for now.) I mv horde-VERSION horde, then cd horde/scripts/db and run mysql -u root -p . Surprisingly, ran without error and mysql -u horde -p horde (password horde) works afterward too. Will wonders never cease.

Pop in to horde/config and run for file in *.dist; do cp $file `basename $file .dist`; done as per the instructions. Edited config.php and skipped down to the “Preference System Settings” section. Set it for SQL use, uncommented the MySQL example and filled in the password. I ignored most of the helper application paths that I supposedly needed to change in mime_drivers.php; most of them looked correct or like something I didn’t care about. (Right now, at least. I’m more interested in seeing how this thing functions.)

Now we’re ready for Horde action. Hitting http://my.server/horde/test.php yields a few things:

  • Doesn’t see IMAP or MySQL support, or Mail_Mime PEAR package. service httpd restart fixes this.

  • It says my version of PEAR isn’t recent enough. Bollocks to that.

Everything else is OK. So Horde: installed. Now IMP. IMP had better be fucking good.

Read IMP docs. Looks like I have all the dependencies. Edit the Horde registry.php with both of the changes mentioned (status change to active and uncommenting the authentication lines). Do the same for loop as above except this time in the imp/config directory. Now editing config.php. I enable Aspell because I’m bored. Skipped the rest of the file, as it was more boring. In servers.php I delete every server entry except for _prompt and cyrus. I modified cyrus to fit my Courier setup, which basically mean changing the key (from $servers['cyrus'] to $servers['courier']), name, server, maildomain, and realm.

Time to test. Going to http://my.server/imp/ yields an error in imp/lib/base.php. Apparently IMP expects to be installed under the Horde directory? What? OK, fine, we’ll move it and clean it up with mod_rewrite later or something. Now http://my.server/horde/imp/ plays nice and I get a login screen. For whatever reason, despite what I set in the realm key for the entry I made in imp/config/servers.php isn’t getting appended like I thought it would. Fine, no big deal, it ends up logging me in. Disable Privoxy since… PHP is sending compressed for no apparent reason, would be my guess. Voila, you have mail n’shit.

IMP looks good. It has this big ole’ templates directory which contains a bunch of HTML fragments with the occasional PHP escape. I think the people that’ll be editing this HTML can handle that. They could with JSP, at least, though it’s been a while. No contact management; presumably need that other Horde component for that.

I’ll probably toss SquirrelMail and IMP by the boss tomorrow and see which he prefers. For now, I think I’ll try and sleep.