SA Bugzilla – Bug 308
[PATCH] MSG_ID_ADDED_BY_MTA rewrite
Last modified: 2002-06-15 03:58:08 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
Created attachment 108 [details] the patch
Thanks, committed.