custom rule with pattern test of 0 (zero) not processed

This is a discussion on custom rule with pattern test of 0 (zero) not processed within the SpamAssassin forums, part of the Tools category; Hello all, I searched high and low but could not find anywhere that says the following rule patten is invalid or not allowed in SpamAssassin 3.2.5 on CentOS 5.1 However ...

Go Back   Unix Linux Forum > Technologies & Tools > Tools > SpamAssassin

FixUnix.com - Unix Linux Forums

Unix Content Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-25-2008, 04:18 PM
Default custom rule with pattern test of 0 (zero) not processed

Hello all,
I searched high and low but could not find anywhere that says the
following rule patten is invalid or not allowed in SpamAssassin 3.2.5 on
CentOS 5.1 However it works with non-zero numbers... Thoughts? and TIA

header LOCAL_TESTHEADER TESTHEADER =~ /^0$/
score LOCAL_TESTHEADER 1000



message:
TESTHEADER: 0
From:blah@example.com
To: blah1@example.com
Subject: This is a TESTHEADER: 0 test

blahblah blah

Reply With Quote
  #2  
Old 08-26-2008, 04:09 AM
Default Re: custom rule with pattern test of 0 (zero) not processed

dms dms wrote:
> Hello all,
> I searched high and low but could not find anywhere that says the
> following rule patten is invalid or not allowed in SpamAssassin 3.2.5 on
> CentOS 5.1 However it works with non-zero numbers... Thoughts? and TIA
>
> header LOCAL_TESTHEADER TESTHEADER =~ /^0$/
> score LOCAL_TESTHEADER 1000
>
>
>
> message:
> TESTHEADER: 0
> From:blah@example.com
> To: blah1@example.com
> Subject: This is a TESTHEADER: 0 test
>
> blahblah blah
>


looks like a bug to me. "0" is matched and returned, then the string "0"
is confused with 0=FALSE.


Using 1 instead of 0 works! also, using /0$/ and putting "foo0" in the
header.

Reply With Quote
  #3  
Old 08-26-2008, 06:39 AM
Default Re: custom rule with pattern test of 0 (zero) not processed

On Tuesday 26 August 2008 10:09:37 mouss wrote:
> dms dms wrote:
> > Hello all,
> > I searched high and low but could not find anywhere that says the
> > following rule patten is invalid or not allowed in SpamAssassin 3.2.5 on
> > CentOS 5.1 However it works with non-zero numbers... Thoughts? and TIA
> >
> > header LOCAL_TESTHEADER TESTHEADER =~ /^0$/
> > score LOCAL_TESTHEADER 1000
> >
> > message:
> > TESTHEADER: 0
> > From:blah@example.com
> > To: blah1@example.com
> > Subject: This is a TESTHEADER: 0 test
> >
> > blahblah blah

>
> looks like a bug to me. "0" is matched and returned, then the string "0"
> is confused with 0=FALSE.
>
> Using 1 instead of 0 works! also, using /0$/ and putting "foo0" in the
> header.


It is a bug, also present in the current CVS 3.3 trunk.

It is also a bug or the same nature that a message:

From:blah@example.com
To: blah1@example.com
Subject: 0

blahblah blah

hits a MISSING_SUBJECT rule.

Please open up a bug report.

Mark

Reply With Quote
  #4  
Old 08-26-2008, 10:04 AM
Default Re: custom rule with pattern test of 0 (zero) not processed

Thanks to all for confirming, a bug report has been opened.
https://issues.apache.org/SpamAssass...ug.cgi?id=5965

Reply With Quote
Reply

Thread Tools


All times are GMT -5. The time now is 12:32 PM.

In an effort to better serve ads to our visitors, cookies are used on Fixunix.com. For more information, check out our Privacy Policy.

Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Ad Management by RedTyger