Bug 4652 - [review] __OIMO_MSGID header pattern is not correct
Summary: [review] __OIMO_MSGID header pattern is not correct
Status: RESOLVED FIXED
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: Rules (show other bugs)
Version: 3.0.0
Hardware: All All
: P3 normal
Target Milestone: 3.1.1
Assignee: Daryl C. W. O'Shea
URL:
Whiteboard: ready
Keywords: triage
Depends on:
Blocks:
 
Reported: 2005-10-29 05:08 UTC by Mark Noyes
Modified: 2006-01-24 17:10 UTC (History)
1 user (show)



Attachment Type Modified Status Actions Submitter/CLA Status
Sample email in mbx format that reproduces the problem text/plain None Bob Menschel [HasCLA]
3.1 patch patch None Daryl C. W. O'Shea [HasCLA]
3.1 patch patch None Daryl C. W. O'Shea [HasCLA]

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Noyes 2005-10-29 05:08:04 UTC
The rules file rules/20_ratware.cf contains a pattern
  header __OIMO_MSGID  MESSAGEID =~ /^[A-P]{26}A[AB]\.[-_\w]+\S+>$/m

The version of Outlook 2000 installed on my machine generates Message-id 
headers such as the following:
Message-id: <LOBBJIAKABGDMAEIEABEMEOJAPAC.mvnoyes@verizon.net>
The "[AB]" in the message id pattern needs to be "[ABC]" in order to match 
correctly.  As a result, email from my system frequently gets incorrectly 
categorized as spam.
Comment 1 Loren Wilton 2005-10-29 09:41:39 UTC
Hum.  Looks like it might be possible to optimize that pattern too.  The ending 
[stuff]+\S+ is a pattern that could easily have N different boundaries and all 
be valid.  Since the username probably doesn't start with - or _, maybe 
something like \w\S+ would be sufficient?  Or maybe just \S?
Comment 2 Bob Menschel 2005-10-30 17:46:40 UTC
Mark, You flag this as "all" hardware and O/s, but version 2.0 of SA? 

Can you please let us know which version of MS Outlook 2000 this is? 

Can you send an email to me at RMSA@Menschel.net, from that Outlook 2k system,
so I can attach a sample email with headers as an example we can test against? 

Thanks. 
Comment 3 Bob Menschel 2005-10-31 05:01:38 UTC
Received requested email.  SA version 3.0.x, Outlook version 9.0.0.2711. Will
attach the email
Comment 4 Bob Menschel 2005-10-31 06:04:08 UTC
Created attachment 3220 [details]
Sample email in mbx format that reproduces the problem
Comment 5 Daryl C. W. O'Shea 2005-11-18 02:49:26 UTC
I've tested some modifications to the rule (the originally posted rule was
mis-copied, BTW):

# original rule
header T_OIMO_MSGID_0   MESSAGEID =~ /^<[A-P]{26}A[AB]\.[-_\w.]+\@\S+>$/m

# original rule with what I assume was meant to be an escaped period
header T_OIMO_MSGID_1   MESSAGEID =~ /^<[A-P]{26}A[AB]\.[-\w\.]+\@\S+>$/m

# modified rule without escaped period
header T_OIMO_MSGID_2   MESSAGEID =~ /^<[A-P]{26}A[ABC]\.[-\w.]+\@\S+>$/m

# modified rule with escaped period
header T_OIMO_MSGID_3   MESSAGEID =~ /^<[A-P]{26}A[ABC]\.[-\w\.]+\@\S+>$/m


Mass-check results:
http://buildbot.spamassassin.org/ruleqa/ruleqa?s_defcorpus=on&daterev=20051117-r345134-n&rule=%2F%5ET_OIMO&s_zero=on&s_detail=checked+&g=Change

T_OIMO_MSGID_3 has a better S/O, hitting lots more ham with a negligible
increase in spam hits.
Comment 6 Daryl C. W. O'Shea 2005-11-18 03:13:42 UTC
Created attachment 3257 [details]
3.1 patch

trunk r345404
Comment 7 Justin Mason 2005-11-18 06:56:16 UTC
+1
Comment 8 Daryl C. W. O'Shea 2005-11-24 02:49:58 UTC
Created attachment 3272 [details]
3.1 patch

duh! dots aren't character class metacharacters

This patch removes the extraneous backslash.  It doesn't affect mass-check
results.

trunk r348610
Comment 9 Justin Mason 2005-12-13 20:24:09 UTC
+1
Comment 10 Duncan Findlay 2006-01-25 02:01:30 UTC
+1
Comment 11 Daryl C. W. O'Shea 2006-01-25 02:10:00 UTC
Thanks Duncan!

Sending        rules/20_ratware.cf
Transmitting file data .
Committed revision 372069.