http://bugzilla.spamassassin.org/show_bug.cgi?id=3168
Summary: Ability to declare user variables for use in rules
Product: Spamassassin
Version: 2.63
Platform: Other
OS/Version: other
Status: NEW
Severity: normal
Priority: P3
Component: Rules
AssignedTo: [EMAIL PROTECTED]
ReportedBy: [EMAIL PROTECTED]
If this is already implemented, I apologise for not finding it. If it isn't
please consider it an enhancement request.
It would be very handy to be able to declare local variables that would have a
lifetime of "one message" before being reset. With these a number of matching
tests could easily be performed that now probably require eval rules, or at
least a fairly deep knowledge of the variables that exist inside SA, and which
could be subject to change.
For instance, a recent spam I got that is in the new plain-text format, so
triggers virtually no rules, has the following curiosities:
Return-Path: <[EMAIL PROTECTED]>
From: Xqmubin Xyxefymem <[EMAIL PROTECTED]>
Message-ID: <[EMAIL PROTECTED]>
Received: from 68.148.167.30 ([68.148.167.30])
by condor (EarthLink SMTP Server) with SMTP id 1b1Zi95dQ3NZFjK0
(which is from h68-148-167-30.ed.shawcable.net, and probably not an Earthlink
node at all)
Admittedly all of those headers are forgable, so tests can't be weighted too
heavily. But with a user variable, I could determine that the hostname in the
Return-Path didn't match the hostname in the Message-ID, for instance. I don't
know how I could do that check between two headers without a variable of some
sort.
My Perl abilities are virtually nonexistant, so the following probably isn't
valid syntax. However, perhaps something similar to the following could be
implemented:
header __RTN_HOST Return_Path =~ /\@(\w\.)>$/; $rtn_host = $1
header MISMATCHED_MSGID Message_ID !~ /[EMAIL PROTECTED]>$/
score MISMATCHED_MSGID 1.0
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.