The Rules & Regular Expressions Thread

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

Moderators: KY Dave, jojobear99, Rdsok

User avatar
ComputerBob
Guru
Posts: 278
Joined: Sat Jun 14, 2003 5:27 pm
Location: The Gulf Coast of the Sunshine State, USA
Contact:

The Rules & Regular Expressions Thread

Post by ComputerBob » Thu Mar 04, 2004 4:50 pm

I'm starting this thread, hoping that users will share helpful rules and regular expressions that they've created and used in PopTray (the new 3.1 Beta version of PopTray supports regular expressions).

Since many of us don't know much about writing regular expressions, this thread could help us by showing examples of good regular expressions that work.

If you post an expression that you've successfully used in PopTray, please include a short explanation of what it does and how it works.

I hope that, over time, this thread will become a valuable depository of excellent rules and regular expressions that everyone can use.
Last edited by ComputerBob on Fri Mar 05, 2004 9:52 am, edited 1 time in total.
ComputerBob - Making Geek-Speak Chic™
http://www.computerbob.com
One Of The Largest One-Person Sites On The Web
With Tons of Information, Software, Help, and Fun

User avatar
homaquebec
PopTray Family
Posts: 913
Joined: Tue May 27, 2003 6:47 pm
Location: Québec (Canada)

Post by homaquebec » Thu Mar 04, 2004 5:35 pm

cable filter

Rule

Row no 1

Area = Header
Compare = Contains
Text = CABLE FILTER

Row no 2

Area = Header
Compare = Contains
Text = cable filter

Row no 3

Area = Body
Compare = Contains
Text = cable filter

Actions

Mark as SPAM
Log Rule
Tray Color

Is it the way you want it ComputerBob?
Last edited by homaquebec on Thu Mar 04, 2004 7:25 pm, edited 1 time in total.

User avatar
homaquebec
PopTray Family
Posts: 913
Joined: Tue May 27, 2003 6:47 pm
Location: Québec (Canada)

Post by homaquebec » Thu Mar 04, 2004 7:16 pm

pharmacy online

Rule

row no 1

Area = Header
Compare = contains
Text = pharmacy online

row no 2

Area = Body
Compare = contains
Text = pharmacy online

Actions

Mark as SPAM
Log Rule
Tray Color

User avatar
ComputerBob
Guru
Posts: 278
Joined: Sat Jun 14, 2003 5:27 pm
Location: The Gulf Coast of the Sunshine State, USA
Contact:

Post by ComputerBob » Thu Mar 04, 2004 8:14 pm

homaquebec wrote:Is it the way you want it ComputerBob?
Thanks, Bruno! I have hundreds of rules in PopTray, but I don't know enough about regular expressions to tell people how they should share theirs, so whatever way you RegEx experts think is a good way to share them is fine with me! :wink:
ComputerBob - Making Geek-Speak Chic™
http://www.computerbob.com
One Of The Largest One-Person Sites On The Web
With Tons of Information, Software, Help, and Fun

User avatar
homaquebec
PopTray Family
Posts: 913
Joined: Tue May 27, 2003 6:47 pm
Location: Québec (Canada)

Post by homaquebec » Thu Mar 04, 2004 10:36 pm

Here are some subjects that everybody could use to create rules. I did, creating 10 rules, with a row for Header as Area and, everywhere, Contains as Compare and the subject as Text. I add rows with the same caracteristics but changing the text according to varations indicated. I double the number of rows using the same caracteristics except the Area : Header has been changed by Body.

1. Viagra online (also: xanax, valium, xenical, phentermine, soma, celebrex, valtrex, zyban, fioricet, adipex, etc.)

2. Online pharmacy (also: 'online prescriptions'; 'meds online')

3. Get out of debt (also: 'special offer')

4. Get bigger (also: 'satisfy your partner'; 'improve your sex life')

5. Online degree (also: 'online diploma')

6. Lowest mortgage rates (also: 'lower your mortgage rates'; 'refinance'; 'refi')

7. Lowest insurance rates (also: 'lower your insurance now')

8. Work from home (also: 'be your own boss')

9. Hot XXX action (also: 'teens'; 'porn')

10. As seen on oprah

Source

User avatar
Petrocelli
Still here
Posts: 5
Joined: Thu Feb 19, 2004 9:13 am

Post by Petrocelli » Thu Mar 04, 2004 11:10 pm

Hello homaquebec,

I am not sure to understand all, because my English is not very good.
Please, can you post or mail your Rules.ini-File?

Thanks,
Petro
*************
petro.s@gmx.de
*************

Guest

Post by Guest » Thu Mar 04, 2004 11:54 pm

Pedro,

I will not post or mail my rules.ini file; there are private things among them. But a member who speak your language would surely accept to explain you.

But if you can send you an email, make a rule
in which, in the header (Area)
the mail contening (Compare)
a given expression (Text)
should be considered as spam, (a box in the Actions)
the rule written in RULES.LOG file (a box in the Actions)
and the tray being black. (a box in the Actions). Save the rule.

Shut down PopTray.

Send you an email contening the expression in the subject. Reopen PopTray and check your account. You will see the result.

But, since this expression could be in the body, add a row to your rule (there is presently a bug in this function), with the appropriated fields. So, the email will be considered as SPAM either if the expression is in the header or in the body.

Once you will have understood, there will be work to do but it is not difficult.

User avatar
homaquebec
PopTray Family
Posts: 913
Joined: Tue May 27, 2003 6:47 pm
Location: Québec (Canada)

Post by homaquebec » Thu Mar 04, 2004 11:56 pm

I am the guest above.

Erratum = Petro and not Pedro
Last edited by homaquebec on Fri Mar 05, 2004 1:45 am, edited 1 time in total.

User avatar
Petrocelli
Still here
Posts: 5
Joined: Thu Feb 19, 2004 9:13 am

Post by Petrocelli » Fri Mar 05, 2004 12:21 am

@homaquebec
Erratum = Petro and not Pedro
No problem.

Now I try to make rules but when I fill a row with more than one word it does not work. For your Example rule 1: Must I really add for every word (xanax, valium, xenical, ...) a row?

Petro
*************
petro.s@gmx.de
*************

User avatar
homaquebec
PopTray Family
Posts: 913
Joined: Tue May 27, 2003 6:47 pm
Location: Québec (Canada)

Post by homaquebec » Fri Mar 05, 2004 12:53 am

According to my knowledges (and my choices), here what it gives :

Image
and
Image

I could have saved rows by using wildcards (i.e. ?et out of debt, ?pecial offer).

Do you understand?

User avatar
vitoco
Veteran
Posts: 422
Joined: Wed Jul 09, 2003 9:22 pm
Location: Chile
Contact:

Post by vitoco » Fri Mar 05, 2004 5:36 am

Here is a useful Subject RegExp:

v\W?[1i]\W?[a4]\W?g\W?R\W?[a4]

Set Mark as Spam and it will catch any of the following:

VIAGRA
viagra
V14GR4
vi-agra
E n j o y - V i a g r a
v.i.a.g.r.a
V.i+A=g/r*a

If you want to catch 2 or less non-alphabetic chars between alphabetic viagra chars, just repeat each \W? inside the expresion.

RegExp are cool ;-)

Now, who's the volunteer to write a rule to catch "enlarge"? 8)

++Vitoco

User avatar
Petrocelli
Still here
Posts: 5
Joined: Thu Feb 19, 2004 9:13 am

Post by Petrocelli » Fri Mar 05, 2004 8:28 am

@homaquebec
Do you understand?
Yes, now I understand. Thank you.

Petro

drahnier

whitelist/blacklist in rules - how to?

Post by drahnier » Fri Mar 05, 2004 9:29 am

say i would like to have rules like

- "mark as spam if not in whitelist"
or
- "delete from server if sender is on blacklist"


how can this be accomplished?

_________
drahnier

User avatar
Renier
Site Admin
Posts: 1957
Joined: Mon Oct 15, 2001 12:54 pm
Location: Cape Town, South-Africa
Contact:

Re: whitelist/blacklist in rules - how to?

Post by Renier » Fri Mar 05, 2004 10:06 am

drahnier wrote:"mark as spam if not in whitelist"
Status Equals Protected (Not) => Mark as Spam
drahnier wrote:"delete from server if sender is on blacklist"
This is done automatically when you have the "Back List marks as Spam" option off.

User avatar
NO CARRIER
Fanatic
Posts: 82
Joined: Sat May 10, 2003 1:52 pm
Location: Bulgaria
Contact:

Post by NO CARRIER » Fri Mar 05, 2004 1:54 pm

Hey, what about this piece of sh*t?!

Code: Select all

Return-Path: <catalinabragg_mu@aol.com>
Delivered-To: koko@erpaz.bg
Received: (qmail 4103 invoked by uid 0); 5 Mar 2004 08:13:11 +0200
Received: from 65-100-187-56.dnvr.qwest.net (HELO aol.com) (65.100.187.56)
  by erpaz.bg with SMTP; 5 Mar 2004 08:13:10 +0200
Message-ID: <EIFNFNDNBMAKMOHAJKDNDHIOAAAB.catalinabragg_mu@aol.com>
From: "Catalina Bragg" <catalinabragg_mu@aol.com>
To: koko@erpaz.bg
Subject: Didn't you say that.....
Date: Fri, 05 Mar 2004 02:17:07 +0000
MIME-Version: 1.0
Content-Type: text/plain
Content-Transfer-Encoding: base64

QnV5IFZpYWdyYSBhbmQgQ2lhbGFzIEFrYSAiU3VwZXIgVmlhZ3JhIi4uVGhl
IFZpYWdyYSB0aGF0IGxhc3QgYWxsIHdlZWtlbmQhLi4gYW5kIG90aGVyIHBv
cHVsYXIgbWVkaWNhdGlvbnMuIE5leHQtRGF5IEZlZGV4DQouLi5oZXJlIGF0
IC4uIGh0dHA6Ly93d3cuY29tcGxldGVyeG9ubGluZS5jb20/cmlkPTEwMDAg
IA0KDQoNCmJpZ2dnZXIgYmVzdCBldmVyIHRoZW0gbWVkcyBzdHVmZiB1IHBy
b2R1Y3RzIHByb2R1Y3RzIHRoYXQgIA==
In the last few months the spammers get smarter and smarter. :( :roll:

Renier, any chance to include base64 decoding of messages?
Any ideas?
:(

Guest

Re: whitelist/blacklist in rules - how to?

Post by Guest » Fri Mar 05, 2004 2:06 pm

Renier wrote:
drahnier wrote:"mark as spam if not in whitelist"
Status Equals Protected (Not) => Mark as Spam
drahnier wrote:"delete from server if sender is on blacklist"
This is done automatically when you have the "Back List marks as Spam" option off.
thanks for your answer.

... and two bug reports:

(1)
I defined a first rule (using a single row) and saved it. then I added a second rule (using three rows). to my surprise this altered my first rule: the first rule apparently got overwritten by the second one.

(2)
Sometimes the rules display gets very garbled (rows appear of different length and the "not" field vanishes). I have to exit and restart PopTray to clear things up.

___________
drahnier!

User avatar
Renier
Site Admin
Posts: 1957
Joined: Mon Oct 15, 2001 12:54 pm
Location: Cape Town, South-Africa
Contact:

Post by Renier » Fri Mar 05, 2004 2:17 pm

vitoco wrote:Here is a useful Subject RegExp:

v\W?[1i]\W?[a4]\W?g\W?R\W?[a4]
Nice! Do you mind if I use this as an example in the help file?

User avatar
Renier
Site Admin
Posts: 1957
Joined: Mon Oct 15, 2001 12:54 pm
Location: Cape Town, South-Africa
Contact:

Post by Renier » Fri Mar 05, 2004 2:20 pm

NO CARRIER wrote:Renier, any chance to include base64 decoding of messages?
The problem is you would need a complete body to do reliable base64 decoding and performance of course.

I'm also not sure what a 100 RegExpr rules would do to performance.

Guest

Re: whitelist/blacklist in rules - how to?

Post by Guest » Fri Mar 05, 2004 4:43 pm

Renier wrote:
drahnier wrote:"mark as spam if not in whitelist"
Status Equals Protected (Not) => Mark as Spam
does not work.

User avatar
Renier
Site Admin
Posts: 1957
Joined: Mon Oct 15, 2001 12:54 pm
Location: Cape Town, South-Africa
Contact:

Post by Renier » Fri Mar 05, 2004 4:52 pm

For an explanation of the RegExpr syntax (and the library I use) you can have a look at this link: http://www.regexpstudio.com/TRegExpr/He ... yntax.html

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests