This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: imaplib.py "select" mailbox names containing spaces.
Type: enhancement Stage:
Components: Library (Lib) Versions: Python 3.11
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: mckenzm, terry.reedy
Priority: normal Keywords:

Created on 2022-01-01 13:08 by mckenzm, last changed 2022-04-11 14:59 by admin.

Messages (2)
msg409457 - (view) Author: Matthew H. McKenzie (mckenzm) * Date: 2022-01-01 13:08
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.
msg410000 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2022-01-07 18:50
I presume you mean the mailbox parameter of imaplib.IMAP.select().
https://docs.python.org/3/library/imaplib.html#imaplib.IMAP4.select

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

    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. 

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.
History
Date User Action Args
2022-04-11 14:59:54adminsetgithub: 90378
2022-01-07 18:50:27terry.reedysetnosy: + terry.reedy

messages: + msg410000
versions: + Python 3.11, - Python 3.6
2022-01-01 13:08:23mckenzmcreate