Sebastian Helms <sebastian(_at_)helms(_dot_)sh> writes:
When I do not want to read a thread in a mailinglist, I still want
to archive the mails. So I thought that I could let them be marked
read automatically by a procmail script.
My first attempt is this:
SUBJECT=`formail -zxSubject:`
:0 fh
* ? $HOME/bin/threadgrep "$SUBJECT"
| formail -I "Status: RO"
threadgrep looks like this:
echo $* | grep -f ~/.procmail/kill-thread -
and in ~/.procmail/kill-thread I have a list of subjects which I
want marked read.
Perhaps someone could comment on these ? Something to make better ?
It's a good idea. There's a few things you can do to make it more
efficient and robust. First off, extract the subject using \/ and
$MATCH instead of formail. That sve two processes and is much faster.
You should include the 'w' flag on the recipe in case something goes
wrong and formail fails to execute.
:0 fhw
* ^Subject:[ ]*\/[^ ](.*[^ ])?
* ? $HOME/bin/threadgrep "$MATCH"
| formail -I "Status: RO"
As for threadgrep itself, you should preserve whitespace in
the argument:
echo "$@" | grep -f $HOME/.procmail/kill-thread >/dev/null 2>&1
Philip Guenther
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail