You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Charles Gregory <cg...@hwcn.org> on 2009/06/14 15:18:08 UTC

Capturing and using values....

Got a usage question. Is there a simple mechanism, similar to Perl's use
of parantheses and $1 to 'capture' a value in one rule and USE that 
captured value in the next rule?

For example:

To: Bob <re...@wherever>

Followed by one of

Subject: hello Bob
Subject: hello <re...@whatever>

So I would want to (using pure Perl as the basis for the use of $1):

header __TOME      To =~ /([^<]+) <([^>]+>/
header __SUBJTOME  Subject =~ /Dear ($1|$2)/

Similar tests could also catch "dear recip@whatever" at the top of a body.
The trick is to 'capture' the item in parentheses before it is destroyed 
by another internal test in SA's processing....

- Charles

Re: Capturing and using values....

Posted by Theo Van Dinter <fe...@apache.org>.
No, SA doesn't do that.  The best way to do this is to write a plugin
where you can do whatever you want. :)

On Sun, Jun 14, 2009 at 3:18 PM, Charles Gregory<cg...@hwcn.org> wrote:
> Got a usage question. Is there a simple mechanism, similar to Perl's use
> of parantheses and $1 to 'capture' a value in one rule and USE that captured
> value in the next rule?