Kaydet (Commit) a85e2c85 authored tarafından Guido van Rossum's avatar Guido van Rossum

SF patch #433619, by Michel Pelletier:

Summary: NAMESPACE support in imaplib.py

Initial Comment:
Support for the IMAP NAMESPACE extension defined in rfc
2342.  This is almost a necessity for working with
modern IMAP servers.
üst fb73bb12
......@@ -58,6 +58,7 @@ Commands = {
'SUBSCRIBE': ('AUTH', 'SELECTED'),
'UID': ('SELECTED',),
'UNSUBSCRIBE': ('AUTH', 'SELECTED'),
'NAMESPACE': ('AUTH', 'SELECTED'),
}
# Patterns to match server responses
......@@ -571,6 +572,12 @@ class IMAP4:
raise self.error('unknown extension command: %s' % name)
return apply(self._simple_command, (name,) + args)
def namespace(self):
""" Returns IMAP namespaces ala rfc2342
"""
name = 'NAMESPACE'
typ, dat = self._simple_command(name)
return self._untagged_response(typ, dat, name)
# Private methods
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment