The problem:
I'm subscribed to a few mailing lists that send me mail digests.
The embedded messages don't have "To:" or "Cc:" headers, and
occasionally some of them are spam (yes, the Procmail list is not very
original in this respect ;-)). So basically I'd like to do three kinds
of things:
(1) Split the digests into separate messages;
(2) Distribute the "To:" line of the digests to the embedded messages;
(3) Run the resulting messages through Procmail again to remove spam.
My attempted solution:
I can easily get (1)+(2):
:0
* ^From.*Digestifier
{
:0 hw
SAVE_TO=|formail -x To:
:0:
|formail +1 -eds formail -a "To:$SAVE_TO" >>mailbox
}
I can also get (1)+(3):
:0:
* ^From.*Digestifier
|formail +1 -eds procmail -m $MAILDIR/.killfile >>mailbox
But I can't seem to get (1)+(2)+(3). The obvious approach
:0
* ^From.*Digestifier
{
:0 hw
SAVE_TO=|formail -x To:
:0:
|formail +1 -eds formail -a "To:$SAVE_TO" | procmail -m
$MAILDIR/.killfile>>mailbox
}
doesn't seem to work: the messages either get lost without trace, or
are delivered unprocessed to my default mailbox. Removing the "-m"
option doesn't seem to help either. (BTW: can anybody shed some light
on the use of this option and the "parameter=value"? The man page is
not particularly intelligible at that point). Something is very wrong
here. Any ideas?
Regards,
Liviu
--
Dr. Liviu Daia e-mail: daia(_at_)stoilow(_dot_)imar(_dot_)ro
Institute of Mathematics web page: http://www.imar.ro/~daia
of the Romanian Academy PGP key: finger
daia(_at_)stoilow(_dot_)imar(_dot_)ro