procmail
[Top] [All Lists]

Re: [pro] Re: how to filter out threads that I initiated or I participated in?

2009-04-08 15:58:56
On Wed, Apr 08, 2009 at 03:28:29PM -0400, Charles Gregory wrote:
Hello Zhengquan!

Of the replies to your post, there are two 'flavors':

The first mistakes your intent, and looks for your address in the mail  
body. As you said, this catches "most" but not "all".
that is right, some emails to a thread I am involved in does not quote
my message or my name at all.

The other suggestion, regarding the 'References:' header, is using 
similar logic to the recipe I posted, scanning e-mails from you to the 
list, for something 'consistent', saving it and testing for it. I 
I can understand this. 
suggested the 'subject' line. They suggested grabbing the message-ID and 
storing it, then comparing it to 'References'. But they didn't give you 
any code. My code shows *how* to grab the information and store it 
directly into a 'sub recipe' file that is then INCLUDED into the procmail 
recipe 'flow'. This removes the need for any programs to save a database 
or 'generate' recipes from it.
Ah! got the point!

The code I posted is ALL of it, just with 'generic' info where you need
to replace the code with your system's specifics. There is no other  
'research' to be done, other than your own comfort level using 'echo' and 
the 'INCLUDERC' command....

Enjoy!

- Charles

On Wed, 8 Apr 2009, Zhengquan Zhang wrote:

How about dynamic rulset generation?

In your main RC file:

INCLUDERC /path/to/subjectsrcfile

:0 c
* ^Newsgroups:.*comp\.mail\.mutt
I can replace this to 
    * ^List-Id:.*unison-users 
if the email from the mailing list has a list-id, right?

* ^From_youraddress(_at_)yourdomain(_dot_)tld
* ^Subject: (Re. |\[mailinglistsubjectag\] )*\/......*
do I have to do anything with this line, especially
mailinglistsubjectag?

| echo -e "\n:0\n* ^Subject:.*$MATCH\nmutt-threadsiamin/\n" >> 
subjectsrcfile
to be frank, I don't quite understand $MATCH, so subjectsrcfile will
grow as I post more messages to the mailing list right?


The use of '.....' prevents blank/short subject lines from triggering....
For this simple form, I auto-generated rules that just deliver matching
mail to a new folder. You could also get fancy and 'formail' the message
before dropping it into the existing folder, etc, etc.

By doing the 'INCLUDERC' first, you *should* prevent multiple redundant
triggers of the 'create a rule' rule when you add more posts to a thread.
But your first posting will go to your regular mutt-users/ folder.

Of course, you would still have to frequently manually edit the file to
remove old rules/subjects.... Don't let that rc file grow to large!
only old subjects right? because I am only echoing subject rules to
subjectsrcfile. No problem if it is too large:)


Hope this helps!
Thanks Charles, it helps me immensely!
Thanks Charlse, it is very helpful, but I am pretty new to procmail and
can not grab the essence for now..
Regards,

-- 
Zhengquan
____________________________________________________________
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