Bug 308 - [PATCH] MSG_ID_ADDED_BY_MTA rewrite
Summary: [PATCH] MSG_ID_ADDED_BY_MTA rewrite
Status: RESOLVED FIXED
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: Rules (show other bugs)
Version: 2.30CVS
Hardware: Other Linux
: P2 normal
Target Milestone: ---
Assignee: SpamAssassin Developer Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-05-12 21:18 UTC by Daniel Quinlan
Modified: 2002-06-15 03:58 UTC (History)
0 users



Attachment Type Modified Status Actions Submitter/CLA Status
the patch patch None Daniel Quinlan [HasCLA]

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Quinlan 2002-05-12 21:18:26 UTC
The MSG_ID_ADDED_BY_MTA_2 test is a pretty good test.  Unfortunately, it misses
a significant number of spam messages with a Message-ID added by the first MTA
to receive the message because most MTAs apparently add the Message-ID below
their Received: line, not above it.

This patch adds a rule to match those messages and fixes some problems with
the original rule to improve its accuracy and hit rate.

The new rule is a bit more complicated (see the patch for the full explanation),
but I have tried to make it as fast as possible.  Both tests are combined in a
single function, but the primary function is evaluated only once per message
and large parts of it don't need to be run if the "revised original" test is
true or if other criteria are not met.

As part of the rewrite, the original test was fixed in the following ways:

  - allow for the "id" part of Message-ID to vary in capitalization
  - fix the yahoo exemption (the perlre zero-width negative look-ahead assertion
    does not work that way, it only appeared to work because the Message-ID
    capitalization did not match, so it could have easily broken)
  - removed some unnecessary whitespace

Testing: my usual corpus of 1789 messages.

rule                                       matched  spam
MSG_ID_ADDED_BY_MTA_2 (original)                50    50
MSG_ID_ADDED_BY_MTA_2 (revised)                 51    51
MSG_ID_ADDED_BY_MTA_3 (new rule)                71    65
2+3 combined                                   122   116
Comment 1 Daniel Quinlan 2002-05-12 21:26:57 UTC
Created attachment 108 [details]
the patch
Comment 2 Craig Hughes 2002-05-13 07:42:25 UTC
Thanks, committed.