<<< Date Index >>>     <<< Thread Index >>>

Re: Keeping all headers on edited messages piped thru procmail?



On 2009-01-01, rj <rj@xxxxxxxxx> wrote:
> When I edit a message, the edited version of it appears as a separate, new
> message in mutt's index, but without a "Lines:" header.
> 
> So I pipe it through procmail where I have this in my procmailrc:
> 
> # --------------------------------------------------------
> # Generate a "Lines:" header (needed for maildir mailbox
> # format) using procmail's scoring mechanism.  Only
> # message-body lines are counted (not the headers):
> 
> :0 Bfhw
> * -1^0
> * 1^1 ^.*$
> |formail -I"Lines: $="
> # --------------------------------------------------------
> 
> This recipe adds a custom "Lines:" header, and it appears as well to retain
> the "unignore" headers that are defined as such in my .muttrc.
> 
> But it strips out all of the other headers that were in the original,
> not-piped-through-procmail versions of the message (whether edited or
> non-edited).
> 
> Can this recipe be modified to keep all the original headers intact while
> continuing to generate the custom "Lines:" header?

I think you just need to unset the 'weed' variable before piping, 
then set it again afterwards.  Alternatively, you could perform the 
formail filtering from within your editor rather than from mutt.

Regards,
Gary