From 3938d3959383b313acb6cf09d551b7bf49d525b1 Mon Sep 17 00:00:00 2001 From: Olivier Matz Date: Wed, 25 Nov 2015 18:53:24 +0100 Subject: [PATCH] conditions: fix criteria for 'not' Only the check was inverted, but the criteria should be too. Signed-off-by: Olivier Matz --- imapami/conditions.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/imapami/conditions.py b/imapami/conditions.py index 97675a7..57014d9 100644 --- a/imapami/conditions.py +++ b/imapami/conditions.py @@ -128,7 +128,8 @@ class ImapamiCondNot(ImapamiCond): name = "not" def __init__(self, cond): cond = new(cond) - ImapamiCond.__init__(self, fetch=cond.fetch, criteria=cond.criteria) + criteria = 'NOT (%s)' % (cond.get_criteria()) + ImapamiCond.__init__(self, fetch=cond.fetch, criteria=criteria) self.cond = cond def check(self, ami, mail): -- 2.39.5