The IMAP error is pritty self explanitory, your IMAP server said the username or password were wrong.
Have you modified the RC files at all? I haven't seen RC make a headers already sent error in a long time. What version of RC are you running, from the line number i'm guessing its not 0.5.3