[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [leafnode-list] filtering spam articles using the "from" field

Ray Abbitt wrote:
> It's actually fairly easy, but you may want to reconsider just a bit.
> I believe you will find that a lot of legitimate posts in your spool
> from users @xx.shawcable.net since shaw is one of the bigger cable
> connectivity providers in Canada.

I agree!  Maybe a filter or two on one of the 'Posting-Host' type headers
would be better.

> The following filter will work:
> pattern = ^From:.*shawcable.net
> action = kill

When did that change?  I thought the syntax for that was just a single line
in /etc/leafnode/filters:


(From http://leafnode.sourceforge.net/doc_en/applyfilter.8.html )

I knocked up a couple of small shell scripts to help with filters:

This one tests the effect of a possible filter before enabling it for real:

--- grepng ---
echo $*
for ff in `ls /var/spool/news/interesting.groups/` ;
 do echo $ff;
 ngname=`echo $ff | sed {s/\\\./\\\//g}` ;
 for mm in `ls /var/spool/news/$ngname/` ;
   do grep -q "$*" /var/spool/news/$ngname/$mm && grep Subject:
/var/spool/news/$ngname/$mm ;
   done ;
 echo "" ;
--- end ---

(The line that starts 'Subject:' is a continuation of the one above.)

e.g. To test the filter above, run this: 'grepng ^From:.*shawcable.net'

And then once I've updated my filters file one to apply the new filters to
all newsgroups:

--- applyfilt ---
for ff in `ls /var/spool/news/interesting.groups/` ; do
 echo $ff;
 applyfilter -v $ff ;
 echo "" ;
--- end ---

leafnode-list mailing list