Bob Proulx wrote:
> 
> I like it!  Much more efficient than listing all of the addresses
> out.

It is pretty nifty -- I love stuff like that :).  I only partially
tested what I pasted -- which I "extrapolated" from my implimented code
-- I had forgotten to test whether it matched only for addresses in the
list mail file, and it didn't -- it was matching everything.

Here's a working rendition:

HEADERTAG=From:

ADDRESSFILE=/usr/home/bhoover/listreply

ISMAILINGLIST=no

FORMAIL=formail

:0i
HEADERTAGVAL=|$FORMAIL -zx$HEADERTAG | tr -d "\n" | tr -s " "

:0i
addressMatch=|grep -i -x "$HEADERTAGVAL" "$ADDRESSFILE"

:0
* ! addressMatch ?? ^^^^
{
  ISMAILINGLIST=yes
}

It's assumed all that variable set up at the beginnnig there is done
before calling in a driver recipe file that, in turn, calls the code
starting at the HEADERTAGVAL/FORMAIL recipe.

> But there is some room for false hits.  Wouldn't the -x option to grep
> be appropriate there?  And it probably should be quiet too.  And
> probably you don't want to use regular expressions (but maybe you do).

I added the -x option (don't think it would hurt, and tested fine too).

I've never seen output from grep in my log -- I assume that's what you
mean by quiet.

By regular expressions, I assume you're talking about matching address
patterns and such?  I suppose that could come in handy -- for instance,
you could cover all sourceforge mail with one entry.

> > * ? grep -F -q -x -i $HEADERTAGVAL $ADDRESSFILE
> 
> Here is the key for the list:
> 
>  -F   fgrep functionality, no REs so '.' matches a literal '.'.
>  -q   quiet, no output, just the return code
>  -x   exact match on the entire line
>  -i   ignore case

I'm still looking at the differences between the code from which I
pulled the above -- it's not matching in the exact same way.  My
original code -- that which I'm using on my account -- matches more
flexibly, but there have been no false matches.  Procamail seems to have
some arcane, I guess you would say, interpolation rules, but then, that
might be true of all pattern matching languages.

The I'm using is:

:0i
curMatch=|grep -i $curAddress ${HEADER_MANIP}/headertagfile

Which looks to me the same thing as the above.  I do notice the ${..}
part difference of course.  My routines check more than the From header
though, so it's possible not all are working as I think.  But again,
I've had no problems, and been using for a couple years now I think.

Bryan

> Bob
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: IBM Linux Tutorials.
> Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
> Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
> Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click

-- 
That's why my soul always reverts to the Old Testament and to
Shakespeare.  There at least one feels that it's human beings talking. 
There people hate, people love, people murder their enemy and curse his
descendants through all generations, there people sin. - (Soren
Kierkegaard - Either/Or)

http://www.wecs.com/content.htm

This signature file is generated by Pick-a-Tag !
Written by Jeroen van Vaarsel
http://www.google.com/search?hl=en&ie=ISO-8859-1&q=pick-a-tag



-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
Spamassassin-talk mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/spamassassin-talk

Reply via email to