procmail
[Top] [All Lists]

Re: filtering messages inside digests

1997-04-30 21:50:00
Rob Funk asked,

| I recently subscribed to a digested mailing list, and added the
| following rule to split it into individual messages:
| 
|     :0:
|     * ^Subject: SAMBA digest
|     * ^From:(_dot_)*samba(_at_)arvidsjaur\(_dot_)anu\(_dot_)edu\(_dot_)au
|     | formail +1 -ds >>samba
| 
| This works great except for one thing:  the individual messages inside
| the digest don't get filtered at all (for things that I don't even
| want to see).

Yes, that's what will happen.

| I'm thinking that changing the formail line to explicitly call
| procmail for each message might work:
| 
|     | formail +1 -ds procmail

That's the way to do it, except for some modifications I'll detail below.

| but is there a better way built into procmail or formail?

No, there isn't, but I'd suggest taking some precautions so that procmail
will recognize the split-out pieces as having come from the SAMBA Digest.
Here are two ideas.

Method 1: use a different rcfile for them:

     :0
     * ^Subject: SAMBA digest
     * ^From:(_dot_)*samba(_at_)arvidsjaur\(_dot_)anu\(_dot_)edu\(_dot_)au
     | formail +1 -ds procmail .sambadigestrc

where $HOME/.sambadigestrc (if the rcfile lives in another directory,
use a full absolute path or a relative path from $HOME) contains recipes
that apply only to articles burst from the Samba Digest.

Method 2: use the same rcfile but mark the articles before they recycle
 into it:

    # somewhere earlier in the rcfile
    :0
    * ^X-Split-From: SAMBA digest
    {
     recipes for the individual articles
    }

    # at the same place in the rcfile as it is now
    :0
    * ^Subject: SAMBA digest
    * ^From:(_dot_)*samba(_at_)arvidsjaur\(_dot_)anu\(_dot_)edu\(_dot_)au
    | formail +1 -A"X-Split-From: SAMBA digest" -ds

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