antispamsniper.com Forum Index antispamsniper.com
The reliable anti-spam protection
 
 FAQFAQ   SearchSearch     ProfileProfile   Log inLog in   RegisterRegister 

Regular expression in black rule doesn't work

 
Post new topic   Reply to topic    antispamsniper.com Forum Index -> AntispamSniper for TheBat!
View previous topic :: View next topic  
Author Message
rc-flitzer



Joined: 02 Jan 2007
Posts: 3

PostPosted: Tue Jan 02, 2007 3:51 pm    Post subject: Regular expression in black rule doesn't work Reply with quote

Hello!
First of all I like to say "Fine tool!" because AntispamSniper is very good and it filters almost every mail correctly. Smile But I have a problem concerning the black rules list. I added an own black rule but it isn't working and I can't find the error. Sad

There is a server-based spam filter for one of my e-mail adresses which labels every mail with some items in mail header. If a mail is recognized as spam, there will be something like the following content in mail header:
Code:
X-Spam-Flag: YES
X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on
        mailhost.xxx.de
X-Spam-Level: *************
X-Spam-Status: Yes, score=13.7 required=5.0 tests= [...]

If the mail's not spam, the last line will be starting with "X-Spam-Status: No, score=".

So my rule set is just containing a single rule: "Header{X-Spam-Status} =~ (?:yes)". But it's not working. AntispamSniper does not use this rule. Does someone know why? It's a very simple regular expression according to AntispamSniper input patterns.


Another additional question: it would be better to check the beginning of a header element (in this case: "^yes"), but the header line is starting with "X-Spam-Status: ". So I don't know how the "^" character is validated: either beginnig of a header element's content or the whole header element line. Question
Back to top
View user's profile Send private message
vetaltm
Author


Joined: 05 Feb 2006
Posts: 748

PostPosted: Tue Jan 02, 2007 4:52 pm    Post subject: Re: Regular expression in black rule doesn't work Reply with quote

rc-flitzer wrote:

There is a server-based spam filter for one of my e-mail adresses which labels every mail with some items in mail header. If a mail is recognized as spam, there will be something like the following content in mail header:
Code:
X-Spam-Flag: YES
X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on
        mailhost.xxx.de
X-Spam-Level: *************
X-Spam-Status: Yes, score=13.7 required=5.0 tests= [...]

If the mail's not spam, the last line will be starting with "X-Spam-Status: No, score=".

So my rule set is just containing a single rule: "Header{X-Spam-Status} =~ (?:yes)". But it's not working. AntispamSniper does not use this rule. Does someone know why? It's a very simple regular expression according to AntispamSniper input patterns.

The regular expression is correct. There was a bug with the conditions applied to custom headers (the plug-in was unable to match the content of custom headers having upper-case letters). Please update to the latest build:
http://dl.antispamsniper.com/download/1.8/sniper-mui-1.8b5.exe - commercial version
http://dl.antispamsniper.com/download/1.8/sniper-mui-free-1.8b5.exe - free version

Version 1.8.x allows restoring the messages deleted from server by headers. Thereby you can avoid a false positive, even if SpamAssassin will suddenly made it.

rc-flitzer wrote:

Another additional question: it would be better to check the beginning of a header element (in this case: "^yes"), but the header line is starting with "X-Spam-Status: ". So I don't know how the "^" character is validated: either beginnig of a header element's content or the whole header element line. Question

The conditions are applied to the content of header elements, not to the whole headers. So indeed you can use in expressions "^", "$" etc. for better performance.

Thank you for finding such an old and dirty bug! Smile
Back to top
View user's profile Send private message Send e-mail
rc-flitzer



Joined: 02 Jan 2007
Posts: 3

PostPosted: Tue Jan 02, 2007 6:23 pm    Post subject: Reply with quote

Thank you for the quick and helpful answer. Smile I installed version 1.8b5 of AntispamSniper, hoping the rules will work from now on. I'll report here whether it's successful or not.

A question to case-sensitiveness: does it matter using uppercase letters? In Perl regexp there's an option for switching between case-sensitive and not. How it's handled in AntispamSniper?
Back to top
View user's profile Send private message
vetaltm
Author


Joined: 05 Feb 2006
Posts: 748

PostPosted: Tue Jan 02, 2007 6:46 pm    Post subject: Reply with quote

rc-flitzer wrote:

A question to case-sensitiveness: does it matter using uppercase letters? In Perl regexp there's an option for switching between case-sensitive and not. How it's handled in AntispamSniper?

The matching is always case-insensitive for the rule conditions. It means that you can use the letters of any case in regular expressions (excepting the special regexp metacharacters, defined as quoted commands like \s, \S etc.).
Back to top
View user's profile Send private message Send e-mail
rc-flitzer



Joined: 02 Jan 2007
Posts: 3

PostPosted: Thu Jan 04, 2007 5:21 pm    Post subject: Reply with quote

The new version 1.8b5 is running quite well. The bug is solved, filter rules using custom header fields are working just fine. Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    antispamsniper.com Forum Index -> AntispamSniper for TheBat! 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