in reply to Mail::IMAPClient Troubles

I wrote a script that uses Mail::IMAPClient a couple of months ago. I just compared mine to yours and it seems to do pretty much the same things.

One difference I notice is that I'm checking the return code of expunge the same way you do for delete. I don't remember whether I had a good reason for doing this, but it's worth trying.

Have you tried turning debugging on? I found that very useful when I had some trouble with a MS Exchange server that didn't behave properly for one of the imap commands.