MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / apop

Method apop

tools/python-3.11.9-amd64/Lib/poplib.py:318–336  ·  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

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

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected