Fix bug causing random exceptions on messages that othertimes worked (courier-imap only?)