Minimalist is a mailing list manager I first heard about on the lighttpd mailing list a couple months ago. I looked into it, and one of the features that stood out for me was that all of the configuration was simply file based. It occurred to me that I might be able to drive that with Movable Type. I wanted to automatically create mailing lists for my various plugins, so this past weekend I finally took the plunge and here is how I did it.
First of all (after installing all of the packages), I needed to create the list of mailing lists for Minimalist (lists.lst). So I created a new index template in my plugins blog and set the output file to /var/spool/minimalist/lists.lst.
<MTTopLevelCategories>
<MTCategoryLabel dirify="1">-announce <MTCategoryLabel> Announcement List
<MTCategoryLabel dirify="1">-discuss <MTCategoryLabel> Discussion List
</MTTopLevelCategories>
Then the aliases and virtual aliases needed to be defined for each mailing list. I created two more index templates:
/home/rayners/plugin-lists/plugins.aliases
minimalist: "|/usr/bin/minimalist"
<MTTopLevelCategories>
<MTCategoryLabel dirify="1">-announce: "|/usr/bin/minimalist <MTCategoryLabel dirify="1">-announce"
<MTCategoryLabel dirify="1">-announce-owner: rayners@rayners.org
<MTCategoryLabel dirify="1">-discuss: "|/usr/bin/minimalist <MTCategoryLabel dirify="1">-discuss"
<MTCategoryLabel dirify="1">-discuss-owner: rayners@rayners.org
</MTTopLevelCategories>
/home/rayners/plugin-lists/plugins.virtual
minimalist@rayners.org minimalist
minimalist@plugins.rayners.org minimalist
<MTTopLevelCategories>
<MTCategoryLabel dirify="1">-announce@plugins.rayners.org <MTCategoryLabel dirify="1">-announce
<MTCategoryLabel dirify="1">-announce-owner@plugins.rayners.org <MTCategoryLabel dirify="1">-annonce-owner
<MTCategoryLabel dirify="1">-discuss@plugins.rayners.org <MTCategoryLabel dirify="1">-discuss
<MTCategoryLabel dirify="1">-discuss-owner@plugins.rayners.org <MTCategoryLabel dirify="1">-discuss-owner
</MTTopLevelCategories>
And then referenced those files in my Postfix configuration:
alias_maps = ....,
hash:/home/rayners/plugin-lists/plugins.aliases
virtual_alias_maps = ....,
hash:/home/rayners/plugin-lists/plugins.virual
Finally, I needed to use category archives to create the lists themselves. Minimalist uses directories undernead the main directory to store list archives and configuration. Unfortunately, an absolute path cannot be specified (at least as far as I could see in my quick overview) in Movable Type's archive mappings, so I had to resort to a little path trickery as I did not want to setup a symbolic link in my web directory which could let people peek in on my configuration information.
So here are the paths I setup as category archives:
../../../../var/spool/minimalist/%C-announce/config../../../../var/spool/minimalist/%C-discuss/config../../../../var/spool/minimalist/%C-announce/footer../../../../var/spool/minimalist/%C-discuss/footer../../../../var/spool/minimalist/%C-announce/info../../../../var/spool/minimalist/%C-discuss/info
I created three templates, one each for the config, footer, and info files. They are currently empty, but I could put configuration details in there and they would automatically propagate to each mailing list.
One of the interesting things I discovered during setting all of this up was that my mail server will run a command alias with the permissions of the owner of the alias file (unless that owner is root, and then it runs as nobody). So, when I initially put the minimalist aliases in the mail alias file (/etc/aliases), which is owned by root, Minimalist was creating the subscription list for the mailing lists as one user and trying to read it as another (since the aliases for the mailing list were created by the www-data user, which is running the web server). So, while my email address was subscribed to the list, when I tried to post it, the software did not have permission to read the file with the subscription list in it. It took me a good couple hours to dig that one up.
So there is how I setup the mailing lists for all of my plugins (which are categories in my plugins blog). The mailing lists currently are not listed in the individual plugins pages, but now that I have got the backend working, I will be adding information about the mailing lists later this week.
Leave a comment