summaryrefslogtreecommitdiff
path: root/src/mailman/interfaces/mailinglist.py
diff options
context:
space:
mode:
authorAurélien Bompard2015-09-14 11:16:45 +0200
committerBarry Warsaw2015-10-20 21:10:35 -0400
commit87f2f50b08eb0a7b0a99924b82fd246a6ce10983 (patch)
treeafed6065fb39fe3fae3b6d82ba97d142ad7b0f0e /src/mailman/interfaces/mailinglist.py
parente2f6b111f0bbf2287fbf793cd6f09fb829ee9758 (diff)
downloadmailman-87f2f50b08eb0a7b0a99924b82fd246a6ce10983.tar.gz
mailman-87f2f50b08eb0a7b0a99924b82fd246a6ce10983.tar.zst
mailman-87f2f50b08eb0a7b0a99924b82fd246a6ce10983.zip
Diffstat (limited to 'src/mailman/interfaces/mailinglist.py')
-rw-r--r--src/mailman/interfaces/mailinglist.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/mailman/interfaces/mailinglist.py b/src/mailman/interfaces/mailinglist.py
index 59cb0ffd4..7f3b68008 100644
--- a/src/mailman/interfaces/mailinglist.py
+++ b/src/mailman/interfaces/mailinglist.py
@@ -860,3 +860,34 @@ class IHeaderMatch(Interface):
If it is None, the `[antispam]jump_chain` action in the configuration
file is used.
""")
+
+
+class IHeaderMatchSet(Interface):
+ """The set of header matching rules for a mailing list."""
+
+ def clear():
+ """Clear the set of header matching rules."""
+
+ def add(header, pattern, chain):
+ """Add the given header matching rule to this mailinglist's set.
+
+ :param header: The email header to filter on. It will be converted to
+ lowercase for easier removal.
+ :type header: string
+ :param pattern: The regular expression to use.
+ :type pattern: string
+ :param chain: The chain to jump to, or None to use the site-wide
+ configuration. Defaults to None.
+ :type chain: string or None
+ :raises ValueError: there can be only one couple of header and pattern
+ for a mailinglist.
+ """
+
+ def remove(header, pattern):
+ """Remove the given header matching rule from this mailinglist's set.
+
+ :param header: The email header part of the rule to be removed.
+ :type header: string
+ :param pattern: The regular expression part of the rule to be removed.
+ :type pattern: string
+ """