After discovering I didn’t backup everything on my server before the hard disk was replaced I realized how much I love procmail, especially the rule that adds a reply-to header to several mailing lists. Technically they aren’t mailinglists but just lists, thanks to Google Apps used by my student association. Fortunately I bragged about it on Facebook several months ago so after checking my old wall posts (not a pleasant job because it was months and months of posts) I found it.
I did fix my backup scripts but just to be sure, and maybe to make someone else happy I’m posting it here:
# Add reply-to to those pesky example.com mailinglists.
:0 fhw
* ^List-Id:\/.*\.example\.com
|formail -I "Reply-To: `echo $MATCH | \
sed -e 's/^.*\>\(.*\)\.example\.com.*$/\1@example.com/'`"
# Other ppl without cool procmail rules press reply-all
# so delete all to <lists>@example.com msgs cc'd to me
:0
* ^TO_(list_name|another_list|yet_another_list)@example.com
* !^List-Id:\/.*\.example\.com
/dev/null
Update: I’ve added a second rule to delete all mail that is addressed to the mailing list (using *@example.com won’t work because there are also non-list adresses at that domain) but has no list-id and therefor must be a cc to me, not the list, because few people have these cool filters and most just press reply-all to make sure it is at least delivered to the list. Sigh. I’m still monitoring this rule in case of errors but it seems to work fine. You can replace /dev/null with your trash folder if you want to be less rigorous.