Nonmember moderation action is disconnected from the list's default
Context: when an email arrives from an unknown address, the email is stored in the DB as a nonmember for this list. The action to take is copied from the list's default_nonmember_action
to this nonmember's "action" column in the DB, and then the action is taken.
If the list's default_nonmember_action
is changed, all existing nonmembers will retain their former action since it's not changed in the database. So if someone sends an email to a list that holds nonmember emails, and then the admin changes this settings to discard, following emails coming from the same nonmember will still get held.
As discussed on IRC between @warsaw and me, a solution would be to:
- set the
moderation_action
to None when nonmembers are created, - change the moderation rule to check that if
nonmember.moderation_action is None
, then take themlist.default_nonmember_action
.
This way it would just track whatever the mlist's setting is and it would be only one thing to change. Kind of like preferred_address
in a sense.
There are a couple of questions left:
- should we do the same for other member roles? i.e. allow their moderation_action to also be None? but we'd have to be careful to use
default_member_action
in that case. I think we should, for the same reason. - should each list have a default_action for every possible member role? Maybe it doesn't make any sense to have default actions for owners and moderators since we essentially don't moderate "postings" to those recipients. As a first cut, unless it complicates the implementation, it would be fine to support this only for
MemberRole.{member,nonmember}
.
We'd have to change Member.__init__()
to not set the default moderation_action
, or at least accept an argument which could be None. We'd need a way to remove an existing moderation_action, meaning "now just default to the list's defaults".
I'm willing to work on a implementation, and will do in the next weeks or so.