If you ask Squirrelmail to sort your mail file, it tries to get all the messages for sorting. (It would also be happy to have the server do the sorting, but imap4d seems not to support the SORT command.) It does it by giving the command "UID FETCH 1:*". However, this seems to fail unless there is a message with UID 1. My understanding of RFC3501 is that this should work. I think imap tries to translate the UID's into message numbers and fails if the UID is not there.
Test case: I start with an empty mail file and sends two messages to myself. When I read them with imap, they acquire X-UID headers saying that they are messages 1 and 2. I delete the first one, so that I have only one message and its UID is 2. Then the above command fails with "BAD UID FETCH Failed to parse message set". Ken