MCPcopy Index your code
hub / github.com/python/cpython / apop

Method apop

Lib/poplib.py:331–349  ·  view source on GitHub ↗

Authorisation - only possible if server has supplied a timestamp in initial greeting. Args: user - mailbox user; password - mailbox password. NB: mailbox is locked by server from here to 'quit()'

(self, user, password)

Source from the content-addressed store, hash-verified

329 timestamp = re.compile(br'\+OK.[^<]*(<.*>)')
330
331 def apop(self, user, password):
332 """Authorisation
333
334 - only possible if server has supplied a timestamp in initial greeting.
335
336 Args:
337 user - mailbox user;
338 password - mailbox password.
339
340 NB: mailbox is locked by server from here to 'quit()'
341 """
342 secret = bytes(password, self.encoding)
343 m = self.timestamp.match(self.welcome)
344 if not m:
345 raise error_proto('-ERR APOP not supported by server')
346 import hashlib
347 digest = m.group(1)+secret
348 digest = hashlib.md5(digest).hexdigest()
349 return self._shortcmd('APOP %s %s' % (user, digest))
350
351
352 def top(self, which, howmuch):

Callers 1

test_apop_normalMethod · 0.80

Calls 5

_shortcmdMethod · 0.95
hexdigestMethod · 0.80
error_protoClass · 0.70
matchMethod · 0.45
groupMethod · 0.45

Tested by 1

test_apop_normalMethod · 0.64