summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-06-17 13:31:25 +0000
committerGuido van Rossum <guido@python.org>2001-06-17 13:31:25 +0000
commitd60a31ba9420d272a2775721be7f77b0aab4edea (patch)
tree1a73659e5d26ac1e9f2466e0bdb8d692eba6ba50
parent8eb9bda1fb7d36b4e02ccd2197e4658109124208 (diff)
downloadcpython-d60a31ba9420d272a2775721be7f77b0aab4edea.tar.gz
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.
-rw-r--r--Lib/imaplib.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/imaplib.py b/Lib/imaplib.py
index 2a0eeb6ff4..4706eea02d 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