procmail
[Top] [All Lists]

RE: Maintain a "carbon copy" for certain threads in mailing lists

2007-07-21 13:37:13
Eugeny N Dzhurinsky wrote Friday, July 20, 2007 12:01 PM:

I want to IDENTIFY a message belongs to some thread of messages
I am interested in watching, and if the message belongs to the
thread - I want to COPY it into my mailbox. With copying I was
answered the question (thanks to Patrick Shanahan!), but now
I'm concerned of that "identifying" task.

Now thank you for pointing me to the -D option of formail, I
assume my rules for procmailrc should look like this:

:0 Wh : /var/tmp/procmail.lock
* ^From:.*my.local.mail
* ^To:.*some.mailing.list
| formail -D 10240 $HOME/msgid.cache

but now I need to check any of e-mail posted to anybody to
mailings lists I subscribed to, for In-reply-to: header

And I'm a bit lost at this point, what and how should I invoke
for examining the header against mailid cache file.

Probably it should like this:

:0 Wh : /var/tmp/procmail.lock
* ^To:.*some.mailing.list
* ? formail -x In-reply-to | xargs -ILINE grep 
$HOME/msgid.cache "LINE"
$HOME/Maildir/Inbox

Well, you can "trick" formail into swapping the
In-Reply-To: header and the Message-ID.  Then you
just run "formail -D" as in the examples, more or
less, against your cache.  Each list has its own
cache.

 | formail -i Message-ID -R In-Reply-To Message-ID -D 4096 listA.cache

That moves the current Message-ID to Old-Message-ID, then
renames In-Reply-To to Message-ID, then runs the -D switch.
You have various caches for the various lists.

Theoretically, you don't need to save the current Message-ID
first, because the changes we're performing here are not
being saved anyway -- it's just a trick to seed the Message-ID
cache, since "formail -D" is designed to work with that field.

Does that help?

Dallman
____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail