Small change to IMAP.py -- fail more gracefully on mangled messages

I had to patch IMAP.py this way to get it to work consistently with my IMAP server. Previously, it would die completely. Now, it includes debug info and keeps chugging.