This is an improved version of my previous message.
The lay-out is better, and an erroneous LOG-line is removed
from the recipe.
Anita Lewis wrote:
Ruud H.G. van Tol wrote:
Maybe the -z option of formail can take care off the leading spaces
on the Date and From lines.
I tried the -z option. First I tried it as -dsz. That left the digest
not split at all. Putting it in the middle -dzs allowed the split, but
did not get rid of the lead space.
OK, see also 'man formail'.
I am very interested in doing the bit with matching and putting the
digest in a folder by the same name.
Not tested:
NL="
"
:0
* TO_\/[a-z0-9_-]+(_at_)yahoogroups\(_dot_)com
{
YGROUP="yahoogroups"
:0
* MATCH ?? ^\/[a-z0-9_-]+
{
LOG="yg:"$MATCH$NL
YGROUP=$MATCH
}
# Assuming that the name between the [] in the Subject
# is the same as the first part of the email-address,
# which is right for most yahoogroups, but not all.
#if not Digest, just deliver to $YGROUP
:0:
* $ ! ^Subject: \[$YGROUP] Digest Number [0-9]+$
$YGROUP
#else do the Digest
:0E
{
#1: Holger Wahlen's line to normalize the From and Date lines
:0 fbw
| sed "/^Message:/,/^Subject:/s/^ *//"
#2: deliver a copy to $YGROUP
:0 c:
$YGROUP
#3: append the separate messages in Digest to $YGROUP
:0 w
| formail +1 -ds >> $YGROUP
#4: deliver (is this necessary?)
:0
/dev/null
}
}
Ruud
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail