Re: how to filter a long list of To: addresses
* On 2006.05.21, in <20060521093925.GA10803@xxxxxxxxxxxx>,
* "phyrster" <phyrster@xxxxxxxxx> wrote:
>
> My organization, when sending email messages to its staff, often put a long
> list of users in To: field. It is a pain for me to page down a few times
> in order to read the message body.
>
> How to filter out this long list of To: addresses and preferably just show my
> address in To: field?
I used to suffer from this scourge. I solved it using procmail, which
might or might not be to your liking, since it rewrites original message
headers.
The place I worked then sent these messages using "All in 1", an
application that managed distribution lists on VMS. Messages
with long To: likes were distinguished by an "A1-Type:" header,
so this recipe triggers on that. It looks for To: and Cc: headers
more than 5 lines long and replaces them with a group notation,
with the original To: list relocated to X-VMS-Long-(To|Cc)-Header:
in case I needed to look at it without header weeding.
## If the To: line is too long, shrink it.
#####
TO=`formail -zx To:`
CC=`formail -zx Cc:`
:0 f
* ^A1-type:
| ( \
if [ `echo "$TO" | wc -l` -gt 5 ] ; then \
formail -R To: X-VMS-Long-To-Header: | \
formail -I "To: X-VMS-Long-To-Header:;"; \
else \
cat; \
fi; \
) | ( \
if [ `echo "$CC" | wc -l` -gt 5 ] ; then \
formail -R Cc: X-VMS-Long-Cc-Header: | \
formail -I "Cc: X-VMS-Long-Cc-Header:;"; \
else \
cat; \
fi; \
)
--
-D. dgc@xxxxxxxxxxxx NSIT University of Chicago