MCPcopy Index your code
hub / github.com/RustPython/RustPython / apop

Method apop

Lib/poplib.py:329–347  ·  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

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

Callers 1

test_apop_normalMethod · 0.80

Calls 6

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

Tested by 1

test_apop_normalMethod · 0.64