Filter rules

General discussion about PopTray. You love it? You hate it? Talk about it here.

Moderators: KY Dave, jojobear99, Rdsok

Post Reply
coercri
First Timer
Posts: 4
Joined: Fri Feb 25, 2005 4:51 pm
Location: UK
Contact:

Filter rules

Post by coercri » Fri Feb 25, 2005 4:53 pm

I have 4 email addresses and I want to delete all email that comes in to me that is NOT specifically addresses to me, what rules will do this?
Alan N Preece

User avatar
KY Dave
Not the Developer
Posts: 1599
Joined: Thu Mar 14, 2002 7:29 pm
Location: Burkesville, KY. U.S.A.
Contact:

Post by KY Dave » Fri Feb 25, 2005 5:50 pm

[WARNING -> THIS WILL DELETE ALL EMAIL NOT SPECIFICALLY TO YOU<- NO GETTING IT BACK]

In PopTray 3.1 on the RULES tab, ADD RULE.

The box for NEW MESSAGES ONLY should be UNCHECKED.

Use the CRITERIA of ALL, DELETE FROM SERVER, NOT. The NOT box is at the right of the RULE criteria.

1ST ROW, TO, CONTAINS, TEXT = YOUR 1ST EMAIL ADDRESS
ADD ROW, TO, CONTAINS, TEXT = YOUR 2ND EMAIL ADDRESS
ADD ROW, TO, CONTAINS, TEXT = YOUR 3RD EMAIL ADDRESS
ADD ROW, TO, CONTAINS, TEXT = YOUR 4TH EMAIL ADDRESS
SAVE RULE.

You might want to turn on the logging feature in BOTH the actual rule and also in PopTray OPTIONS, MISCELANEOUS, LOG RULE. SAVE OPTIONS.

QUIT PopTray, RESTART PopTray for changes to take effect.

Now when you click CHECK, all email not specifically to you will be deleted from that account. You might need to click SHIFT/CHECK for the rules to fire the first time.

[WARNING -> THIS WILL DELETE ALL EMAIL NOT SPECIFICALLY TO YOU<- NO GETTING IT BACK]

Just so you understand, any email that is sent to you as a CC or BCC will also be deleted. [EDITED FOR CORRECTNESS]

If you want to limit your email further, as in deleting anything that is sent to multiple recipients, then use EQUALS instead of CONTAINS.

I suggest using MARK AS SPAM for a few days to check the functioning of the rule.
Last edited by KY Dave on Sat Feb 26, 2005 7:39 pm, edited 1 time in total.
KY Dave

Family Blog
You can STOP SPAM using PopFile and PopTray.

coercri
First Timer
Posts: 4
Joined: Fri Feb 25, 2005 4:51 pm
Location: UK
Contact:

Post by coercri » Fri Feb 25, 2005 9:56 pm

Ive set that all up and done what you suggest, that mark as spam for a while.

Thanks for your help.
Alan N Preece

User avatar
lemming
Groupie
Posts: 55
Joined: Sun Jan 09, 2005 3:51 am
Location: Malaysia

Don't forget CC:

Post by lemming » Sat Feb 26, 2005 3:20 pm

Warning! The rules posted by Dave will also cause CC: mail to you to be deleted, in addition to BCC: mail. For example, if the headers look like this:

TO: someone.else@othermail.com
CC: you@yourisp.com

The rules would also apply. But note that there are perfectly legitimate emails like this. Your boss or your friends may send out emails using CC:.

Fortunately, there is a CC field in PopTray's rules, so you should also add rules for CC containing your address. These need to be under the same rule as the TO rules - just add more rows to the rule.

-Lemming

coercri
First Timer
Posts: 4
Joined: Fri Feb 25, 2005 4:51 pm
Location: UK
Contact:

Post by coercri » Sat Feb 26, 2005 6:07 pm

Ok cheers for that, there seems to be no easy answer really then!
Alan N Preece

User avatar
KY Dave
Not the Developer
Posts: 1599
Joined: Thu Mar 14, 2002 7:29 pm
Location: Burkesville, KY. U.S.A.
Contact:

Re: Don't forget CC:

Post by KY Dave » Sat Feb 26, 2005 7:37 pm

lemming wrote:Warning! The rules posted by Dave will also cause CC: mail to you to be deleted, in addition to BCC: mail. For example, if the headers look like this:

TO: someone.else@othermail.com
CC: you@yourisp.com

The rules would also apply.
Lemming
I actually had that in my posting and then took it out. :oops:

I was thinking about where several address are listed in the TO field separated by semicolons and using CONTAINS instead of EQUALS. I then mistakenly decided to remove the warning about the CC field email.

Thanks for cleaning up my mistake. I have EDITED my posting in case someone else reads it.
KY Dave

Family Blog
You can STOP SPAM using PopFile and PopTray.

User avatar
lemming
Groupie
Posts: 55
Joined: Sun Jan 09, 2005 3:51 am
Location: Malaysia

regular expressions again

Post by lemming » Mon Feb 28, 2005 7:03 pm

Just realised that all the multiple rows can easily be summarised using regular expressions, if you're not averse to them.

So, assuming you have these three email addresses:

john@firstisp.com
john22@secondisp.com
johnb@thirdisp.com

you'd only need a rule with two rows to detect whether the TO: and CC: headers contain any of your email addresses.


Needed -> All Rows

Row 1

TO -> Reg Expr ->

(john@firstisp|john22@secondisp|johnb@thirdisp) NOT

Row 2

CC -> Reg Expr ->

(john@firstisp|john22@secondisp|johnb@thirdisp) NOT

However, you need to be really careful when constructing this rule. Here are some notes:

1. The addresses must be enclosed in parantheses ( ) Do not use square brackets or curly brackets. Also, make sure there are no spaces in the regular expression.

2. It is critical that you select the Needed -> All Rows, and the NOT options for both rows. Otherwise, most or all of your mail will automatically be marked as spam!

3. | is the "pipe" symbol, which is usually located next to the backspace key on most keyboards, and shares the same key as the backslash \ It stands for "or" in regular expressions.

4. I only used the first part of the email domain because it is unique enough for the rule.

5. if your username contains punctuation, for instance, john.smith@firstisp.com or john-smith@firstisp.com then you need to backslash them in the regex, e.g.

john\.smith@firstisp or john\-smith@firstisp

This is because . and - have special meanings in regex. Underscores have no special meaning, so can be left as is.

6. This rule will still trigger if you get any BCC: mail, so you should mark as spam at most.

-Lemming

coercri
First Timer
Posts: 4
Joined: Fri Feb 25, 2005 4:51 pm
Location: UK
Contact:

Post by coercri » Mon Feb 28, 2005 9:53 pm

Wow, thats for all the effort you goys have put into this question, Ive set up this command and set as spam, Its a shame that it cannot to done within the BCC line, is that a limitation of PopTray or just not possible generally?
Alan N Preece

Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests