Making mail module more imap compliant

I have been trying to use sitebricks-mail with my yahoo server and  regex matching has been a problem. Have changed it to be more IMAP RFC compliant without changing GMAIL related checks (Can be removed if needed).

Changes are
1. IMAP AUTH checks for only OK 
2. When listing messages - getting UID as part of default instead of extras since I believe UID is mandatory for IMAP related messages.