summaryrefslogtreecommitdiff
path: root/Mailman/interfaces/chain.py
diff options
context:
space:
mode:
authorBarry Warsaw2008-01-26 18:35:18 -0500
committerBarry Warsaw2008-01-26 18:35:18 -0500
commit3952c95a23a74b8686b55a3a4f1873238e6d6610 (patch)
treec994bb588b94da2eac9d851a7da4400861dee25a /Mailman/interfaces/chain.py
parentdf637148d8fa2d5c101a990ee6766ea8547f000a (diff)
downloadmailman-3952c95a23a74b8686b55a3a4f1873238e6d6610.tar.gz
mailman-3952c95a23a74b8686b55a3a4f1873238e6d6610.tar.zst
mailman-3952c95a23a74b8686b55a3a4f1873238e6d6610.zip
Port header matching previously described by the misnamed KNONW_SPAMMERS
variable to the new chain processing system. Create a header-matching chain which handles global site header matching rules defined by HEADER_MATCHES. Rip this logic out of the SpamDetect handler; really this entire handler needs to go away but the rest of it isn't ported yet. IChains now have a get_rule() method which allows them to return private (i.e. not globally registered) rules. This is used by the header matching chain. Mailman.app.chains.process() has had its parameter list reordered to be more like all other function signatures that take a mailing list, message, and message metadata.
Diffstat (limited to 'Mailman/interfaces/chain.py')
-rw-r--r--Mailman/interfaces/chain.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Mailman/interfaces/chain.py b/Mailman/interfaces/chain.py
index 8c0837820..eca663b30 100644
--- a/Mailman/interfaces/chain.py
+++ b/Mailman/interfaces/chain.py
@@ -69,6 +69,16 @@ class IChain(Interface):
:return: an IChainLink.
"""
+ def get_rule(name):
+ """Lookup and return the named rule.
+
+ :param name: The name of the rule to return. This may be a globally
+ registered rule name, in which case it must be unique, or it may
+ be a rule defined locally to the chain.
+ :return: The named `IRule`.
+ :raises: KeyError if the named rule cannot be found.
+ """
+
class IMutableChain(IChain):