Index: Lib/imaplib.py =================================================================== --- Lib/imaplib.py (revision 83699) +++ Lib/imaplib.py (working copy) @@ -146,7 +146,7 @@ class abort(error): pass # Service errors - close and retry class readonly(abort): pass # Mailbox status changed to READ-ONLY - mustquote = re.compile(r"[^\w!#$%&'*+,.:;<=>?^`|~-]") + mustquote = re.compile(r'[()\s%*"]|"{"|"\\"|"\]"') def __init__(self, host = '', port = IMAP4_PORT): self.debug = Debug