imaplib.IMAP4.select

IMAP4.select(mailbox='INBOX', readonly=False)[source]

Select a mailbox.

Flush all untagged responses.

(typ, [data]) = <instance>.select(mailbox=’INBOX’, readonly=False)

‘data’ is count of messages in mailbox (‘EXISTS’ response).

Mandated responses are (‘FLAGS’, ‘EXISTS’, ‘RECENT’, ‘UIDVALIDITY’), so other responses should be obtained via <instance>.response(‘FLAGS’) etc.