This post is going to contain some fairly obscure information. One for Google, really.
I moved the Logic Squad mail server to a new host, and everything went remarkably smoothly. The only weirdness was that Apple Mail would display, along with the other contents of my inbox, two messages entitled "message unavailable" from "System Administrator", one of them marked read, the other unread. I could delete them, but they would eventually come back. The problem was not Mail's, but the IMAP server's. It turns out that there's a file, courierimapuiddb in every Maildir that can get out of sync with the actual contents of a Maildir. The file can be safely deleted, and will be re-created by the IMAP server.
So, just for completeness, here are some keywords for Google: Apple Mail, IMAP, Courier-IMAP, FreeBSD, Maildir, "Message no longer available", courierimapuiddb.