The problem is that there is no mailbox named [Gmail]/Inbox . You can get a list of all valid mailboxes by calling m.list() .
I discovered this using the Python interactive shell (since Python 2.6), where it shows the response from the IMAP server for each IMAP operation.
Note. When using the Python interactive shell, importing pprint and calling pprint.pprint(m.<method of m>(<params>)) probably be a good idea for some IMAP commands that send a lot of information.
source share