diff options
author | Mark Sapiro <mark@msapiro.net> | 2010-04-09 13:17:07 -0700 |
---|---|---|
committer | Mark Sapiro <mark@msapiro.net> | 2010-04-09 13:17:07 -0700 |
commit | 1d66f60cb0223b549d87d9e300cea06596f379d5 (patch) | |
tree | 929c5f946f0051b7a91289f740c9df010fa25610 /Mailman/Handlers/Approve.py | |
parent | 65d46a5c05a73e1ec5e73229730b4d30cbae4647 (diff) | |
download | mailman2-1d66f60cb0223b549d87d9e300cea06596f379d5.tar.gz mailman2-1d66f60cb0223b549d87d9e300cea06596f379d5.tar.xz mailman2-1d66f60cb0223b549d87d9e300cea06596f379d5.zip |
We now accept/remove X-Approved: and X-Approve: headers in addition to
Approved: and Approve: for pre-approving posts. Bug ##557750.
Diffstat (limited to 'Mailman/Handlers/Approve.py')
-rw-r--r-- | Mailman/Handlers/Approve.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/Mailman/Handlers/Approve.py b/Mailman/Handlers/Approve.py index 9e7da910..ed85395d 100644 --- a/Mailman/Handlers/Approve.py +++ b/Mailman/Handlers/Approve.py @@ -1,4 +1,4 @@ -# Copyright (C) 1998-2009 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2010 by the Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -61,7 +61,10 @@ def process(mlist, msg, msgdata): # because we want to discourage the practice of sending the site admin # password through email in the clear. missing = [] - passwd = msg.get('approved', msg.get('approve', missing)) + for hdr in ('approved', 'approve', 'x-approved', 'x-approve'): + passwd = msg.get(hdr, missing) + if passwd is not missing: + break if passwd is missing: # Find the first text/plain part in the message part = None @@ -80,7 +83,11 @@ def process(mlist, msg, msgdata): if i >= 0: name = line[:i] value = line[i+1:] - if name.lower() in ('approve', 'approved'): + if name.lower() in ('approve', + 'approved', + 'x-approve', + 'x-approved', + ): passwd = value.lstrip() # Now strip the first line from the payload so the # password doesn't leak. |