procmail
[Top] [All Lists]

Re: yahoogroups-recipe (was: formail to split digest with indented From and Date)

2002-03-23 21:56:39
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"
    LOG="yg:"$MATCH$NL
  :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

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