Merge pull request #1068 from servusoft/dev

Solving issue with search criteria 'maximum age' for some mail server
This commit is contained in:
Jonas Winkler 2021-05-29 19:13:10 +02:00 committed by GitHub
commit fcc4ecd007
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -75,9 +75,9 @@ def get_rule_action(rule):
def make_criterias(rule):
maximum_age = date.today() - timedelta(days=rule.maximum_age)
criterias = {
"date_gte": maximum_age
}
criterias = {}
if rule.maximum_age > 0:
criterias["date_gte"] = maximum_age
if rule.filter_from:
criterias["from_"] = rule.filter_from
if rule.filter_subject: