Pages: 1
RSS
filtration logic
 
hi

have question - how to construct a filter - where:

===============move email to the SPAM folder

if "email sender" contains "@spam.com" or "email source" contains "AnoMail"

however do nothing

if "email sender" contains "@spam.com" or "email source" contains "AnoMail"

but "sender" contains "@mydomain1" or "sender" contains "@mydomain2"===============
 
In the filter conditions, you can not only use the OR operator but also AND, AND NOT and OR NOT. Additionally, you can create blocks of conditions.

So, in this case you could construct a filter condition like:

Sender | Contains | @spam.com
OR Message Source | Contains | AnoMail
AND NOT Sender | Contains | @mydomain1
AND NOT Sender | Contains | @mydomain2


...or use a block:

Sender | Contains | @spam.com
OR Message Source | Contains | AnoMail
AND NOT
(Sender | Contains | @mydomain1
OR Sender | Contains | @mydomain2)
I volunteer as a moderator to help keep the forum tidy. I do not work for Ritlabs SRL.
 
Hi, Daniel,

I assume the logic priority if AND, OR and NOT remain. That is AND is evaluated first, then OR, and then NOT.  And I'm glad to see you in administrator role. All those spammy ads for software were clogging up the forum and I am assuming thanks go to you.  Thanls. .

david
 
Yes, I also hated what all the spam was doing to this forum, so I offered Ritlabs my housecleaning services :)

Actually I don't know if The Bat honors the traditional processing order of boolean operators. Their (perhaps more human-readable) implementation with 'And not' and 'Or not' instead of 'Not' seems to break with tradition. I always get hopelessly confused when the formal logic of boolean operators or regular expressions conflicts with that of plain language, and I usually end up solving these problems through trial and error (or asking someone else). I hope I've not misinformed Piotr, but at least he will know where to look.
I volunteer as a moderator to help keep the forum tidy. I do not work for Ritlabs SRL.
 
Quote
Daniel van Rooijen wrote:
Sender | Contains | @spam.com OR Message Source | Contains | AnoMailAND NOT(Sender | Contains | @mydomain1 OR Sender | Contains | @mydomain2)
Thanks for the idea :)

this:
Quote
$$$$ TB! Message Filter $$$$
beginFilter
UID: [59728C7F.01D475BD.23A138D2.320AE81F]
Name: SPAM\20TEST
Filter: {\0D\0A{\0D\0A{\0D\0A\20`0`0`@okmail-1.pl\0D\0A1`0`0`@okmail-2.pl\0D\0A}\0D\0A{2\0D\0A{\0D\0A\20`6`0`AnoMail\0D\0A1`6`0`aims.biz.\0D\0A1`6`0`adletter.\0D\0A1`6`0`asap-24.\0D\0A1`6`0`action-gamez.\0D\0A}\0D\0A{1\0D\0A\20`5`0`biznesmoney.\0D\0A1`5`0`bancorp.\0D\0A0`0`0`\0D\0A}\0D\0A}\0D\0A}\0D\0A}
Tag: SPAM\20TEST
MoveMessage AutoFolder folder \5C\5C\5CSPAM
IsActive
Ignore
endFilter
is right?
Edited: Piotr Kaleta - 06 November 2018 13:16:01
 
What your filter will do:

If the message is from @okmail-1.pl or @okmail-2.pl, it will be moved to the Spam folder, except if:
- the messages source is AnoMail, aims.biz., (etcetera), Or:
- the message header contains biznesmoney. or bancorp., AND the sender contains ''.

I think that is the opposite of what you want to do?

(I'm also not sure what " sender contains '' " will do)

Note: Instead of message filters, you could also use an anti-spam plug-in for this purpose.
Three of them are listed here: https://www.ritlabs.com/en/products/thebat/plugin.php
To configure an anti-spam plug-in in The Bat, see Options | Preferences | Plug-Ins | Anti-spam.
I volunteer as a moderator to help keep the forum tidy. I do not work for Ritlabs SRL.
 
Quote
If the message is from @okmail-1.pl or @okmail-2.pl, it will be moved to the Spam folder, except if:
- the messages source is AnoMail, aims.biz., (etcetera), Or:
- the message header contains biznesmoney. or bancorp., AND the sender contains ''.

I think that is the opposite of what you want to do?
rather yes :(

Quote
(I'm also not sure what " sender contains '' " will do)

I have a problem with expressing this in English :\  

Once again: move to SPAM folder all emails contains:

[block] ATEXT1 or AAAA.net or AAAA.com [block]

[block] BTEXT2 or BBBB.net or BBBB.com [block]

[block] CTEXT3 or CCCC.net or CCCC.com [block]

but do nothing when one or more from phrases above come from @OK1.com or @OK2.com domains

Quote
$$$$ TB! Message Filter $$$$
beginFilter
UID: [59728C7F.01D475BD.23A138D2.320AE81F]
Name: SPAM\20TEST
Filter: {\0D\0A{\0D\0A{\0D\0A\20`0`1`@okmail-1.pl\0D\0A1`0`1`@okmail-2.pl\0D\0A}\0D\0A{0\0D\0A{\0D\0A\20`6`0`AnoMail\0D\0A1`6`0`aims.biz.\0D\0A1`6`0`adletter.\0D\0A1`6`0`asap-24.\0D\0A1`6`0`action-gamez.\0D\0A}\0D\0A{1\0D\0A\20`6`0`biznesmoney.\0D\0A1`6`0`bancorp.\0D\0A1`6`0`beemail.\0D\0A}\0D\0A}\0D\0A}\0D\0A}
Tag: SPAM\20TEST
MoveMessage AutoFolder folder \5C\5C\5CSPAM
IsActive
Ignore
endFilter
?
Edited: Piotr Kaleta - 06 November 2018 16:06:19
 
Yes, that looks better. I think this new filter will work correctly, but I'm not 100% sure (just 90%, binary logic is not my strongest point :)

Have you tested it manually with some spam mails?

Maybe instead of testing the whole 'message source', you can use 'header' instead (that is where those spam domains are mentioned). That might save some time when you receive messages that have large attachments.
I volunteer as a moderator to help keep the forum tidy. I do not work for Ritlabs SRL.
Pages: 1