Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Jul 1998 10:53:44 -0700 (PDT)
From:      Brooks Davis <brdavis@orion.ac.hmc.edu>
To:        Brett Glass <brett@lariat.org>
Cc:        andrew@squiz.co.nz, security@FreeBSD.ORG
Subject:   Re: Any procmail experts here?
Message-ID:  <Pine.SOL.4.02.9807291045310.14722-100000@orion.ac.hmc.edu>
In-Reply-To: <199807291630.KAA11022@lariat.lariat.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.SOL.4.02.9807291045310.14722-100000>