You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A mailbox (folder) need not be for a recipient and need not be the private part of an RFC2822 address.
Passing a value of "000 Bookings" to select() results in validation issues when the tokens are parsed as arguments and there are too many.
It would be a nice-to-have to accept spaces in the name.
Workaround is for a rule to be applied by a desktop email client such as Evolution to move it from the INBOX upon discovery according to filter criteria.
Select a mailbox. Returned data is the count of messages in mailbox (EXISTS response). The default mailbox is 'INBOX'. If the readonly flag is set, modifications to the mailbox are not allowed.
Enhancements only go into future releases. Please make sure that the current main branch does not have the feature you are requesting.
In general I believe select(mailbox) expects the argument to use the IMAP protocol astring syntax. Perhaps adding an encode_astring function would help?
Activity
mckenzm commentedon Jan 1, 2022
A mailbox (folder) need not be for a recipient and need not be the private part of an RFC2822 address.
Passing a value of "000 Bookings" to select() results in validation issues when the tokens are parsed as arguments and there are too many.
It would be a nice-to-have to accept spaces in the name.
Workaround is for a rule to be applied by a desktop email client such as Evolution to move it from the INBOX upon discovery according to filter criteria.
terryjreedy commentedon Jan 7, 2022
I presume you mean the mailbox parameter of imaplib.IMAP.select().
https://docs.python.org/3/library/imaplib.html#imaplib.IMAP4.select
Enhancements only go into future releases. Please make sure that the current main branch does not have the feature you are requesting.
Neither our doc nor https://datatracker.ietf.org/doc/html/rfc2060.html contain '2822', so you might be requesting something not supported.
There is no active maintainer for this module, so response from someone familiar with imaplib may take awhile.
vadmium commentedon Apr 20, 2024
In general I believe select(mailbox) expects the argument to use the IMAP protocol astring syntax. Perhaps adding an encode_astring function would help?
serhiy-storchaka commentedon Jul 5, 2026
Mailbox names containing spaces are now quoted automatically since GH-152703. Closing as a duplicate of gh-40038.