I needed functionality to open a mailbox to a certain folder so I extended your functionality. Also included unit tests. There was one weird bug with the .select call where I had to do some trickery with quotes to get it to work. I believe its a bug in the imaplib library. The functionality without specifying folder is maintained since .select() defaults to 'INBOX' in imaplib to begin with.
I needed functionality to open a mailbox to a certain folder so I extended your functionality. Also included unit tests. There was one weird bug with the .select call where I had to do some trickery with quotes to get it to work. I believe its a bug in the imaplib library. The functionality without specifying folder is maintained since .select() defaults to 'INBOX' in imaplib to begin with.