This script is not IMAP specific (supports POP also)