On 2001.10.24, in <[EMAIL PROTECTED]>,
        "R . Leponce" <[EMAIL PROTECTED]> wrote:
> Hello all mutt-users !!
> 
> Is there a way to limit the size of CC and To field when receiving an email also 
>sent to
> many users ?

I had this problem with mail forwarded from my VMS account; its mail
facility expanded groups to a big list on the header lines. I came up
with this procmail rule:

FORMAIL=/path/to/formail
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; \
)

This saves the original to: and cc: headers to X-VMS-Long-??-Header:,
and strips out the corresponding ??: header, whenever the list occupies
more than 5 lines. This might not work for you if your header lines are
all in one long line, but if they're properly continued rfc822 headers,
it should be ok.

You'd want to adapt it a little, of course.

-- 
 -D.    [EMAIL PROTECTED]        NSIT    University of Chicago

Reply via email to