Good day, i use hmail 5.3, i use many rules and & or , this called one question, is it possible to do use rules "or" and "and" together?
for example: field subject contain some word "OR" body contain some word "AND" field "to" contain some address
sorry for my English
Rules "or" and "and" together
- jimimaseye
- Moderator
- Posts: 8917
- Joined: 2011-09-08 17:48
Re: Rules "or" and "and" together
I agree. Would be useful. But would be difficult i think.
5.7 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829
Re: Rules "or" and "and" together
Yes i have needed this a few times. Normally just turn to scripting if you need more advanced rules.
If at first you don't succeed, bomb disposal probably isn't for you! ヅ
Re: Rules "or" and "and" together
I split them into two rules, first rule create a custom header value and second rule check for the header value and the remaining criterias.
SørenR.
Algorithm (noun.)
Word used by programmers when they do not want to explain what they did.
Algorithm (noun.)
Word used by programmers when they do not want to explain what they did.
- jimimaseye
- Moderator
- Posts: 8917
- Joined: 2011-09-08 17:48
Re: Rules "or" and "and" together
REGEX is a beauty for helping out in these situations.
EG,
Where
RETURN PATH EQ axp.fraudite.com
and
TO contains USER1
or
TO contains USER2
could be written as
RETURN PATH EQ axp.fraudite.com
and
TO regex (?i:^.*(USER1@|USER2@).*$)
Regex can do CONTAIN, NOT CONTAINS(using the asterix), EQUALS, NOT EQUALS (removing the asterix) - but not sure how to do 'Greater Than' etc - im no expert.
(Admitedly, though, you cant do where IF FIELD1=xxx and (Field2=yyy or Field3=zzz). So I too am still up for the ability to do so if it happens.
EG,
Where
RETURN PATH EQ axp.fraudite.com
and
TO contains USER1
or
TO contains USER2
could be written as
RETURN PATH EQ axp.fraudite.com
and
TO regex (?i:^.*(USER1@|USER2@).*$)
Regex can do CONTAIN, NOT CONTAINS(using the asterix), EQUALS, NOT EQUALS (removing the asterix) - but not sure how to do 'Greater Than' etc - im no expert.
(Admitedly, though, you cant do where IF FIELD1=xxx and (Field2=yyy or Field3=zzz). So I too am still up for the ability to do so if it happens.
5.7 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829