diff options
| author | bwarsaw | 2002-10-19 17:34:48 +0000 |
|---|---|---|
| committer | bwarsaw | 2002-10-19 17:34:48 +0000 |
| commit | 9ab56078cdde2bd09bc1c01dc930c4d9356cb830 (patch) | |
| tree | 67cde8e5fbee4ab68746081db7853dc0b34e69b4 /Mailman/Handlers/Hold.py | |
| parent | 186e5d7a851b1d8db89ae2ac085da392b199be5f (diff) | |
| download | mailman-9ab56078cdde2bd09bc1c01dc930c4d9356cb830.tar.gz mailman-9ab56078cdde2bd09bc1c01dc930c4d9356cb830.tar.zst mailman-9ab56078cdde2bd09bc1c01dc930c4d9356cb830.zip | |
ModeratedNewsgroup: New hold class.
process(): If news_moderation == 2, then always hold the message for
moderation, unless of course the message was pre-approved, via an
Approved header.
Also, whitespace normalization and some pychecker fixes.
Diffstat (limited to 'Mailman/Handlers/Hold.py')
| -rw-r--r-- | Mailman/Handlers/Hold.py | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/Mailman/Handlers/Hold.py b/Mailman/Handlers/Hold.py index 94beb5df8..102e89510 100644 --- a/Mailman/Handlers/Hold.py +++ b/Mailman/Handlers/Hold.py @@ -4,14 +4,14 @@ # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software +# along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. """Determine whether this message should be held for approval. @@ -28,8 +28,6 @@ message handling should stop. """ -import os -import time import email from email.MIMEText import MIMEText from email.MIMEMessage import MIMEMessage @@ -108,6 +106,10 @@ class MessageTooBig(Errors.HoldMessage): return _('''Your message was too big; please trim it to less than %(kb)d KB in size.''') +class ModeratedNewsgroup(ModeratedPost): + reason = _('Posting to a moderated newsgroup') + + # And reset the translator _ = i18n._ @@ -178,6 +180,11 @@ def process(mlist, msg, msgdata): hold_for_approval(mlist, msg, msgdata, MessageTooBig(bodylen, mlist.max_message_size)) # no return + # + # Are we gatewaying to a moderated newsgroup and is this list the + # moderator's address for the group? + if mlist.news_moderation == 2: + hold_for_approval(mlist, msg, msgdata, ModeratedNewsgroup) |
