summaryrefslogtreecommitdiff
path: root/src/mailman/rules/approved.py
diff options
context:
space:
mode:
authorBarry Warsaw2012-07-06 21:08:41 -0400
committerBarry Warsaw2012-07-06 21:08:41 -0400
commit8d8ab1655b51e277570005b445d3b014afcfbc57 (patch)
tree6ba0147d975636e129a787c9dfa64dae8cffae89 /src/mailman/rules/approved.py
parentcd3f84b301c2150fea5402129a2e7bc862fbb52b (diff)
parent01415190ab44e69a8f09a6411564a7cb288404e8 (diff)
downloadmailman-8d8ab1655b51e277570005b445d3b014afcfbc57.tar.gz
mailman-8d8ab1655b51e277570005b445d3b014afcfbc57.tar.zst
mailman-8d8ab1655b51e277570005b445d3b014afcfbc57.zip
Diffstat (limited to 'src/mailman/rules/approved.py')
-rw-r--r--src/mailman/rules/approved.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/mailman/rules/approved.py b/src/mailman/rules/approved.py
index 3e2b7bc83..3ff7d21ec 100644
--- a/src/mailman/rules/approved.py
+++ b/src/mailman/rules/approved.py
@@ -28,9 +28,9 @@ __all__ = [
import re
from email.iterators import typed_subpart_iterator
-from flufl.password import verify
-from zope.interface import implements
+from zope.interface import implementer
+from mailman.config import config
from mailman.core.i18n import _
from mailman.interfaces.rules import IRule
@@ -45,9 +45,9 @@ HEADERS = [
+@implementer(IRule)
class Approved:
"""Look for moderator pre-approval."""
- implements(IRule)
name = 'approved'
description = _('The message has a matching Approve or Approved header.')
@@ -119,8 +119,14 @@ class Approved:
else:
for header in HEADERS:
del msg[header]
- return (password is not missing and
- verify(mlist.moderator_password, password))
+ if password is missing:
+ return False
+ is_valid, new_hash = config.password_context.verify(
+ mlist.moderator_password, password)
+ if is_valid and new_hash:
+ # Hash algorithm migration.
+ mlist.moderator_password = new_hash
+ return is_valid