Wed, 03 Nov 2010

Find Email Messages with No Responses

Today, I was trying to find email messages that I had sent which haven't had any responses. My MUA is mutt and my mail is stored in Maildir folders. This could be done with a fairly simple shell script using find and grep, but with about 40,000 messages in the one folder I wanted to search, I was looking for at least a slightly more elegant solution.

The idea is to find messages I had sent (to a specific recipient in this case) and extract the Message-Id; then for each Message-Id, search for messages with that Message-Id in their In-Reply-To or References header. If no messages are found for this second search, we conclude that no response has been received.

I ended up writing a simple shell script that makes use of mairix, which indexes each of the three fields I need to search. Unfortunately, mairix doesn't allow searching the In-Reply-To or References headers directly, but does provide a way to return all of the messages within the same thread as messages returned as a search result. This allows us to restrict the number of messages searched in the second pass to a single thread instead of the entire mailbox.

See the script below:

tech » mail | Permanent Link

rel="nofollow" in Blosxom

I added rel="nofollow" support to the Blosxom writeback plugin. I use Doug Alcorn's version that supports a blacklist and emails me when a new comment/trackback is posted.

Only one small change was required. I simply modified the writeback plugin to prepend all href attributes with rel="nofollow".

--- writeback.orig      2005-01-20 10:59:23.000000000 -0800
+++ writeback   2005-01-20 11:31:00.000000000 -0800
@@ -233,6 +233,7 @@

         $writeback =~ s/\$writeback::(\w+)/$param{$1}/ge;
         $writeback =~ s!mailto:([^\s<]+)!<a href="mailto:$1">$1</a>!g;
+        $writeback =~ s!\bhref\b!rel="nofollow" href!ig;
         $writebacks .= $writeback;
         $count++;
       }

Updated: changed regex to match word boundaries around href.

tech | Permanent Link

The state is that great fiction by which everyone tries to live at the expense of everyone else. - Frederic Bastiat