Problems with automatic SpamAssassin rule update (sa-update)

After updateing my Gentoo box after a long time with no updates, everything was running fine until the next morning, when my SpamAsassin rule update cronjob was executed. This job essentially executes sa-update && /etc/init.d/spamd reload .

The message was something like this:

http: GET http://spamassassin.apache.org/updates/MIRRORED.BY request failed: 501 Attempt to reload LWP/Protocol/http.pm aborted.
Compilation failed in require: 501 Attempt to reload LWP/Protocol/http.pm aborted. Compilation failed in require
error: no mirror data available for channel updates.spamassassin.org 
channel: MIRRORED.BY contents were missing, channel failed

At first glance this looks like a problem with the given URL, but wget was able to download the file just fine. So I took a closer look at the message and noticed, that the problem came from http.pm, a Perl module.

Perl was probably updated during during my last emerge world, so I expected a broken package. I took a list at the installed perl packages (eix -I perl  is very helpful) and reemerged the one I thought was interesting (dev-perl/libwww-perl). But that did not help as well.

I then stumbled across the tool perl-cleaner, that can be used to rebuild packages for old versions of perl, that are broken. After calling perl-cleaner modules sa-update was running fine again.

Courier-imap not working because of broken symlinks in /etc/ssl/certs

Yesterday I updated a gentoo box and after that no more SSL and TLS connections with courier-imap were possible.

The log had some entries of the type
imapd-ssl: couriertls: /etc/ssl/certs/e1213163.0: No such file or directory

The file mentioned linked to
21 Apr 15 14:47 e1213163.0 -> signet_rootca_pem.pem

The CA cert of signet was removed for some reason, but the symlink wasn't. This is a hard error for courier for whatever reason. It stopped working without a good error message.

To fix this just run
find /etc/ssl/certs -type l ! -xtype f ! -xtype d -ok rm -f {} \;

This will remove all dead symlinks in /etc/ssl/certs