From owner-freebsd-current Tue May 20 19:17:50 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id TAA10911 for current-outgoing; Tue, 20 May 1997 19:17:50 -0700 (PDT) Received: from main.statsci.com (main.statsci.com [206.63.206.110]) by hub.freebsd.org (8.8.5/8.8.5) with SMTP id TAA10899 for ; Tue, 20 May 1997 19:17:48 -0700 (PDT) Received: from plum.statsci.com [206.63.206.43] with smtp by main.statsci.com with smtp (/\oo/\ Smail3.1.29.1 #29.3 #3) id m0wU0y8-000ZMgC; Tue, 20 May 97 19:17 PDT Received: from plum.statsci.com [206.63.206.43] with smtp by plum.statsci.com with smtp (/\oo/\ Smail3.1.29.1 #29.3 #3) id m0wU0y8-0007SRC; Tue, 20 May 97 19:17 PDT Message-Id: To: Archie Cobbs cc: jmb@FreeBSD.ORG (Jonathan M. Bresler), current@hub.freebsd.org Subject: Re: usregsite.com References: <199705201806.LAA06278@bubba.whistle.com> In-reply-to: Your message of "Tue, 20 May 1997 11:06:01 -0700." <199705201806.LAA06278@bubba.whistle.com> Reply-to: scott@statsci.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3899.864181055.1@plum.statsci.com> Date: Tue, 20 May 1997 19:17:36 -0700 From: Scott Blachowicz Sender: owner-current@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Archie Cobbs 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]*$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!) ### 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: Snail: (Call) PGP-Key: (finger merlyn@ora.com) ### Web: My Home Page! ### Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me