From owner-freebsd-security Wed Jul 29 10:55:05 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id KAA13913 for freebsd-security-outgoing; Wed, 29 Jul 1998 10:55:05 -0700 (PDT) (envelope-from owner-freebsd-security@FreeBSD.ORG) Received: from orion.ac.hmc.edu (Orion.AC.HMC.Edu [134.173.32.20]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id KAA13891 for ; Wed, 29 Jul 1998 10:54:51 -0700 (PDT) (envelope-from brdavis@orion.ac.hmc.edu) Received: from localhost (brdavis@localhost) by orion.ac.hmc.edu (8.8.8/8.8.8) with SMTP id KAA16541; Wed, 29 Jul 1998 10:53:44 -0700 (PDT) Date: Wed, 29 Jul 1998 10:53:44 -0700 (PDT) From: Brooks Davis Reply-To: brooks@one-eyed-alien.net To: Brett Glass cc: andrew@squiz.co.nz, security@FreeBSD.ORG Subject: Re: Any procmail experts here? In-Reply-To: <199807291630.KAA11022@lariat.lariat.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-security@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Wed, 29 Jul 1998, Brett Glass wrote: > Wow.... That means invoking both procmail AND Perl on every message. > Not such a good idea on a busy mail server. (And, of course, Perl > will recompile the regex each and every time it executes.) How could > one avoid this? > > At 06:50 PM 7/29/98 +1200, Andrew McNaughton wrote: > > >:0 hfw > >* ^Content-disposition: > >| /usr/local/bin/perl -pe 's/^(Content-Disposition:.{80}).*/$1/i' Procmail doesn't really let you make changes to messages so you're going to have to invoke an external program to do that, but you could write a very simple C program to print a message back exactly like it was with shortened Content-disposition: headers (just make sure to avoid writing a buffer overflow into that program ;-). You could also change the rule set to the following to only envoke perl on the bad cases. :0 hfw * ^Content-disposition:.{80} | /usr/local/bin/perl -pe 's/^(Content-Disposition:.{80}).*/$1/i' I haven't tested that, but procmail is supposed to use egrep expressions and Solaris egrep claims to supports {#} notation. -- Brooks To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe security" in the body of the message