On 9/25/23 06:30, Henrik Rasmussen wrote:
In my case I would be more interested in holding or discarding mails with subject 'Out of Office' if the mail would otherewise be send the to the list members due to a non-moderated list.
I would emagine that the order of "check for member moderation" and header_matches would not be significant if holding or discarding the mail due to header_matches, am I right? 🤞🏻
No. It depends on what the check for member moderation rule does. If the post is from a non-member or from a member and the members moderation is Default Processing or if it is List default and the list's Default action to take when a member posts to the list is Default Processing, then the Header Filters will be applied.
However, if the post is from a member and the members moderation is directly or via list default any of Hold, Reject, Discard or Accept, that is the action that will be applied.
If so, I would think that Header "subject:" or "subject" with Pattern "^(?i)(.*)autosvar(.*)" - without the double quotes - and Function "Hold for moderation" or "Discard" should either hold or discard any message with "Autosvar" (danish word for "Out of Office reply") somewhere in the subject, but that doesn't happen. What is the correct syntax?
Do not include the : in the header name. Other than that, your pattern should be OK but the ^, the (?i) and the parentheses around .* are all unnecessary.
*) In a prevous mail I was told that ^ would tell Mailman that it is a regex.
That is true for lots of things where either a string value or a regexp is acceptable such as the * these nonmembers entries, but the Pattern entry for Header Filters is always a regexp and is searched with re.search with re.IGNORECASE, so while your pattern above should work, a much simpler pattern is just "autosvar" (w/o the quotes).
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan