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

Re: Display Filters



* Gary Johnson <garyjohn@xxxxxxxxxxxxxxx> :
> On 2006-07-02, Troy Piggins <troy@xxxxxxxxx> wrote:
> > * Troy Piggins <troy@xxxxxxxxx> :
> 
> > > How can I incorporate both?  Pipe on to the other?
> > 
> > Never mind.  Figured it out - was trying to pipe within the scripts,
> > when I did this it works:
> > 
> > set display_filter='mail-to-filter | $HOME/bin/display-filter'
> 
> I'm glad you got it working, but piping within you script should 
> have worked as well, e.g.,
> 
>     #v+
>     #!/bin/bash
>     # http://aperiodic.net/phil/configs/bin/mutt-display-filter
> 
>     mail-to-filter |
>     sed -e '
> 
>     ...

Yep - since had figured that out also.  I was forgetting to add "\"
to end of line:

-----8<-----
sed -e '

# fix incorrect sig delimiters
s/^--$/-- /
s/^_____.*/-- /
s/^\*\*\*\*\*.*/-- /

# yahoo groups links
s/^-----* Yahoo! Groups Sponsor .*/-- /

# try getting rid of "[-- .* --]" notes...
/^\[-- Autoview using .* --]$/d
/^^[][0-9;]*^G\[-- Autoview using .* --]$/d
/^\[-- Attachment .* --]$/d
/^^[][0-9;]*^G\[-- Attachment .* --]$/d
/^\[-- Type: .* --]$/d
/^^[][0-9;]*^G\[-- Type: .* --]$/d

' \
\
| t-prot -acelmtS -Mmutt --spass -L${HOME}/.mutt/mlfooters 
-A${HOME}/.mutt/adfooters \
\
| mail-to-filter
-----8<-----

All good.

-- 
Troy Piggins
  ,-o   Ubuntu v6.06 (Dapper Drake): kernel 2.6.15-25-server, 
 o   )  postfix 2.2.10, procmail 3.22, mutt 1.5.11i,
  `-o   slrn 0.9.8.1/rt (score_color patch), vim 7.0