Tue, 23 Oct 2007
Adding a Website: header to Mailman messages
Very often, I like to quote mailing list messages to people not on those mailing lists. Mailman is a common mailing list program, and Pipermail is commonly used for storing archives. What ends up happening is that I fish around for the archive link and spend a minute or two figuring out which message it is.
So I wrote a short program to do that scraping for me. You can check it out (literally, if you want, with svn) at the mail_tools directory - look for add_mailman_website_header.py and sample_message.
Why the "Website:" header? Thunderbird seems to show that by default, so that's one less configuration option I have to change. (To match this, I changed my alpine config to show it too.)
You may also want to look at the procmailrc snippets I use to insert it into the mail processing pipeline. Embarrassingly, configuring procmail to set it up took as long as writing this thing; it's been way too long....
## <Mailman header addition> :0 W MAILMAN_URL=| python ~/svn/public/code/mail_tools/add_mailman_website_header.py go :0 Waf | formail -b -A "Website: $MAILMAN_URL" ## </Mailman>
One more thing: If you run it with 0 arguments, it does a self-unittest (which in a few days will give false negatives; maybe that'll encourage me to improve the program, but probably not!). Hence I give it the meaningless argument "go". It also waits for a configurable (45s by default) amount of time for the pipermail index to get updated, as in real-world tests it beat the pipermail index for the two list messages.
Screenshot: Before
Here's some mail without the header:ALPINE 0.9999 MESSAGE TEXT Folder: INBOX Message 5 of 7 90% + Date: Wed, 24 Oct 2007 19:29:59 -0700 From: Rick Moen <rick@linuxmafia.com> To: sf-lug@linuxmafia.com Subject: Re: [sf-lug] FWIW and :r! dig -t ns sf-lug.com Quoting Christian Einfeldt (einfeldt@gmail.com): > Learning vi is really hard, though. "vimtutor" is your friend. Until then, think of it as "vi vi vi, the editor of the Beast." _______________________________________________ sf-lug mailing list sf-lug@linuxmafia.com http://linuxmafia.com/mailman/listinfo/sf-lug ? Help < MsgIndex P PrevMsg - PrevPage D Delete R Reply O OTHER CMDS > ViewAttch N NextMsg Spc NextPage U Undelete F Forward
Screenshot: After
ALPINE 0.99 MESSAGE TEXT Folder: INBOX Message 5 of 7 86% + From: Rick Moen <rick@linuxmafia.com> To: sf-lug@linuxmafia.com Date: Wed, 24 Oct 2007 19:29:59 -0700 Subject: Re: [sf-lug] FWIW and :r! dig -t ns sf-lug.com Website: http://linuxmafia.com/pipermail/sf-lug/2007q4/002523.html Quoting Christian Einfeldt (einfeldt@gmail.com): > Learning vi is really hard, though. "vimtutor" is your friend. Until then, think of it as "vi vi vi, the editor of the Beast." _______________________________________________ sf-lug mailing list sf-lug@linuxmafia.com http://linuxmafia.com/mailman/listinfo/sf-lug ? Help < MsgIndex P PrevMsg - PrevPage D Delete R Reply O OTHER CMDS > ViewAttch N NextMsg Spc NextPage U Undelete F Forward
Update 2007-10-24: It actually works now. I worked around what appears to be a bug in the Python email module. Report pending. I'll post a screenshot in a day or two and call this project a success, except for all the other non-Mailman services to index.