mutt/2201: display filters does not apply properly to headers and attachments
>Number: 2201
>Notify-List: mutt-bugs@xxxxxxxxxxxxxxxxxxxxxx
>Category: mutt
>Synopsis: display filters does not apply properly to headers and
>attachments
>Confidential: no
>Severity: normal
>Priority: medium
>Responsible: mutt-dev
>State: open
>Keywords:
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Mar 29 02:38:31 +0200 2006
>Originator: Luis A. Florit
>Release: 1.5.11
>Organization:
>Environment:
Linux 2.6.15-1.2054_FC5 i686 i686 i386 GNU/Linux
>Description:
There are two issues regarding display filters:
1) I did a small perl script to strip multiple To: and Cc:
lines (yes, I know there are other scripts that do the same
but I wanted a simple one to add to my custom "adds remover"
filter). It's quite simple:
#####################################################
#!/usr/bin/perl -p
undef $/;
s/((To:|Cc:).*\n)(^[\t\s].*\n)+(^[^ ].*)/\1 \[---=| STRIPPED |=---\]\n\4/mg;
#####################################################
It works very well stripping the anoying multiple lines
in those headers BUT ONLY when mutt does not weed headers
('h' keyword). With stripped headers, it just does not work. I would expect to
behave consistently.
2) I also use another filter to strip adds in messages,
like the ones added by Yahoo and other mailing lists,
or virus scan programs. I call the filters with
set display_filter='mutt-display.pl'
in my .muttrc file.
However, I realized that when I receive a
message diggest (many messages in one, that appear
as separate 'message/rfc822' attachments), and I
try to see one attachment, the filter programs
are not called, and the adds are shown. I tried
to configure my .mailcap with:
message/rfc822; cat %s | mutt-display.pl ; copiousoutput
but that didn't make any difference.
>How-To-Repeat:
For (1), just toggle the view of all the headers with 'h' of a mail with many
To: addresses. When all headers are shown, the multiple To: and Cc: lines are
stripped. When not shown, they are not stripped (i.e., the filter does not
work).
For (2), just try to see the attachments using 'v' and then ENTER in the
corresponding message. For example, you can use the mutt mailing list daily
diggest... :)
>Fix:
For (1), perhaps this is some silly regexp problem.
Not a clue for (2).
>Add-To-Audit-Trail:
>Unformatted: