diff options
author | Guido van Rossum <guido@python.org> | 2001-06-17 13:31:25 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2001-06-17 13:31:25 (GMT) |
commit | a85e2c8557096df62dc568ccb6cc28fd8db72093 (patch) | |
tree | b417f47a788fdbf8d5f161f587c36a85d7f9a85a /Lib | |
parent | fb73bb129b2ccbd9644709ac8eeac1d5e7f0a32d (diff) | |
download | cpython-a85e2c8557096df62dc568ccb6cc28fd8db72093.zip cpython-a85e2c8557096df62dc568ccb6cc28fd8db72093.tar.gz cpython-a85e2c8557096df62dc568ccb6cc28fd8db72093.tar.bz2 |
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.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/imaplib.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/imaplib.py b/Lib/imaplib.py index 2a0eeb6..4706eea 100644 --- a/Lib/imaplib.py +++ b/Lib/imaplib.py @@ -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 |