improve conditions handling

This commit is contained in:
2021-09-14 01:36:32 +02:00
parent ef025d758c
commit e34e85af6b
4 changed files with 70 additions and 77 deletions

View File

@@ -86,10 +86,7 @@ class Rule:
def execute(self, milter):
"""Execute all actions of this rule."""
if self.conditions is None or \
self.conditions.match(envfrom=milter.mailfrom,
envto=[*milter.rcpts],
headers=milter.msg.items(),
qid=milter.qid):
self.conditions.match(milter):
for action in self.actions:
milter_action = action.execute(milter)
if milter_action is not None: