<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>David Raynes: Procmail</title>
<link>http://www.rayners.org/archives/computing/config_files/procmail/index.php</link>
<description></description>
<language>en-us</language>
<copyright>Copyright 2005</copyright>
<lastBuildDate>Wed, 23 Jul 2003 17:12:00 -0500</lastBuildDate>
<pubDate>Wed, 11 May 2005 17:01:28 -0500</pubDate>
<generator>http://www.movabletype.org/?v=3.16</generator>
<docs>http://blogs.law.harvard.edu/tech/rss</docs>

<item>
<title>Sorting Mailing Lists with Procmail</title>
<description>Bill writes about the usefulness of list header metadata, so I thought I&apos;d put up the procmail recipies I use...</description>
<link>http://www.rayners.org/2003/07/sorting_mailing.php</link>
<guid>http://www.rayners.org/2003/07/sorting_mailing.php</guid>
<content:encoded><![CDATA[<p>Bill writes about the <a href="http://www.ideaspace.net/users/wkearney/archives/entries/000395.html">usefulness of list header metadata</a>, so I thought I'd put up the <a href="http://www.procmail.org/">procmail</a> recipies I use to catch mailing list emails.</p>

<pre><code class="codesnip">
 # Yahoo Groups
 # (e.g. Mailing-List: list mt-dev@yahoogroups.com)
:0:
* ^Mailing-List: list \/[^@]+
lists/$MATCH

 # Mailman and other intelligent software lists
 # (e.g. List-Post: &lt;mailto:Pluginmanager-l@rayners.org&gt;)
:0:
* ^List-Post: \&lt;mailto:\/[^@]+
lists/$MATCH

 # Other list software?
 # (e.g. X-Mailing-List: &lt;ftjava-test@firedrake.org&gt;)
:0:
* ^X-Mailing-List: \&lt;\/[^@]+
lists/$MATCH

 # Mojo Lists
 # (e.g. List: lug)
:0:
* ^List-Software: Mojo Mail
* ^List: \/[^@]+
lists/$MATCH

 # ListProc (all those UMBC lists)
 # (e.g. Sender: owner-umbclinux@listproc.umbc.edu)
:0:
* ^Sender: owner-\/[^@]+
lists/$MATCH

 # More lists (realms-l)
 # (e.g. From owner-realms-l@ORACLE.WIZARDS.COM)
:0:
* ^From owner-\/[^@]+
lists/$MATCH</code></pre>

<p>Most of the mailing list software out there adds the headers and I can catch them relatively easily.  With others, however, I have to do a little digging.  And the realms-l list drives me insane.  Here's how it identifies itself within the email:</p>

<pre><code class="codesnip">Sender: The Forgotten Realms Mailing List &lt;REALMS-L@ORACLE.WIZARDS.COM&gt;</code></pre>

<p>I suppose I could look for that specifically, but that's exactly the point.  I shouldn't have to write filters for specific mailing lists.  It defeats the whole purpose of putting the list data in the email headers.</p>

<p>Anyways, for all you procmail/regexp experts out there, how do you think I could handle this odd case:</p>

<pre><code class="codesnip">Sender: port-sgimips-owner@NetBSD.org</code></pre>

]]></content:encoded>
<category>Procmail</category>
<pubDate>Wed, 23 Jul 2003 17:12:00 -0500</pubDate>
</item>
<item>
<title>Filtering Bug Reports from the MT Plugin Directory Bug Tracker</title>
<description>I love procmail. I just spent a few minutes playing around with my ~/.procmailrc file and now any bug reports...</description>
<link>http://www.rayners.org/2003/07/filtering_bug_r.php</link>
<guid>http://www.rayners.org/2003/07/filtering_bug_r.php</guid>
<content:encoded><![CDATA[<p>I love <a href="http://www.procmail.org/">procmail</a>.  I just spent a few minutes playing around with my <em>~/.procmailrc</em> file and now any bug reports I get from the <a href="http://mt-plugins.org/">MT Plugin Directory</a> <a href="http://bugs.mt-plugins.org/">Bug Tracker</a> are now placed into <em>~/Mail/bugs/<strong>Project Name</strong></em>.</p>

<p>Here is the relevant portion of my <em>~/.procmailrc</em> file:</p>

<pre><code># Catch bug reports from bugs.mt-plugins.org
:0:
* ^From: plugins@mt-plugins\.org
{
        :0 B
        * ^Proje[ck]t: \/.+
        bugs/`echo &quot;$MATCH&quot; | sed -e 's/ /_/g'`
}</code></pre>

<p>And from my <em>~/.muttrc</em> file to see all those mailboxes:</p>

<pre><code>mailboxes `for file in ~/Mail/bugs/*; do echo -n &quot;=bugs/$(basename $file) &quot;; done`</code></pre>

<p><strong>Update:</strong> (2003-06-08 18:14)</p>

<p>Thanks go to <a href="http://michaelrose.org/marathon/">Mike</a> for the suggestion.  So, here's the updated recipe:</p>

<pre><code># Catch bug reports from bugs.mt-plugins.org
:0:
* ^From: plugins@mt-plugins\.org
* B ?? ^Proje[ck]t: \/.+
bugs/`echo &quot;$MATCH&quot; | sed -e 's/[^-_A-Za-z0-9]/_/g'`</code></pre>

]]></content:encoded>
<category>Procmail</category>
<pubDate>Tue, 08 Jul 2003 16:16:22 -0500</pubDate>
</item>


</channel>
</rss>