procmail
[Top] [All Lists]

Re: Trimming an extra header.

2003-03-28 15:06:40
On Fri, Mar 28, 2003 at 10:04:21PM +0100, Tony L. Svanstrom wrote:
On Fri, 28 Mar 2003 the voices made John Ehrlinger write:

JE> I was trying to use sed because I wanted to delete the entire
header to JE> the first blank line (see the sample message).

 How about a quick hack that'll make it all work while the local
experts are coming up with the perfect solution? =)

:0f
* ^From jehrling(_at_)bio\(_dot_)ri\(_dot_)ccf\(_dot_)org
      | perl -ne 'print && next if $a; $a++ if /^$/'


Tony, if all the world were a nail, you'd use perl.  (Or something
like that.)

There is *no* reason to be loading that humongo perl thing into memory 
for each message he gets.  And even if formail, which four people have
already mentioned, couldn't do this trivially, and even if procmail
couldn't delete a header natively all by itself, well, sed would be
fine here.

        | sed '1,/^$/ d'

But we don't need it, or perl.  (Though if we did, we would want the
w and h flags on the recipe.)

        :0 b # forward just the body
        * ^From:(_dot_)*(_at_)bio\(_dot_)ri\(_dot_)ccf\(_dot_)org
        ! forward(_at_)address

-- 
dman

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>