3.51. Can you show me some examples of 'header_filter_rules'?

Example 1. I want to auto reject Bcc posts but require_explicit_destination option only holds messages.

  • Put this in your rule 1 (or perhaps following other "Accept" rules that take precedence), and make your action "Accept":

    \nto:.*your-list-name
    \ncc:.*your-list-name
  • Note that prior to Mailman 2.1.7, \n is required because these patterns are matched against a single, multiline header string and you only want to match To: or Cc: at the beginning of a line so you don't match, e.g., "Subject: Your mail To: ...". Beginning in Mailman 2.1.7, the pattern search is done in multiline mode so you can also use

    ^to:.*your-list-name
    ^cc:.*your-list-name

to accomplish the same thing. Note also that the match is case insensitive. Finally, note that 'your-list-name' can be as simple as list@example.com, but this will also match things like xyz-list@examplexcom.ca.us, so you may want a more elaborate pattern for your-list-name such as, e.g.,

    \nto:.*[,"):;<\s]list@example\.com[>\s:;(,"]

but note that this may not be exhaustively correct. Consult <http://www.faqs.org/rfcs/rfc2822.html> and <http://docs.python.org/lib/re-syntax.html> and adjust this for your own needs.

  • Put this in your rule 2, and make your action "Reject" or "Discard" as appropriate:

    .
  • Yes, that is a single dot. That will allow the rule to match anything.

Example 2. Can I reject/discard those dangerous virus email?

  • This pattern can match most of the virus email (for 2.1.6 not in 2.1.5).

    content-.*name.*\.(exe|com|cmd|bat|pif|vbs|scr|zip)
  • But, be careful that this is not perfect and some users may want to use zip file for file exchange.

Converted from the Mailman FAQ Wizard

This is one of many Frequently Asked Questions.

MailmanWiki: DOC/Can you show me some examples of 'header_filter_rules'? (last edited 2015-01-31 02:36:58 by msapiro)