Skip to content

imaplib support for quoting arguments accidentally removed #92835

Description

@lampmerchant

Bug report

imaplib does not quote command arguments, which leads to problems e.g. if a user specifies a mailbox with a name that contains a space.

>>> imap = imaplib.IMAP4_SSL('server', 993)
>>> imap.login('user', 'password')
>>> # Note: mailbox named "TPS Reports 2009-2010" does exist on server
>>> imap.append(b'TPS Reports 2009-2010', None, None, b'From: nobody\r\nTo: nobody\r\nSubject: nothing\r\n\r\n')
('NO', [b"[TRYCREATE] Mailbox doesn't exist: TPS (0.001 + 0.000 secs)."])

It appears that this functionality was removed by accident. A call in _command to a function _checkquote was commented out in fb5faf0 and then the function and everything connected to it was removed in f241afa.

Your environment

  • CPython versions tested on: 3.10.4 (has issue), 2.7.18.4 (does not have issue)
  • Operating system and architecture: Void Linux, ppc64el
  • IMAP server tested with: dovecot 2.3.18

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions