Easy as E-Mail

chromatic on 2003-03-09T02:32:55

I wrote a mailing list manager today, based on Mail::Audit.

My buddy circle includes people in and out of the area. We send a lot of e-mail back and forth, making plans for weekends and weeknights and passing around interesting tidbits. That usually means creating large address lists based on random criteria -- who's in town, who's not, who might be interested in a subject and who isn't.

A few weeks ago, we were discussing some subject or another, and my brother replied and said, "Can you guys take me off of the cc-list? I'm not interested in this topic." That started my brain a-thinkin'.

My little mailing list manager lets you create new, temporary mailing lists by sending an e-mail with *NEW* in the subject to the proper address. The body has to be a list of e-mail addresses to which the mailing list will apply. It replies with the address of the new list -- just an alphanumeric addition to the main mailing last address. For example, if the list were sml@localhost, a list may be sml+a0f4b918@localhost.

All posts to that address go to everyone on the list. Anyone on the list can unsubscribe by sending an e-mail with *UNSUBSCRIBE* in the subject.

It runs from a .forward file, so it's a bit slow, but it was a whole lot easier than doing this out of procmail or writing a dedicated C program.

It needs a few more features, like limiting the people who can create a mailing list and optionally preventing people not on the list from posting to it. As well, I'm having trouble adding a little "For help, send an e-mail to this address with *HELP* in the subject" disclaimer to the end of the message body. It doesn't seem to stick when I get an arrayref back from $audit->body(). It doesn't do much logging, either.

It does appear to work pretty well, though, and it's 300 lines of code (including blank lines), though that's 2/3 test suite. It's pretty good for a day's work, though, especially since I got a bit of laundry and cleaning done.

On the other hand, it did absolutely nothing for finishing my book (draft due the 17th) or getting Everything 1.0 out the door, or working on my super secret space game. Still, it was pretty fun, and it's one more accomplishment.

Code available here, for the time being. It's not an official module package yet; early adopters and willing patchers only. Be sure to create an aliases file before you run it -- if it doesn't exist, it won't work. Big limitation; probably the first I want to fix.