From owner-freebsd-questions Thu Dec 19 18:18:52 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3EECA37B401 for ; Thu, 19 Dec 2002 18:18:51 -0800 (PST) Received: from wonkity.com (wonkity.com [63.93.4.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id DCAA243EE5 for ; Thu, 19 Dec 2002 18:18:49 -0800 (PST) (envelope-from wblock@wonkity.com) Received: from wonkity.com (localhost.wonkity.com [127.0.0.1]) by wonkity.com (8.12.1/8.11.6) with ESMTP id gBK2InuF061342; Thu, 19 Dec 2002 19:18:49 -0700 (MST) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.12.1/8.12.1/Submit) with ESMTP id gBK2ImPG061339; Thu, 19 Dec 2002 19:18:48 -0700 (MST)?g (envelope-from wblock@wonkity.com) Date: Thu, 19 Dec 2002 19:18:48 -0700 (MST) From: Warren Block To: Mxsmanic Cc: FreeBSD Questions Subject: Re: Getting Perl scripts to work as mail filters In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, 19 Dec 2002, Mxsmanic wrote: > I finally got it to work by piping to sendmail. Seems to be adequate for > what I want to do. > > Now all I have to do is design my patented, foolproof methodology for > distinguishing spam from real mail so that I can encode the rules in the > script. There must be a way! Also, this may allow me to do something about > getting rid of HTML in mail, which I can't stand. There's nothing wrong with reinventing procmail like this, but I'm curious why you consider it "bloated"--it's under 64K on my system. Anyway, here's a procmail recipe that catches a lot of spam. Not all, but it's a start, and the regular expression should be usable in your Perl program with few changes: # Mail not addressed to me. :0 * $!^((Resent-|Apparently-)?(To|Cc|Bcc)):.*${LOGNAME} $MAILDIR/Spam-folder -Warren Block * Rapid City, South Dakota USA To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message