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

Skip to content

Commit be14e69

Browse files
committed
New revision -- sometimes it's AUTH-LOGIN, sometimes AUTH=LOGIN!
1 parent 5c7e8cd commit be14e69

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

Lib/imaplib.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,8 @@ def login(self, user, password):
275275
276276
(typ, [data]) = <instance>.list(user, password)
277277
"""
278-
if not 'AUTH-LOGIN' in self.capabilities:
278+
if not 'AUTH=LOGIN' in self.capabilities \
279+
and not 'AUTH-LOGIN' in self.capabilities:
279280
raise self.error("server doesn't allow LOGIN authorisation")
280281
typ, dat = self._simple_command('LOGIN', user, password)
281282
if typ != 'OK':
@@ -391,6 +392,8 @@ def status(self, mailbox, names):
391392
(typ, [data]) = <instance>.status(mailbox, names)
392393
"""
393394
name = 'STATUS'
395+
if self.PROTOCOL_VERSION == 'IMAP4':
396+
raise self.error('%s unimplemented in IMAP4 (obtain IMAP4rev1 server, or re-code)' % name)
394397
typ, dat = self._simple_command(name, mailbox, names)
395398
return self._untagged_response(typ, name)
396399

@@ -783,7 +786,7 @@ def run(cmd, args):
783786
return dat
784787

785788
Debug = 4
786-
M = IMAP4("newcnri")
789+
M = IMAP4()
787790
print 'PROTOCOL_VERSION = %s' % M.PROTOCOL_VERSION
788791

789792
for cmd,args in test_seq1:

0 commit comments

Comments
 (0)