This is where I am at, but I'm not sure where to go from here:
import imaplib
import email
conn = imaplib.IMAP4()
conn.login("username", "password")
status, messages = conn.select('INBOX')
if status != "OK":
print ("Incorrect mail box")
exit()
print (messages)