Specifying hold reason: non-member, header filter number/regex
Hi,
Unlike in mm2, I'm finding in mm3 that is not obvious when non-member is trying to post to the list when their subject line also has a header-filter match. All it lists is that the posting has matched a header rule (which isn't quite accurate as it is a non-member) and even when it matches a header rule it doesn't say which one (which is a noted issues in the file mailman/chains/headers.py). Anyone else noticed the same and have a solution?
The relevant list setting is:: Message Acceptance > Default action to take when a non-member posts to the list: Hold for moderation
Should I be editing mailman/chains/headers.py or perhaps another python file in that firstory to make the hold reason more explicit? It is actually two problems I wish to solve:
- Show when the message is held because it is a posting by a non-member (or a moderated member, etc)
- Show what specific header filter has caused the message to be held so I know why and/or can debug the regex to be more/less specific.
Cheers,
Duane
On 3/16/21 9:17 AM, Duane Raymond wrote:
Hi,
Unlike in mm2, I'm finding in mm3 that is not obvious when non-member is trying to post to the list when their subject line also has a header-filter match. All it lists is that the posting has matched a header rule (which isn't quite accurate as it is a non-member) and even when it matches a header rule it doesn't say which one (which is a noted issues in the file mailman/chains/headers.py).
This is because in the chain of rules being tested for the post, the header matching rules are tested before non-member moderation.
Anyone else noticed the same and have a solution?
The relevant list setting is:: Message Acceptance > Default action to take when a non-member posts to the list: Hold for moderation
Should I be editing mailman/chains/headers.py or perhaps another python file in that firstory to make the hold reason more explicit? It is actually two problems I wish to solve:
- Show when the message is held because it is a posting by a non-member (or a moderated member, etc)
For this one, member moderation holds come before header matches, so I think your issue is only for non-members. If you want that check to come first reorder these lines <https://gitlab.com/mailman/mailman/-/blob/master/src/mailman/chains/builtin.py#L54-57> so the non-member moderation check comes before header matching.
- Show what specific header filter has caused the message to be held so I know why and/or can debug the regex to be more/less specific.
You've seen the code and the comments in mailman/chains/headers.py. We would welcome a merge request to implement this.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
This is because in the chain of rules being tested for the post, the header matching rules are tested before non-member moderation. <snip> For this one, member moderation holds come before header matches, so I think your issue is only for non-members. If you want that check to come first reorder these lines
Great - I'll take that approach and see how it goes and then might tinker with the code so it isn't just a simple first-come-first-server result but can tell me if it matches both a non-member/moderated member filter and a header filter. I'll share for peer feedback and testing (since I'm new to this) as I go.
I guess I should join the developers list for this or more just fork the code, make changes and make a merge request?
You've seen the code and the comments in mailman/chains/headers.py. We would welcome a merge request to implement this.
I'll give it a go :-) I might need some guidance for my first contributions....but should improve from there as get familiar with the code base and making changes (coding isn't my day-job but I seem to do a lot of hacky stuff for myself so can keep learning).
Cheers,
Duane
participants (2)
-
Duane Raymond
-
Mark Sapiro