You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Steve Bondy <sb...@rafte.com> on 2005/01/05 18:26:22 UTC
Using Message ID in a rule
They say that if you don't know something, there's no such thing as a
stupid question.... so here goes:
Is it safe to write a rule that triggers on the content of the Message
ID header?
I frequently see things coming in which have message IDs that include
the domain name of the target mail system, rather than the source mail
system. If I remember correctly, the message ID should always be the
source....
Steve
Re: Using Message ID in a rule
Posted by Michael Barnes <mb...@compsci.wm.edu>.
On Wed, Jan 05, 2005 at 11:26:22AM -0600, Steve Bondy wrote:
> Is it safe to write a rule that triggers on the content of the Message
> ID header?
The 70_sare_header.cf found here:
http://www.rulesemporium.com/rules/70_sare_header.cf
has a number of message ID rules that work pretty well. A custom rule
that I wrote does well for me as well:
header WIERD_MSGID Message-ID =~ /<[A-Z]{15,40}@/
describe WIERD_MSGID Spamlooking Message-ID <CA...@randomdomain.com>
score WIERD_MSGID 0.5
Mike
--
/-----------------------------------------\
| Michael Barnes <mb...@compsci.wm.edu> |
| UNIX Systems Administrator |
| College of William and Mary |
| Phone: (757) 879-3930 |
\-----------------------------------------/
Re: Using Message ID in a rule
Posted by jdow <jd...@earthlink.net>.
Unfortunately it is not. People on mailing lists will see message IDs
that come from themselves. Therefore a rule that searches for message
IDs from their own domain would logically end up throwing incorrectly
high scores on their own messages from the mailing list. If that is
not bad enough coworkers who posted would also get improperly high
spam scores.
No, it's not a good idea.
{^_^} Joanne
----- Original Message -----
From: "Steve Bondy" <sb...@rafte.com>
They say that if you don't know something, there's no such thing as a
stupid question.... so here goes:
Is it safe to write a rule that triggers on the content of the Message
ID header?
I frequently see things coming in which have message IDs that include
the domain name of the target mail system, rather than the source mail
system. If I remember correctly, the message ID should always be the
source....
Steve
Re[2]: Using Message ID in a rule
Posted by Robert Menschel <Ro...@Menschel.net>.
Hello Steve, Matt,
Wednesday, January 5, 2005, 10:27:32 AM, you wrote:
MK> At 12:26 PM 1/5/2005, Steve Bondy wrote:
>>Is it safe to write a rule that triggers on the content of the Message
>>ID header?
MK> Yes...
Agreed.
>>I frequently see things coming in which have message IDs that
>>include the domain name of the target mail system, rather than the
>>source mail system. If I remember correctly, the message ID should
>>always be the source....
Also agreed with all the others -- this simple a rule does not work.
The SARE header rules files include several message-id rules that test
for patterns that are found in spam but not non-spam. Examples:
header SARE_MSGID_LONG MESSAGEID =~ /<.{135,}>/
describe SARE_MSGID_LONG Message ID is too long.
score SARE_MSGID_LONG 1.183
#hist SARE_MSGID_LONG Jesse Houwing, August 20 2004
#max SARE_MSGID_LONG 90s/0h of 70699 corpus (43133s/27566h RM) 10/02/04
#counts SARE_MSGID_LONG 16s/0h of 38748 corpus (15267s/23481h JH-SA3.0rc1) 08/19/04
#counts SARE_MSGID_LONG 7s/0h of 34763 corpus (18647s/16116h MY) 08/25/04
header SARE_MSGID_SHORT MESSAGEID =~ /^.{1,6}$/
describe SARE_MSGID_SHORT Message ID is too short to be valid.
score SARE_MSGID_SHORT 3.333
#stype SARE_MSGID_SHORT spamgg
#hist SARE_MSGID_SHORT RM_hm_ShortMsgid6
#counts SARE_MSGID_SHORT 8s/0h of 68491 corpus (41115s/27376h RM) 09/18/04
#max SARE_MSGID_SHORT 191s/0h of 115925 corpus (94616s/21309h) 05/01/04
#counts SARE_MSGID_SHORT 24s/0h of 38398 corpus (14914s/23484h JH) 08/14/04 TM2 SA3.0-pre2
#counts SARE_MSGID_SHORT 68s/0h of 17050 corpus (14617s/2433h MY) 08/08/04
If you find any other combinations that can be used to identify spam,
we're definitely interested in testing them.
Bob Menschel
Re: Using Message ID in a rule
Posted by Matt Kettler <mk...@evi-inc.com>.
At 12:26 PM 1/5/2005, Steve Bondy wrote:
>Is it safe to write a rule that triggers on the content of the Message
>ID header?
Yes...
>I frequently see things coming in which have message IDs that include
>the domain name of the target mail system, rather than the source mail
>system. If I remember correctly, the message ID should always be the
>source....
You might want to look at the MSG_ID_ADDED_BY_MTA_* series of rules that
shipped with 2.5x
Unfortunately there is still quite a bit of legitimate mail that fails to
insert message ID's like it should. My last was a webinar announcement from
Wind River (makers of the VxWork RTOS).
Also a lot of broken vacation messages match this, but that's no loss, IMO
sites which allow vacation rules that respond to list posts should be
blacklisted.
Just because the RFC says MUST doesn't mean that all legitamate mailers
will follow the standard. Let's face it, spec violations are common. Even
your own email server plays loose with the specs by HELOing as
svr06.rafte.com, which forward resolves to a different IP address than it
really is...
Received: from 216-136-48-238.gen.twtelecom.net (HELO svr06.rafte.com)
(216.136.48.238)
by apache.org (qpsmtpd/0.28) with ESMTP; Wed, 05 Jan 2005 09:26:35 -0800
$host svr06.rafte.com
svr06.rafte.com has address 216.136.48.228
Technicaly, if possible, you should HELO with your full hostname, which
forward resolves. If not possible, the spec allows you to insert some other
string, but by heloing as a resolvable hostname which resolves to a
different IP you've engaged in what appears to be HELO forgery.