wally fatboy klingon
Fight ePatents in Europe!
Get FireFox
I'm a hacker!
Valid CSS!
Valid HTML 4.01!
 
I'm on a lot of mailinglists, and I want it to be really easy to subscribe new lists without having to make the Maildir/ directory structure and then having to build the Exim filter rules to direct all the corresponding mails to that newly created Maildir.

Hey, i'm a sysadmin. I automate things!

What started as a procmail kinky-list-filter-thingy, is now the Exim filter kinky-list-filter-thingy:

# Exim filter

# kinky-list-filter-thingy
if $h_X-Mailing-List: matches "<?([^@>]+)" or
   $h_List-Id: matches "<([^\.]+)" or
   $h_X-List-Id: matches "<([^\.]+)"
then
	save Maildir/.lists.${perl{sanatize}{$1}}/
	finish
endif
You see the sneaky '${perl{sanatize}{$1}}' Exim expansion? That is because I don't trust any of you, nor do I trust your headers, so I filter out anything that doesn't belong there. See the Exim documentation on how I did that Perl-in-Exim-trick.

Next I use three lines and two scripts in my .muttrc to automatically include the available mailboxes on my system:

`echo subscribe $(~/.tools/lists)`
`echo lists $(~/.tools/lists)`
mailboxes `~/.tools/mailboxes`
Works like a charm! Now you might also want to see my folderhooks trick!