summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMoshe Zadka <moshez@math.huji.ac.il>2001-01-19 19:56:27 (GMT)
committerMoshe Zadka <moshez@math.huji.ac.il>2001-01-19 19:56:27 (GMT)
commitccc2e3d05d2c7475f84718b066ab0306ea97e168 (patch)
treee32664392995de037388518505d4f9fb83c57a95
parent2e9b3967403c87592d6356ea486858f452767507 (diff)
downloadcpython-ccc2e3d05d2c7475f84718b066ab0306ea97e168.zip
cpython-ccc2e3d05d2c7475f84718b066ab0306ea97e168.tar.gz
cpython-ccc2e3d05d2c7475f84718b066ab0306ea97e168.tar.bz2
OK, checking in patch 103329.
Please check it against your nearest pop server -- mine doesn't support APOP (I checked I'm getting the same error message, though)
-rw-r--r--Lib/poplib.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/poplib.py b/Lib/poplib.py
index 2f55f74..4e23ff9 100644
--- a/Lib/poplib.py
+++ b/Lib/poplib.py
@@ -15,7 +15,7 @@ TESTPASSWORD = "_passwd_"
# Imports
-import regex, socket, string
+import re, socket, string
# Exception raised when an error or invalid response is received:
@@ -263,7 +263,7 @@ class POP3:
return self._shortcmd('RPOP %s' % user)
- timestamp = regex.compile('\+OK.*\(<[^>]+>\)')
+ timestamp = re.compile(r'\+OK.*(<[^>]+>)')
def apop(self, user, secret):
"""Authorisation
@@ -276,10 +276,11 @@ class POP3:
NB: mailbox is locked by server from here to 'quit()'
"""
- if self.timestamp.match(self.welcome) <= 0:
+ m = self.timestamp.match(self.welcome)
+ if not m:
raise error_proto('-ERR APOP not supported by server')
import md5
- digest = md5.new(self.timestamp.group(1)+secret).digest()
+ digest = md5.new(m.group(1)+secret).digest()
digest = string.join(map(lambda x:'%02x'%ord(x), digest), '')
return self._shortcmd('APOP %s %s' % (user, digest))