~barry/mailman/events-and-web

« back to all changes in this revision

Viewing changes to src/mailman/rules/approved.py

  • Committer: Barry Warsaw
  • Date: 2012-04-05 05:43:40 UTC
  • Revision ID: barry@list.org-20120405054340-tcpcksw951pr76nr
 * A mailing list's *moderator password* is no longer stored in the clear; it
   is hashed with the currently selected scheme.

Also:

 - Simplify and rewrite the approved.rst doctest.  Now just document the good
   path, and only describe its functionality using the Approved: header, which
   is the recommended header.
 - Greatly expand the unittests for the approved rule.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
"""Look for moderator pre-approval."""
19
19
 
20
 
from __future__ import absolute_import, unicode_literals
 
20
from __future__ import absolute_import, print_function, unicode_literals
21
21
 
22
22
__metaclass__ = type
23
23
__all__ = [
26
26
 
27
27
 
28
28
import re
 
29
 
29
30
from email.iterators import typed_subpart_iterator
 
31
from flufl.password import verify
30
32
from zope.interface import implements
31
33
 
32
34
from mailman.core.i18n import _
117
119
        else:
118
120
            for header in HEADERS:
119
121
                del msg[header]
120
 
        return password is not missing and password == mlist.moderator_password
 
122
        return (password is not missing and 
 
123
                verify(mlist.moderator_password, password))
121
124
 
122
125
 
123
126