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: 8170
- Joined: 2011-09-08 17:48
Re: Rules "or" and "and" together
I agree. Would be useful. But would be difficult i think.
HMS 5.6.6 B2383 on Win Server 2008 R2 Foundation, + 5.6.7-B2415 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.
“With age comes wisdom, but sometimes age comes alone.”
- Oscar Wilde
“With age comes wisdom, but sometimes age comes alone.”
- Oscar Wilde
- jimimaseye
- Moderator
- Posts: 8170
- 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.
HMS 5.6.6 B2383 on Win Server 2008 R2 Foundation, + 5.6.7-B2415 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