PopMan Website PopMan Forum Index
PopMan Forum Index PopMan
PopMan Forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

HowTo: Rules

 
Post new topic   Reply to topic    PopMan Forum Index -> General
View previous topic :: View next topic  
Author Message
Christian
Site Admin


Joined: 11 Jan 2004
Posts: 266
Location: Magdeburg, Germany

PostPosted: Sat Apr 22, 2006 3:44 am    Post subject: HowTo: Rules Reply with quote

This HowTo describes how to set up the rules file.

The rules file (Menu: Tools > Rules...) can have as many rules as you want. Rules are separarted by a blank line.

A rule has a very simple structure as you can see in the following example:

Subject contains "Spam" -> MarkForDelete

The first part describes where the rule is searching. It can be the name of any header entry, e.g. Subject, From, To, CC, ... or it's one of the following values:

Mail - The raw source of the entire mail.
Header - The raw header of the mail source.
Message - The extracted message body text shown in the preview pane and message window.

The second part defines how to search. Possible values:

contains - The text must be found anywhere in the where part.
equals - The text must be identical to the where part.
begins with - The text must be found at the beginning of the where part.
ends with - The text must be found at the end of the where part.

The third part defines what to search for. It can be a simple string or a set of strings:

Message contains "str1" -> MarkForDelete
Message contains any of {"str1", "str2", "str3"} -> MarkForDelete
Message contains all of {"str1", "str2", "str3"} -> MarkForDelete
Message contains none of {"str1", "str2", "str3"} -> MarkForDelete


The last part describes the actions that have to be taken:

Read - Mark message as read.
NotNew - Message is not considered "new" (no notification).
MarkForDelete - The message is marked for delete.
Open("file") - Open the specified file, e.g. a program or document, if message is new.
Open("file", "params") - Open the specified file with the given command line parameters, if message is new.
PlaySound("filename.wav") - Play the specified sound file, if the message is new. A certain sound file will only be played once per check.
PlaySingleSound("filename.wav") - Play the specified sound file, if the message is new and no other sound has been played during the current check.
Delete - Delete message from server. Use with care!

Note, that you can assign several actions to one rule:

Mail contains "Spam" -> Read, NotNew, MarkForDelete

You can logically combine several rules with And and Or:

Subject contains "PopMan" And From contains "Christian" -> PlaySound(..)

You can also negate a rule with not:

From not contains "Christian" -> NotNew

When you have finished the modification of the rule file, save it and PopMan will reload it on the next email check.


New features since PopMan 1.3 Beta 14:

- Test for emptyness

Subject is empty -> MarkForDelete

- Search for words instead of arbitrary strings with single quotes, e.g.

Message contains 'Huebner' -> ... will not apply if the message contains just the string chuebner@mail.com

- Search for regular expressions by prepending "regex:" to a string, e.g.

Message contains regex:"[Pp]+.?[Ii1]+.?[Ll1]+.?[lL1]+.?[sS\$]" -> ...

- Add attributes to a rule to specify the name or the relevant accounts:

[Name="Spam", Account="MyAccountName"]
Subject contains "bad word" -> ...


[Name="Spam", Account={"Account1", "Account2", "Account3"}]
Subject contains "bad word" -> ...


- Define strings and lists of strings that can be referenced by name, e.g.:

Message contains any of BADWORDS -> MarkForDelete, NotNew, Read

define list BADWORDS = {
"BadWord1",
"BadWord2",
Pills_RegEx }

define string Pills_RegEx = regex:"[Pp]+.?[Ii1]+.?[Ll1]+.?[lL1]+.?[sS\$]"


- Specify several "where parts" for one condition:

Subject or Message or From contains any of BADWORDS -> ...
Subject and Message and From contains none of GOODWORDS -> ...
Subject+Message+From contains any of BADWORDS -> ...

Think of the + to join (concatenate) strings, although it may be evaluated like OR or AND for efficiency, e.g.:
Subject+Message contains any of is evaluated like Subject or Message contains any of
Subject+Message contains none of is evaluated like Subject and Message contains none of
Subject+Message contains all of must be evaluated using string concatenation because there is no other logical equivalent

So you see it is simpler to just use + and not to bother with all the confusing ANDs and ORs! Wink

When editing the rules file it is helpful to have some kind of syntax highlighting, therefore I've created a user defined syntax file for the famous Notepad++ editor.
_________________
Christian Hübner


Last edited by Christian on Tue Oct 16, 2007 2:43 pm; edited 3 times in total
Back to top
View user's profile Send private message Send e-mail
Tommy



Joined: 16 Oct 2005
Posts: 64

PostPosted: Sun Jun 25, 2006 6:16 am    Post subject: Reply with quote

hi Christian.

how do i create a rule to delete mail which contains a defined spam word either in the title or the message?
Back to top
View user's profile Send private message
Christian
Site Admin


Joined: 11 Jan 2004
Posts: 266
Location: Magdeburg, Germany

PostPosted: Sun Jun 25, 2006 8:23 am    Post subject: Reply with quote

You can use this rule:

Subject contains "YourSpamWord" OR
Message contains "YourSpamWord"
-> Read, NotNew, MarkForDelete


If you really want to delete immediatelly, use Delete after the arrow.
_________________
Christian Hübner
Back to top
View user's profile Send private message Send e-mail
Tommy



Joined: 16 Oct 2005
Posts: 64

PostPosted: Mon Jun 26, 2006 4:02 am    Post subject: Reply with quote

ok, but i'd like to write the SpamWord only one time.
with your rule i have to digit it twice.

is it possible ot have a rule like this:

Subject OR Message contains "YourSpamWord" -> MarkForDeleteù
Back to top
View user's profile Send private message
Christian
Site Admin


Joined: 11 Jan 2004
Posts: 266
Location: Magdeburg, Germany

PostPosted: Thu Jun 29, 2006 1:32 am    Post subject: Reply with quote

No, this is not possible. You will have to repeat the word...
_________________
Christian Hübner
Back to top
View user's profile Send private message Send e-mail
Tommy



Joined: 16 Oct 2005
Posts: 64

PostPosted: Thu Jun 29, 2006 2:35 am    Post subject: Reply with quote

Sad
Back to top
View user's profile Send private message
tengvilla



Joined: 11 Jun 2004
Posts: 57
Location: san francisco, california [usa]

PostPosted: Sat Mar 31, 2007 3:13 am    Post subject: HowTo: Rules Reply with quote

Hi Christian,

Got question? How can I use or add the special character one quote " in rules?

i.e. in your example
Subject contains "YourSpamWord" OR Message contains "YourSpamWord"

my example
Subject contains "YourSp"amWord" OR Message contains "YourSp"amWord"

Is this possible? Or special character one quote " can not be overridden.
Smile
Back to top
View user's profile Send private message
Christian
Site Admin


Joined: 11 Jan 2004
Posts: 266
Location: Magdeburg, Germany

PostPosted: Sat Mar 31, 2007 12:13 pm    Post subject: Reply with quote

You have to mask the " character by preceding a ~ character, like this:

Subject contains "YourSp~"amWord" OR Message contains "YourSp~"amWord"

This also implies that you have to write ~~ if you really mean one ~ character.
_________________
Christian Hübner
Back to top
View user's profile Send private message Send e-mail
tengvilla



Joined: 11 Jun 2004
Posts: 57
Location: san francisco, california [usa]

PostPosted: Sat Mar 31, 2007 6:29 pm    Post subject: HowTo: Rules Reply with quote

Thanks Christian!!! Learnt something new again.

Question:

Except for tilde ~
AND
double quote "

what other special characters used by rules need to be mask?
Back to top
View user's profile Send private message
Christian
Site Admin


Joined: 11 Jan 2004
Posts: 266
Location: Magdeburg, Germany

PostPosted: Sat Mar 31, 2007 7:36 pm    Post subject: Reply with quote

I think that all.
_________________
Christian Hübner
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    PopMan Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group