Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a85e2c8

Browse files
committed
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.
1 parent fb73bb1 commit a85e2c8

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

Lib/imaplib.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
'SUBSCRIBE': ('AUTH', 'SELECTED'),
5959
'UID': ('SELECTED',),
6060
'UNSUBSCRIBE': ('AUTH', 'SELECTED'),
61+
'NAMESPACE': ('AUTH', 'SELECTED'),
6162
}
6263

6364
# Patterns to match server responses
@@ -571,6 +572,12 @@ def xatom(self, name, *args):
571572
raise self.error('unknown extension command: %s' % name)
572573
return apply(self._simple_command, (name,) + args)
573574

575+
def namespace(self):
576+
""" Returns IMAP namespaces ala rfc2342
577+
"""
578+
name = 'NAMESPACE'
579+
typ, dat = self._simple_command(name)
580+
return self._untagged_response(typ, dat, name)
574581

575582

576583
# Private methods

0 commit comments

Comments
 (0)