Page 1 of 1

Filters and wildcards

Posted: Mon Aug 02, 2010 4:40 pm
by deaded
Are there windcards for filters?

Here is my problem. I have a domain, call it domain.com. Mailwasher does a good job at weeding out the spam to me, [email protected], but I get a ton of stuff for [email protected], [email protected], [email protected], etc... I'd like to tell mailwasher to delete everything that has 'domain.com' in the To: field, but does not contain [email protected], [email protected], and them.domain.com. I don't want to tell it to delete everything that doesn't have those three email addresses because sometimes i'm in a blind cc or something, but I want it to look and see if it's addressed to anything at domain.com and if it's not me, us, or them, then delete it.

I tried
"all must be true"
if "To:" contains *@domain.com
and
if "To:" does not contain [email protected]
and
if "To:" does not contain [email protected]
and
if "To:" does not contain [email protected]
...then delete

that did not work.

any suggestions?

Re: Filters and wildcards

Posted: Mon Aug 02, 2010 5:04 pm
by stan_qaz
You need to use regular expressions, take a look at this topic for a starter, the to-me and not-to-me filters might help:

http://forum.firetrust.com/viewtopic.php?f=50&t=5575

Re: Filters and wildcards

Posted: Mon Aug 02, 2010 8:18 pm
by anniebrion
"all must be true"
if "To:" contains @domain.com
and
if "To:" does not contain [email protected]
and
if "To:" does not contain [email protected]
and
if "To:" does not contain [email protected]
...then delete

You just needed to remove the * from the first rule :)

But as Stan says, regex is extremely powerful and well worth learning :)

Re: Filters and wildcards

Posted: Mon Aug 02, 2010 8:48 pm
by deaded
Thanks for the replies. I will read that thread, check out regex, and in the mean time remove the star.

So there are no wildcards for the regular rules in the filter?

Re: Filters and wildcards

Posted: Mon Aug 02, 2010 8:55 pm
by anniebrion
Contains is an implied wildcard ie @domain is the same as *@domain*

regex is the way to go:

Code: Select all

(^|<|\x20).+@domain\.com\b
(^|<|\x20) = Start of line or < or space, to find the start of the email address.
.+ = 1 or more characters.
\. = .
\b = Word boundry, find the end of the address.

Re: Filters and wildcards

Posted: Tue Aug 03, 2010 8:07 am
by stan_qaz
deaded wrote:So there are no wildcards for the regular rules in the filter?
Right, in plain text mode every letter is just a letter, to get wildcards you switch to regex mode. Wildcards in regex are as simple as . and * but have many other options and much better control.