Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 May 1997 19:17:36 -0700
From:      Scott Blachowicz <scott@plum.statsci.com>
To:        Archie Cobbs <archie@whistle.com>
Cc:        jmb@FreeBSD.ORG (Jonathan M. Bresler), current@hub.freebsd.org
Subject:   Re: usregsite.com 
Message-ID:  <m0wU0y8-0007SRC@plum.statsci.com>
In-Reply-To: Your message of "Tue, 20 May 1997 11:06:01 -0700." <199705201806.LAA06278@bubba.whistle.com> 
References:  <199705201806.LAA06278@bubba.whistle.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
Archie Cobbs <archie@whistle.com> wrote:

> I had an idea the other day while trying to learn procmail...
> ...
> Any takers??

If anyone does that it would be greatly appreciated if it could start off as a
data file of some sort that can get filtered into .procmailrc format or
mailagent format or whatever.  On the agent-users list, Randal Schwartz
recently posted a perl script (what else? :-)) that grabs an AOL maintained
web page of domains that they can block for their subscribers and turns it
into a list of perl regexps suitable for inclusion into mailagent .rules
files.  For example, mine has this in it:

	## flag spam (thank you, AOL!)
	To Envelope From Sender Relayed Reply-To: "~/Mail/.spamlist-aol" {
	 ANNOTATE -d X-maybe-spam Smells like spam-aol from %1;
	 SAVE +trash; ABORT -t;
	};

that .spamlist-aol file has a bunch of lines like this:

	/^((.*[@.])?1floodgate\.com)$/i

and my copy of the perl script is appended to this message.

Scott Blachowicz  Ph: 206/283-8802x240   Mathsoft (Data Analysis Products Div)
                                         1700 Westlake Ave N #500
scott@statsci.com                        Seattle, WA USA   98109
Scott.Blachowicz@seaslug.org

#! /sw/local/perl5/bin/perl
use strict;

use LWP::Simple;

my $AOL = "http://www.idot.aol.com/preferredmail/";
my $SPAMLIST = "/homes/scott/Mail/.spamlist-aol";
chdir;

$_ = get $AOL or die "Cannot get $AOL\n";
s/^[\s\S]*<MULTICOL.*\n// or die "missing MULTICOL in $_ ";
s/<\/MULTICOL[\s\S]*// or die "missing /MULTICOL in $_ ";
open STDOUT, ">$SPAMLIST" or die "create $SPAMLIST: $!";
## be sure $1 is what you want in the annotation
print map "/^((.*[\@.])?\Q$_\E)\$/i\n", split /\n/;

### 
### which creates a series of lines in "~/.spamlist" that look like:
### 
###     /^((.*[@.])?1floodgate\.com)$/i
###     /^((.*[@.])?205\.254\.167\.57)$/i
###     /^((.*[@.])?206\.29\.21\.179)$/i
###     /^((.*[@.])?207\.176\.34\.97)$/i
###     /^((.*[@.])?207\.201\.206\.210)$/i
###     /^((.*[@.])?299\.78\.01\.37\.4)$/i
###     /^((.*[@.])?4yourbiz\.std\.com)$/i
###     /^((.*[@.])?ISPAM\.COM)$/i
###     /^((.*[@.])?ISPAM\.NET)$/i
###     /^((.*[@.])?Interconnectivity\.com)$/i
### 
### which happen to be directly useful in .rules lines that look like this:
### 
###     ## flag spam (thank you, AOL!)
###     <TO_MERLYN> Envelope From Sender Relayed Reply-To: "~/.spamlist" {
### 	    ANNOTATE -d X-merlyn-spam Smells like spam from %1;
### 	    ## eventually, file in list.spam or delete,
### 	    ## but for now, just testing...
### 	    REJECT;
###     };
### 
### This is still a work in progress, but I thought I'd publish this alpha
### release in case anyone else wanted to hack along with me.
### 
### -- 
### Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
### Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
### Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
### Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
### Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?m0wU0y8-0007SRC>