Installing SquirrelMail 1.4.5 in FreeBSD 5.4-Release
I’m in Baghdad now, where my only link to the ‘net is a high-latency satellite. Mozilla Thunderbird can’t hack the delays this introduces, and thus times out when attempting to fetch my IMAP mailbox on ender. Thus, rather than use one of the other shitty IMAP clients, I’ve decided to pull the trigger on SquirrelMail.
I have previously attempted to install RoundCube, but found it a bit too immature at this point, so I’ve decided to go with something tried and true: SquirrelMail.
Fortunately, the FreeBSD ports collection includes SM, and a pre-built package based on 1.4.5 is available. Unfortunately, the pre-built package uses Apache 1.3, while I run Apache 2 on bonzo. This leads to all sorts of fun:
bonzo# pkg_add ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-5-stable/All/squirrelmail-1.4.5_2.tbz
Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-5-stable/All/squirrelmail-1.4.5_2.tbz... Done.
Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-5-stable/All/apache-1.3.34_2.tbz... Done.
pkg_add: package 'apache-1.3.34_2' conflicts with apache-2.0.54_2
pkg_add: please use pkg_delete first to remove conflicting package(s) or -f to force installation
pkg_add: pkg_add of dependency 'apache-1.3.34_2' failed!
Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-5-stable/All/php4-4.4.1_3.tbz... Done.
pkg_add: package 'php4-4.4.1_3' conflicts with php5-5.0.4_2
pkg_add: please use pkg_delete first to remove conflicting package(s) or -f to force installation
pkg_add: pkg_add of dependency 'php4-4.4.1_3' failed!
Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-5-stable/All/mhash-0.9.2.tbz... Done.
Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-5-stable/All/php4-xml-4.4.1_3.tbz... Done.
pkg_add: could not find package apache-1.3.34_2 !
pkg_add: could not find package php4-4.4.1_3 !
pkg_add: pkg_add of dependency 'php4-xml-4.4.1_3' failed!
Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-5-stable/All/php4-session-4.4.1_3.tbz... Done.
pkg_add: could not find package apache-1.3.34_2 !
pkg_add: could not find package php4-4.4.1_3 !
pkg_add: pkg_add of dependency 'php4-session-4.4.1_3' failed!
Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-5-stable/All/php4-pcre-4.4.1_3.tbz... Done.
pkg_add: could not find package apache-1.3.34_2 !
pkg_add: could not find package php4-4.4.1_3 !
pkg_add: pkg_add of dependency 'php4-pcre-4.4.1_3' failed!
Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-5-stable/All/php4-openssl-4.4.1_3.tbz... Done.
pkg_add: could not find package apache-1.3.34_2 !
pkg_add: could not find package php4-4.4.1_3 !
pkg_add: pkg_add of dependency 'php4-openssl-4.4.1_3' failed!
Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-5-stable/All/php4-mhash-4.4.1_3.tbz... Done.
pkg_add: could not find package apache-1.3.34_2 !
pkg_add: could not find package php4-4.4.1_3 !
pkg_add: pkg_add of dependency 'php4-mhash-4.4.1_3' failed!
Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-5-stable/All/php4-mbstring-4.4.1_3.tbz... Done.
pkg_add: could not find package apache-1.3.34_2 !
pkg_add: could not find package php4-4.4.1_3 !
pkg_add: pkg_add of dependency 'php4-mbstring-4.4.1_3' failed!
Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-5-stable/All/php4-gettext-4.4.1_3.tbz... Done.
pkg_add: could not find package apache-1.3.34_2 !
pkg_add: could not find package php4-4.4.1_3 !
pkg_add: pkg_add of dependency 'php4-gettext-4.4.1_3' failed!
Outstanding. Well, I’m not going back to apache 1.3, and I don’t feel like building from the port, since bonzo‘s ports collection is outdated. However, I really don’t want to download the sources from SM and build on FBSD. So, I guess I have no choice but to update the ports tree:
cvsup -L 2 /root/ports-supfile
Took a while; updated.
Now doing:
make WITH_DATABASE=1
The WITH_DATABASE enables PEAR support to ensure SM can use MySQL.
That was uneventful. Next up,
make WITH_DATABASE=1 install
During the build PEAR was installed also, which yielded this:
To use PEAR you have to add the correct include path into
your ${LOCALBASE}/etc/php.ini configuration file, like:
include_path = ".:/usr/local/share/pear"
I’ll have to remember to do that…
Ugh, it’s installing the new PHP 5.1.2. This’ll take a while…
Actually wasn’t bad at all. Final output:
You now need to add an alias to apache's httpd.conf pointing to
/usr/local/www/squirrelmail in order to access SquirrelMail from
your web browser, or create a VirtualHost with DocumentRoot set
to that directory.
For SquirrelMail to work properly you will need to make sure the
following option is set in your php.ini file:
file_uploads = On
If you have problems with SquirrelMail saying "you must login" after
you just have, the following php.ini option may help:
session.auto_start = 1
In order to do your administrative configuration you need to
cd /usr/local/www/squirrelmail && ./configure
SquirrelMail will not work until this has been done.
So, first I’ll add an alias to /usr/local/etc/apache2/httpd.conf
This seemed to do the trick:
Alias /mail/ "/usr/local/www/squirrelmail/"
Ok, that ‘worked’, inasmuch as I got this response in my browser:
ERROR: Config file "config/config.php" not found. You need to configure SquirrelMail before you can use it.
And configure it I shall. As per the instructions above, a quick cd /usr/local/www/squirrelmail && ./configure should be just the thing.
The configuration utility has a numbered menu system circa 1980. I’ll just wander through the menus, specifying values for stuff as they make sense to me.
That was easy. I like the Blue Grey theme, with the Verdana 08 custom style sheet. Nice.
I can't build OpenBSD 3.8-STABLE on ender
Lately ender has taken to freezing hard every few days, requiring a reboot of the VM in which it resides. This sucks as ender is my mail server.
I hoped maybe the problem was some issue fixed in the latest -STABLE, so I updated to the latest -STABLE sources and rebuild the kernel and userland. Kernel built fine, but userland failed same as it did last time I tried:
/usr/src/gnu/usr.bin/binutils/gdb/infrun.c: In function `normal_stop':
/usr/src/gnu/usr.bin/binutils/gdb/infrun.c:3046: error: too many arguments to function `observer_notify_normal_stop'
Google doesn’t have anything to offer, nor do the OBSD mailing list archives. WTF is wrong and why am I the only one w/ the problem!?
Upgrading Ender to OpenBSD 3.8
I just upgraded ender to OpenBSD 3.8 using the same process I used in Upgrading Jane to OpenBSD 3.8. It was uneventful.
The next step, however, will be more complicated than it was on jane, because ender runs all my mail systems, including postfix, spamassassin, etc. I’ll need to update their ports packages accordingly.
First, I need to advance to -Release, again with the same steps I used to upgrade jane to 3.8-Release.
That went well; I was also able to build a -Stable kernel without difficultly. However, I can’t build userland; instead I get this:
/usr/src/gnu/usr.bin/binutils/gdb/infrun.c:3046: error: too many arguments to function `observer_notify_normal_stop'
Hmm. Surprisingly, Google yields nothing useful. It’s quite surprising that gdb should fail to compile; I wonder if the -Release branch is really broken, or if I’m missing something.
'rsync error: error in rsync protocol data stream (code 12)' using qdb.pl on OpenBSD
Recently, I recounted my experience installing and running my qdb.pl script on OpenBSD 3.7. Though the backup runs worked fine from the console, they failed strangely when run from crontab. I encountered the following error message from ender:
FINISHED --02:00:05--
Downloaded: 35,394 bytes in 1 files
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at /usr/ports/net/rsync/w-rsync-2.6.6/rsync-2.6.6/io.c(434)
Error preparing server jane for backup:
rsync command [/usr/local/bin/rsync --links --times -z --rsh="ssh -q -A" "/tmp/aE6jFxDCgD/qdb_run.pl" "ender_backup@jane:~/qdb_run.pl"] exited with error 3072
It’s failed during the step in the backup process where qdb.pl is uploading a Perl script to jane, which will clear out any previous temp files and determine the most recent snapshot, etc. This upload seems to be failing, with the meaningless error:
rsync error: error in rsync protocol data stream (code 12)
I’ve rumaged around the ‘net, and it appears this is due to a protocol version mismatch. Indeed, jane is running rsync version 2.6.3, protocol version 28, while ender and bonzo are at 2.6.6, protocol version 29. But, bonzo has been working fine for months, and ender works fine when I run the backup script from the shell.
I could upgrade to the rsync-2.6.6 version, but to do that I’d have to download and install the ports tree on jane, then advance the kernel, username, and ports tree to 3.7-STABLE, which is a huge multi-day pain in the ass.
I’m going to give it one more chance to run correctly; if it still doesn’t work I’ll break down and upgrade jane to OpenBSD 3.8, which includes rsync-2.6.6 in the RELEASE branch, plus I need to do a practice run before I upgrade ender.
Subversion On OBSD 3.7
OpenBSD 3.8 was just released. I want to upgrade Ender from 3.7 to 3.8, but first I want to back it up.
I have a simple backup script, qdb.pl, which I use for machine backups. However, I’m lazy and haven’t gotten around to putting it on ender. Right before a life-changing OBSD upgrade is a good time to do so.
It is at this point that the yak stampede begins. To install OBSD3.8, I have to back up. To back up, I have to get my qdb.pl script. To get qdb.pl, I need Subversion (actually I could use HTTP, but I’m trying to be thorough). So, I dutifully go to /usr/ports/devel/subversion and fire off a make; no dice, as the subversion port’s depenency chain ultimately extends to the X11 libraries.
If you’ve not worked with the *BSD ports system before, you won’t understand how that’s possible. I didn’t even bother to trace the dependency, since I noticed from peeking at the Makefile that there’s a flavor of the port called ‘no_bindings’, which isn’t explained but which I gather from context means to build the Subversion tools without building the Python/Perl/Ruby/etc bindings.
So, as is my custom, I did a:
export FLAVOR=no_bindings
followed by a
make
. An eternity later, svn was built. make install takes care of the rest. I now have the OBSD port of svn-1.1.3p0. This being OBSD, that’s probably two major revisions behind, but as one who lives the avant garde OBSD lifestyle, I’m prepared to deal with the hardship.