Mailman 3 - Header Filter
I am a Mailman neophyte and need help with filtering posts based on the subject field. We have a few list owners that want 'Out of Office' replies discarded. When using the below syntax in Postorius/Header filter the post is not discarded but ends up in 'Held Messages'. Is there any syntax I am missing or a setting in the lists that needs to be disabled/enabled to get these posts dropped? Any help is much appreciated.
Header: ^subject: subject: subject
Pattern: Automatic Reply 'Automatic Reply' "Automatic Reply"
Action: Discard
DISCLAIMER: The information contained in this message is privileged and confidential. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please reply to the message and delete/destroy any copy of this message. Information in this message that does not relate to the official business of the firm shall be understood as neither given nor endorsed by it.
On 4/22/19 2:34 PM, Thomas Lehker wrote:
I am a Mailman neophyte and need help with filtering posts based on the subject field. We have a few list owners that want 'Out of Office' replies discarded. When using the below syntax in Postorius/Header filter the post is not discarded but ends up in 'Held Messages'. Is there any syntax I am missing or a setting in the lists that needs to be disabled/enabled to get these posts dropped? Any help is much appreciated.
The issue may be that in Mailman core's 'builtin' chain, the checking of header_matches occurs after the check for member moderation so if the member moderation check results in the message being held, the header_matches aren't checked.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Mark Sapiro wrote:
I am a Mailman neophyte and need help with filtering posts based on the subject field. We have a few list owners that want 'Out of Office' replies discarded. When using the below syntax in Postorius/Header filter the post is not discarded but ends up in 'Held Messages'. Is there any syntax I am missing or a setting in the lists that needs to be disabled/enabled to get these posts dropped? Any help is much appreciated. The issue may be that in Mailman core's 'builtin' chain, the checking of
On 4/22/19 2:34 PM, Thomas Lehker wrote: header_matches occurs after the check for member moderation so if the member moderation check results in the message being held, the header_matches aren't checked.
There may me a newer thread about this, but I haven't found it.
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? 🤞🏻
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?
I know that filtering out Out of Office replies is just as hard as spam filtering, since it varies, but at least there is some kind of consistency in the wording, so I would give it a try.
*) In a prevous mail I was told that ^ would tell Mailman that it is a regex.
-- Henrik Rasmussen her@adm.ku.dk Copenhagen, Denmark
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
- Thomas Lehker:
We have a few list owners that want 'Out of Office' replies discarded.
This sounds like a job for a milter rather than a mailing list manager to me. Even a lightweight milter like milter-regex [1] can perform complex message inspections and signal the calling MTA to discard or reject the examined messages.
[1] https://www.benzedrine.ch/milter-regex.html
-Ralph
participants (4)
-
Henrik Rasmussen
-
Mark Sapiro
-
Ralph Seichter
-
Thomas Lehker