Thread Tag

This utility is for tracking information about threads in E-mail discussions (if anyone makes it cut the grass, ok with me). The way it works is like this. It keeps track of which messages belong together and allows tagging the thread with some information. When a new mail comes, it adds all the information about the thread.

Installation & others

It needs perl to run and it probably won't run under anything close enough to UNIX. The only think you probably need is to get it and save it somewhere into your PATH. I recommend renaming it to something without a version in its name, since you would need to update many configs later.


Here the fun begins. The actual program needs no setup, it should work on its own. But you need to integrate it to your mail filters.

All the incoming mail should be run trough this program, it has to be used as a pipe filter. If you use procmail, the rule looks like this:

:0 f:thread_tagger.lock
| f

All the mails go trough, so it can see what mail belong together. Moreover, it adds all the information to each mail.

There is need to add or remove some information from a thread. That is done in a similar way to processing the message for the first time. As the arguments, you add a command. A command consists of + or - (add or remove) ani a string to add or remove. Following command (in the mutt config) assigns the ) key a command to ignore and mark a thread as read.

macro index ) "| -IgnoreThread\n\cr"

You may notice the missing f parameter, which told the program to output the modified message, which is not needed now.

The last step is to use the tags. Each message gets the information to its header, but now we need the filters to take actions according to them. Messages ignored this way can be recognized by procmail like this:

* ^Thread-Tags:.*IgnoreThread


The program keeps all info in files ~/.threads_ids and ~/.threads_tags. If you want it to forget everything, delete them. The program forgets threads older than one month.


At the moment, I use it to ignore threads and to prevent replies ho my mails to be fed to spam filters. If you know some other use, please let me know.