in reply to IMAP modules and MS Exchange

I'd recommend testing your script on the Solaris side first, if you haven't already :). Update: What I mean is to test the script on a Solaris mail account first. I'm not sure this was clear after re-reading my post.

The only part I'm not so sure about is where you use:

my @folders = @{$server->folders($FOLDER_NAME)};
Since you've defined $FOLDER_NAME to be 'inbox' and there aren't usually any subfolders of inbox (I'm not too familiar with MS Exchange formats, so I could be wrong on this). This alone doesn't explain the messages you're getting though. That's why I'd recommend trying the program out one the Unix side first and then MS Exchange once the kinks have been smoothed out.