* Greg Webster <[EMAIL PROTECTED]> [2003-12-05 01:23]:
> Excellent. I am in agreement.

> I've sent a raw list of all the urls in the rules to Chris Santerre wish
> a promise that one I find some time I'll write up some perl code to
> clean up and form rules out of them.

I resend two perl scripts that I mailed to Chris Santerre (without
answer yet :-) that convert the bigevil.cf file to a plain list of
domains/addresses and vice versa. The latter script can be rewritten to
get better rules. 

Hope this is of any use.

----snip----
#!/usr/bin/perl
#
# bigevil2text.pl - Convert bigevil.cf to ascii file (1/line)
#
# Usage:  cat bigevil.cf | perl bigevil2text.pl > bigevil.txt

while (<>)
  {
    next unless /^\s*rawbody.+\/\\b\(\?:(.+)\)\\b\/i/;
    print join("\n", map { s/\\././g; $_; } split(/\|/, $1)), "\n";
  }

----snip----
#!/usr/bin/perl
#
# text2bigevil.pl - Convert ascii file (1/line) to bigevil.cf
#
# Usage:  cat bigevil.txt | perl text2bigevil.pl > bigevil.cf

my $i = 0; my $num = 1; my @row;
while (<>)
  {
    next if /^\s*$/ || /^#/; ## next if empty line or comment
    chomp;
    s/\./\\./g;
    push @row, $_;
    if (++$i >= 11) ## number of entries per rule
      {
        output($num++, @row);
        $i = 0; @row = ();
      }
  }

output($num++, @row) if @row;  ## last entries

sub output
  {
    my ($num, @row) = @_;
    print "rawbody BigEvilList_$num\t/\\b(?:", join("|", @row), ")\\b/i\n";
    print "describe BigEvilList_$num\tGenerated BigEvilList_$num\n";
    print "score BigEvilList_$num\t3.0\n\n";
  }

----snip----

Alex

-- 
Alex Pleiner
zeitform Internet Dienste         Fraunhoferstrasse 5
                                  64283 Darmstadt, Germany
http://www.zeitform.de            Tel.: +49 (0)6151 155-635
mailto:[EMAIL PROTECTED]        Fax:  +49 (0)6151 155-634
GnuPG/PGP Key-ID: 0x613C21EA


-------------------------------------------------------
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