SquirrelMail 1.4.0 and “unknown response from server”

After restoring a maildir based mailbox from a backup, the user in question experienced some odd errors from SquirrelMail. When opening the inbox, the error “unknown response from server” was displayed by SquirrelMail.

I moved all files from the inbox to a temporary directory and started moving the back a few at a time, to isolate which emails that caused the problem. After about an hour of investigation, I noticed that there were a few duplicates with the same size and almost the same name. The only thing that differed was the Maildir “flags” after the comma.

The reason was probably that the user was viewing his mailbox while the backup was being restored, causing some files to be renamed and thus creating duplicates. The IMAP server (Courier in this case) was apparently confused by multiple files with the same timestamp but with different flags, and dropped the connection to SquirrelMail.

To isolate the duplicates, I used ls -1 and cut:
/bin/ls -1|cut -d "," -f 1|uniq -c|sort -n

Then I removed the duplicates, which were the files with file count > 2 in the list produced by ls.

Leave a Reply