procmail
[Top] [All Lists]

Re: digest messages

2000-03-08 06:59:22
"S.Toms" <tomas(_at_)primenet(_dot_)com> writes:
On Tue, 7 Mar 2000, Philip Guenther wrote:

pg> "S.Toms" <tomas(_at_)primenet(_dot_)com> writes:
pg> >
pg> >  I've tried the following, which works, but seems kinda clunky and slow
pg> >to me.
pg> >
pg> >:0f
pg> >| formail +1 -ds formail -bfi "Reply-To: blah(_at_)blah(_dot_)com" >> 
mailfolder
pg> >
pg> >  is there a better way?
pg> 
pg> You almost certainly don't want the 'f' flag on that recipe.  It'll cause
pg> an empty message to be processed by the rest of your rcfile.  You should
pg> instead use the 'w' flag to catch the return code of the formail command.
pg> As for making this nicer, you can give formail header alteration flags
pg> (-i, -a, etc) when splitting and they will be applied to each message
pg> that is split out.
pg> 
pg>    :0 w:
pg>    | formail +1 -bfi "Reply-To: blah(_at_)blah(_dot_)com" -ds >> mailfolder
pg> 

 Tried it out and it appeared to work as I was thinking, but upon
implementing it, I discovered it actually makes one large message with all
the individual messages within it. So I'm back to my original one, except
now I'm using it with the 'w' and the : lock.
 Any other thoughts?

Sorry, I should have caught that you need to drop the -f flag.  With it,
formail doesn't add the "From " separator to each message burst from
the digest.  It worked in the two formail version because the splitting
version added them.  Also, the -b flag needs to be dropped, as otherwise
an embedded "From " line won't be escaped, resulting in a bogus split in
the mailbox when your mail client reads it.  The -b and -f flags should
only be used when working with non-mbox mailbox formats or when feeding
the message into programs that know they're dealing with one message and
won't try to split it.

So, give this a try:

        :0 w:
        | formail +1 -i "Reply-To: blah(_at_)blah(_dot_)com" -ds >> mailfolder


Philip Guenther

<Prev in Thread] Current Thread [Next in Thread>