Newsgroup moderation

The news-moderation rule matches all messages posted to mailing lists that gateway to a moderated newsgroup. The reason for this is that such messages must get forwarded on to the newsgroup moderator. From there it will get posted to the newsgroup, and from there, gated to the mailing list. It’s a circuitous route, but it works nonetheless by holding all messages posted directly to the mailing list.

>>> mlist = create_list('')
>>> rule = config.rules['news-moderation']
>>> print(

Set the list configuration variable to enable newsgroup moderation.

>>> from mailman.interfaces.nntp import NewsgroupModeration
>>> mlist.newsgroup_moderation = NewsgroupModeration.moderated

And now all messages will match the rule.

>>> msg = message_from_string("""\
... From:
... Subject: An announcement
... Great things are happening.
... """)
>>> rule.check(mlist, msg, {})

When moderation is turned off, the rule does not match.

>>> mlist.newsgroup_moderation = NewsgroupModeration.none
>>> rule.check(mlist, msg, {})