You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Penghui Wang <wa...@bizcn.com> on 2008/03/04 10:56:29 UTC

meta rules doesn't work on some special version.

Hello, list,

I have tested three versions of SA. And found some special results.

SA 3.0.5 (RPM from DAG)
SA 3.1.7 (Debian Apt & RPM from DAG)
SA 3.2.4 (RPM from DAG)

In the default rule 20_head_test.cf

There are several lines like the follow

header __HAS_SUBJECT            exists:Subject
meta MISSING_SUBJECT            !__HAS_SUBJECT
describe MISSING_SUBJECT        Missing Subject: header

In the VERSION 3.0.5 and 3.2.4, i found whether or not the mail have a 
"Subject" in the header part, the MISSING_SUBJECT rules has been hitted.
But in the last version 3.1.7, it works great.

And the same condition with other similar rules, such as __HAS_REVD, 
__HAS_RECEIVED etc..

I have diged this for about one day. But  there's no result. Does anyone 
meet the same problem? Please drop me a message.\

Thanks in advances.

Penghui Wang



Re: meta rules doesn't work on some special version.

Posted by Matus UHLAR - fantomas <uh...@fantomas.sk>.
On 04.03.08 17:56, Penghui Wang wrote:
> There are several lines like the follow
> 
> header __HAS_SUBJECT            exists:Subject
> meta MISSING_SUBJECT            !__HAS_SUBJECT
> describe MISSING_SUBJECT        Missing Subject: header
> 
> In the VERSION 3.0.5 and 3.2.4, i found whether or not the mail have a 
> "Subject" in the header part, the MISSING_SUBJECT rules has been hitted.
> But in the last version 3.1.7, it works great.
> 
> And the same condition with other similar rules, such as __HAS_REVD, 
> __HAS_RECEIVED etc..
> 
> I have diged this for about one day. But  there's no result. Does anyone 
> meet the same problem? Please drop me a message.\

afaik those headers have to be non-empty, e.g. empty Subject: header matches
the MISSING_SUBJECT too.

-- 
Matus UHLAR - fantomas, uhlar@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
"They say when you play that M$ CD backward you can hear satanic messages."
"That's nothing. If you play it forward it will install Windows."

Re: meta rules doesn't work on some special version.

Posted by Matt Kettler <mk...@verizon.net>.
Penghui Wang wrote:
>
>>  
> I have tested via the sendmail command:
>
> #sendmail wangph < none-subject
> #sendmail wangph < have-subject
>
> #cat none-subject
> This is the message body.
>
> #cat have-subject
> Subject: This is the message subject
>
> This is the message body.
>
> Both of them marked with MISSING_SUBJECT.
>
> So, that's not the condition you have mentained. But thanks any way.
>

What happens if you leave sendmail out, and feed them directly to 
spamassassin?

spamassassin -t < none-subject

spamassassin -t < have-subject


I'm suspect sendmail choked on the absurdly bad input and decided that 
your subject was really body text, and inserted a blank line before it 
and after the headers it added to fix the broken message...








RE: meta rules doesn't work on some special version.

Posted by Robert - elists <li...@abbacomm.net>.
> 
> Thanks very much for your kindly help. I have done some testing this
> morning.
> 
> And found that, all the SA 3.2.x versions are unworkable.
> 
> Here are some output:
> 
> #spamassassin -V
> 
> SpamAssassin version 3.2.4
>   running on Perl version 5.8.5
> 
> The OS is CentOS 4.4 with perl version is 5.8.5.
> 

Penghui

This is all FYI and may or may not take care of your issues.

CentOS is currently version 4.6

Perl 5.8.8 can be upgraded to out of the centosplus repo

It makes a difference.

There are a zillion little perl modules that need to be attended to as well.
Possibly one of those can be an issue as well.

If the machine is production, plan accordingly.

If not, then I would upgrade a special way to avoid conflict.

 - rh


Re: meta rules doesn't work on some special version.

Posted by Penghui Wang <wa...@bizcn.com>.
Hello, Matt,

Thanks very much for your kindly help. I have done some testing this 
morning.

And found that, all the SA 3.2.x versions are unworkable.

Here are some output:

#spamassassin -V

SpamAssassin version 3.2.4
  running on Perl version 5.8.5

The OS is CentOS 4.4 with perl version is 5.8.5.

I have test the follow versions comming from 
http://dag.wieers.com/rpm/packages/spamassassin/

spamassassin-3.1.7-1.el4.rf.i386.rpm
spamassassin-3.1.8-1.el4.rf.i386.rpm <spamassassin-3.1.7-1.el4.rf.i386.rpm>
spamassassin-3.2.0-1.el4.rf.i386.rpm <spamassassin-3.1.7-1.el4.rf.i386.rpm>
spamassassin-3.2.1-1.el4.rf.i386.rpm <spamassassin-3.1.7-1.el4.rf.i386.rpm>
spamassassin-3.2.2-1.el4.rf.i386.rpm <spamassassin-3.1.7-1.el4.rf.i386.rpm>
spamassassin-3.2.3-1.el4.rf.i386.rpm <spamassassin-3.1.7-1.el4.rf.i386.rpm>
spamassassin-3.2.4-1.el4.rf.i386.rpm <spamassassin-3.1.7-1.el4.rf.i386.rpm>

All the 3.1.x versions are working great:

[root@localhost ~]# spamassassin -t < /var/mail/have-subject
X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on
        localhost.localdomain
X-Spam-Level: **
X-Spam-Status: No, score=2.1 required=5.0 tests=MISSING_HEADERS,NO_RECEIVED,
        NO_RELAYS,SUB_HELLO,TO_CC_NONE autolearn=no version=3.1.7
Subject: Hello

Hello
Spam detection software, running on the system "localhost.localdomain", has
identified this incoming email as possible spam.  The original message
has been attached to this so you can view it (if it isn't spam) or label
similar future email.  If you have any questions, see
the administrator of that system for details.

Content preview:  Hello [...]

Content analysis details:   (2.1 points, 5.0 required)

 pts rule name              description
---- ---------------------- 
--------------------------------------------------
 1.8 SUB_HELLO              Subject starts with "Hello"
-0.0 NO_RELAYS              Informational: message was not relayed via SMTP
 0.2 MISSING_HEADERS        Missing To: header
-0.0 NO_RECEIVED            Informational: message has no Received headers
 0.1 TO_CC_NONE             No To: or Cc: header

[root@localhost ~]# spamassassin -t < /var/mail/none-subject
Received: from localhost by localhost.localdomain
        with SpamAssassin (version 3.1.7);
        Wed, 05 Mar 2008 11:23:41 +0800
X-Spam-Flag: YES
X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on
        localhost.localdomain
X-Spam-Level: *****
X-Spam-Status: Yes, score=5.7 required=5.0 
tests=EMPTY_MESSAGE,MISSING_HB_SEP,
        MISSING_HEADERS,MISSING_SUBJECT,NO_RECEIVED,NO_RELAYS,TO_CC_NONE
        autolearn=no version=3.1.7
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="----------=_47CE123D.F36CA2C8"

This is a multi-part message in MIME format.

------------=_47CE123D.F36CA2C8
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: 8bit

Spam detection software, running on the system "localhost.localdomain", has
identified this incoming email as possible spam.  The original message
has been attached to this so you can view it (if it isn't spam) or label
similar future email.  If you have any questions, see
the administrator of that system for details.

Content preview:  [...]

Content analysis details:   (5.7 points, 5.0 required)

 pts rule name              description
---- ---------------------- 
--------------------------------------------------
-0.0 NO_RELAYS              Informational: message was not relayed via SMTP
 2.5 MISSING_HB_SEP         Missing blank line between message header 
and body
 0.2 MISSING_HEADERS        Missing To: header
 1.3 MISSING_SUBJECT        Missing Subject: header
 1.5 EMPTY_MESSAGE          Message appears to have no textual parts and no
                            Subject: text
-0.0 NO_RECEIVED            Informational: message has no Received headers
 0.1 TO_CC_NONE             No To: or Cc: header



------------=_47CE123D.F36CA2C8
Content-Type: message/rfc822; x-spam-type=original
Content-Description: original message before SpamAssassin
Content-Disposition: inline
Content-Transfer-Encoding: 8bit

Hello

------------=_47CE123D.F36CA2C8--

Spam detection software, running on the system "localhost.localdomain", has
identified this incoming email as possible spam.  The original message
has been attached to this so you can view it (if it isn't spam) or label
similar future email.  If you have any questions, see
the administrator of that system for details.

Content preview:  [...]

Content analysis details:   (5.7 points, 5.0 required)

 pts rule name              description
---- ---------------------- 
--------------------------------------------------
-0.0 NO_RELAYS              Informational: message was not relayed via SMTP
 2.5 MISSING_HB_SEP         Missing blank line between message header 
and body
 0.2 MISSING_HEADERS        Missing To: header
 1.3 MISSING_SUBJECT        Missing Subject: header
 1.5 EMPTY_MESSAGE          Message appears to have no textual parts and no
                            Subject: text
-0.0 NO_RECEIVED            Informational: message has no Received headers
 0.1 TO_CC_NONE             No To: or Cc: header


If i use SA 3.2.4.

Here are the output:

[root@localhost ~]# spamassassin -t < /var/mail/none-subject      
[10310] warn: Possible unintended interpolation of @Mail in string at 
/usr/share/spamassassin/00_jp_mailer-tests.cf, rule X_MAILER_SPAM, line 1.
[10310] warn: rules: failed to compile head tests, skipping:
[10310] warn:  (Global symbol "@Mail" requires explicit package name at 
/usr/share/spamassassin/00_jp_mailer-tests.cf, rule X_MAILER_SPAM, line 1.
[10310] warn: )
Received: from localhost by localhost.localdomain
        with SpamAssassin (version 3.2.4);
        Wed, 05 Mar 2008 11:27:13 +0800
X-Spam-Flag: YES
X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on
        localhost.localdomain
X-Spam-Level: ********
X-Spam-Status: Yes, score=8.9 required=5.0 
tests=EMPTY_MESSAGE,MISSING_HB_SEP,
        
MISSING_HEADERS,MISSING_SUBJECT,NO_RECEIVED,NO_RELAYS,TVD_SPACE_RATIO
        autolearn=no version=3.2.4
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="----------=_47CE1311.DAE65D76"

This is a multi-part message in MIME format.

------------=_47CE1311.DAE65D76
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit

Spam detection software, running on the system "localhost.localdomain", has
identified this incoming email as possible spam.  The original message
has been attached to this so you can view it (if it isn't spam) or label
similar future email.  If you have any questions, see
the administrator of that system for details.

Content preview:  [...]

Content analysis details:   (8.9 points, 5.0 required)

 pts rule name              description
---- ---------------------- 
--------------------------------------------------
-0.0 NO_RELAYS              Informational: message was not relayed via SMTP
 2.5 MISSING_HB_SEP         Missing blank line between message header 
and body
 1.6 MISSING_HEADERS        Missing To: header
 2.9 TVD_SPACE_RATIO        BODY: TVD_SPACE_RATIO
 1.3 MISSING_SUBJECT        Missing Subject: header
 0.6 EMPTY_MESSAGE          Message appears to have no textual parts and no
                            Subject: text
-0.0 NO_RECEIVED            Informational: message has no Received headers



------------=_47CE1311.DAE65D76
Content-Type: message/rfc822; x-spam-type=original
Content-Description: original message before SpamAssassin
Content-Disposition: inline
Content-Transfer-Encoding: 8bit

Hello

------------=_47CE1311.DAE65D76--

Spam detection software, running on the system "localhost.localdomain", has
identified this incoming email as possible spam.  The original message
has been attached to this so you can view it (if it isn't spam) or label
similar future email.  If you have any questions, see
the administrator of that system for details.

Content preview:  [...]

Content analysis details:   (8.9 points, 5.0 required)

 pts rule name              description
---- ---------------------- 
--------------------------------------------------
-0.0 NO_RELAYS              Informational: message was not relayed via SMTP
 2.5 MISSING_HB_SEP         Missing blank line between message header 
and body
 1.6 MISSING_HEADERS        Missing To: header
 2.9 TVD_SPACE_RATIO        BODY: TVD_SPACE_RATIO
 1.3 MISSING_SUBJECT        Missing Subject: header
 0.6 EMPTY_MESSAGE          Message appears to have no textual parts and no
                            Subject: text
-0.0 NO_RECEIVED            Informational: message has no Received headers


[root@localhost ~]# spamassassin -t < /var/mail/have-subject          
[10316] warn: Possible unintended interpolation of @Mail in string at 
/usr/share/spamassassin/00_jp_mailer-tests.cf, rule X_MAILER_SPAM, line 1.
[10316] warn: rules: failed to compile head tests, skipping:
[10316] warn:  (Global symbol "@Mail" requires explicit package name at 
/usr/share/spamassassin/00_jp_mailer-tests.cf, rule X_MAILER_SPAM, line 1.
[10316] warn: )
X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on
        localhost.localdomain
X-Spam-Level: **
X-Spam-Status: No, score=2.9 required=5.0 tests=MISSING_HEADERS,
        MISSING_SUBJECT,NO_RECEIVED,NO_RELAYS autolearn=no version=3.2.4
Subject: Hello

Hello
Spam detection software, running on the system "localhost.localdomain", has
identified this incoming email as possible spam.  The original message
has been attached to this so you can view it (if it isn't spam) or label
similar future email.  If you have any questions, see
the administrator of that system for details.

Content preview:  Hello [...]

Content analysis details:   (2.9 points, 5.0 required)

 pts rule name              description
---- ---------------------- 
--------------------------------------------------
-0.0 NO_RELAYS              Informational: message was not relayed via SMTP
 1.6 MISSING_HEADERS        Missing To: header
 1.3 MISSING_SUBJECT        Missing Subject: header
-0.0 NO_RECEIVED            Informational: message has no Received headers

Whether or not has Subject in the header, it always hit the rule 
"MISSING SUBJECT".


Do you have any suggestion?

Thanks in advanced

Penghui Wang

>>>
>>> I have tested via the sendmail command:
>>>
>>> #sendmail wangph < none-subject
>>> #sendmail wangph < have-subject
>>>
>>> #cat none-subject
>>> This is the message body.
>>>
>>> #cat have-subject
>>> Subject: This is the message subject
>>>
>>> This is the message body.
>>>
>>> Both of them marked with MISSING_SUBJECT.
>>>
>>> So, that's not the condition you have mentained. But thanks any way.
>>>
>>> Best regards,
>>>
>>> Penghui Wang.
>>>
>>>
>>>       
>>     
>
>   


Re: meta rules doesn't work on some special version.

Posted by Penghui Wang <wa...@bizcn.com>.
Matt Kettler wrote:
> Penghui Wang wrote:
>   
>> Hello, list,
>>
>> I have tested three versions of SA. And found some special results.
>>
>> SA 3.0.5 (RPM from DAG)
>> SA 3.1.7 (Debian Apt & RPM from DAG)
>> SA 3.2.4 (RPM from DAG)
>>
>> In the default rule 20_head_test.cf
>>
>> There are several lines like the follow
>>
>> header __HAS_SUBJECT            exists:Subject
>> meta MISSING_SUBJECT            !__HAS_SUBJECT
>> describe MISSING_SUBJECT        Missing Subject: header
>>
>> In the VERSION 3.0.5 and 3.2.4, i found whether or not the mail have a
>> "Subject" in the header part, the MISSING_SUBJECT rules has been hitted.
>> But in the last version 3.1.7, it works great.
>>
>> And the same condition with other similar rules, such as __HAS_REVD,
>> __HAS_RECEIVED etc..
>>
>> I have diged this for about one day. But  there's no result. Does
>> anyone meet the same problem? Please drop me a message.\
>>     
> It should work fine in any version that supports metas. (ie: anything
> newer than 2.5x)
>
> However, be aware it will only match a message with NO Subject: header.
> It will NOT fire off for a message with an empty subject. There must be
> no Subject: at all for the rule to work.
>
>
>
>
>   
I have tested via the sendmail command:

#sendmail wangph < none-subject
#sendmail wangph < have-subject

#cat none-subject
This is the message body.

#cat have-subject
Subject: This is the message subject

This is the message body.

Both of them marked with MISSING_SUBJECT.

So, that's not the condition you have mentained. But thanks any way.

Best regards,

Penghui Wang.


Re: meta rules doesn't work on some special version.

Posted by Matt Kettler <mk...@verizon.net>.
Penghui Wang wrote:
> Hello, list,
>
> I have tested three versions of SA. And found some special results.
>
> SA 3.0.5 (RPM from DAG)
> SA 3.1.7 (Debian Apt & RPM from DAG)
> SA 3.2.4 (RPM from DAG)
>
> In the default rule 20_head_test.cf
>
> There are several lines like the follow
>
> header __HAS_SUBJECT            exists:Subject
> meta MISSING_SUBJECT            !__HAS_SUBJECT
> describe MISSING_SUBJECT        Missing Subject: header
>
> In the VERSION 3.0.5 and 3.2.4, i found whether or not the mail have a 
> "Subject" in the header part, the MISSING_SUBJECT rules has been hitted.
> But in the last version 3.1.7, it works great.
>
> And the same condition with other similar rules, such as __HAS_REVD, 
> __HAS_RECEIVED etc..
>
> I have diged this for about one day. But  there's no result. Does 
> anyone meet the same problem? Please drop me a message.\
It should work fine in any version that supports metas. (ie: anything 
newer than 2.5x)

However, be aware it will only match a message with NO Subject: header. 
It will NOT fire off for a message with an empty subject. There must be 
no Subject: at all for the rule to work.