Fixing mailman can’t discard/defer message via web config

I had a notice from Mailman for one of my lists that there was a message that required administrative attention (i.e. it was spam). The mailman web-interface provides a facility for treating email, however when I went to discard the message it wouldn’t go away. I tried a heap of things and it took a long time to figure out, but eventually I noticed that in the mailman web page the domain name it was using was “intranet.blackbrick.com” whereas that should have been “www.intranet.blackbrick.com”. So I did a little searching about how to configure a list’s base URL and discovered this, which fixed my issue:

/usr/lib/mailman/bin/withlist -l -r fix_url support \
  --urlhost=www.intranet.blackbrick.com

Where ‘support’ above is ‘list name’.

Support for OpenID

Was just having a look into what kind of support there was for OpenID in the software that I use, and basically it looks like there is fairly good support. Mailman might be a bit of a trick.

MediaWiki

WordPress

Mailman

Mailman check_perms

I learned about the Mailman check_perms program today. Basically it reports on permission issues with the mailman database, which is good because I was having trouble with the permissions on the mailman database. Basically email for a new list wasn’t being added to the web archive because the right permissions weren’t in place to allow the mailman process to write there. Anyway, with the help of /usr/lib/mailman/bin/check_perms and the judicious use of “chgrp -h list” and “chown -R -h www-data:list” I think I managed to fix everything up.

Update: I had a problem after applying the above changes whereby I couldn’t access the web archive for Mailman lists anymore. But… I figured out how to fix it. Basically I added the www-data to the list group with the following command (and then rebooted):

 sudo adduser www-data list

Mailman 3.0 and Postfix Virtual Domains

Read the spec for Mailman 3.0. Looks like it will be pretty good. The feature that I’m interested in, and I’m annoyed I can’t do this with my current version of Mailman, is to be able to put a link to the web archived message in the bottom of the outgoing SMTP message. I.e. so there’s a link back to that message on the web in the message itself. Would be really handy for referencing. At the moment if I want a link I have to go to the web archive for the particular list and find it.

While I was reading the Mailman 3.0 spec I noticed a link to Postfix Virtual Domain Hosting Howto. I think I might have read (at least some of) that before. But… reading that is now definitely on my TODO list.

Mailman bin/arch

In the Mailman FAQ I was reading Where can I change a list or the default URL used for the web interface? which mentioned the bin/arch utility down the bottom of the page:

If you are using the MM pipermail archiver with HTML archives, you might also need to run $prefix/bin/arch if there is archived email with attachments that have been extracted with links to the attachments left in the email. These links seem to use the web_page_url of the list concerned at the time the email was added to the archive. Running arch rebuilds these links using a list’s current web_page_url. If you are rebuilding the archive with bin/arch, you probably want the –wipe option. See bin/arch –help. Also, it it a good idea to at least check the cumulative archives/private/listname.mbox/listname.mbox file with bin/cleanarch before rebuilding.

That’s pretty handy to know about, because I do want to rebuild the archives of one of my lists, because I want to change from Monthly to Yearly volumes.

So that’s:

root@sixsigma:/var/lib/mailman# bin/arch --wipe bizdev
root@sixsigma:/var/lib/mailman# cd archives/private
root@sixsigma:/var/lib/mailman/archives/private# ll
total 56
drwxrws--- 14 list     www-data 4096 2012-02-01 06:15 ./
drwxrwsr-x  4 list     www-data 4096 2011-11-23 06:02 ../
drwxrwsr-x  6 root     www-data 4096 2012-02-01 06:15 bizdev/
drwxrwsr-x  2 list     www-data 4096 2011-11-23 07:52 bizdev.mbox/
drwxrwsr-x  2 www-data www-data 4096 2012-02-01 00:34 dev/
drwxrwsr-x  2 www-data www-data 4096 2012-02-01 00:34 dev.mbox/
drwxrwsr-x  2 www-data www-data 4096 2012-02-01 00:55 directors/
drwxrwsr-x  2 www-data www-data 4096 2012-02-01 00:55 directors.mbox/
drwxrwsr-x  4 list     www-data 4096 2012-02-01 03:27 mailman/
drwxrwsr-x  2 list     www-data 4096 2012-01-31 22:53 mailman.mbox/
drwxrwsr-x  2 www-data www-data 4096 2012-02-01 01:14 members/
drwxrwsr-x  2 www-data www-data 4096 2012-02-01 01:14 members.mbox/
drwxrwsr-x  2 www-data www-data 4096 2012-02-01 02:54 support/
drwxrwsr-x  2 www-data www-data 4096 2012-02-01 02:54 support.mbox/
root@sixsigma:/var/lib/mailman/archives/private# chown -R list:www-data *
root@sixsigma:/var/lib/mailman/archives/private# ll
total 56
drwxrws--- 14 list www-data 4096 2012-02-01 06:15 ./
drwxrwsr-x  4 list www-data 4096 2011-11-23 06:02 ../
drwxrwsr-x  6 list www-data 4096 2012-02-01 06:15 bizdev/
drwxrwsr-x  2 list www-data 4096 2011-11-23 07:52 bizdev.mbox/
drwxrwsr-x  2 list www-data 4096 2012-02-01 00:34 dev/
drwxrwsr-x  2 list www-data 4096 2012-02-01 00:34 dev.mbox/
drwxrwsr-x  2 list www-data 4096 2012-02-01 00:55 directors/
drwxrwsr-x  2 list www-data 4096 2012-02-01 00:55 directors.mbox/
drwxrwsr-x  4 list www-data 4096 2012-02-01 03:27 mailman/
drwxrwsr-x  2 list www-data 4096 2012-01-31 22:53 mailman.mbox/
drwxrwsr-x  2 list www-data 4096 2012-02-01 01:14 members/
drwxrwsr-x  2 list www-data 4096 2012-02-01 01:14 members.mbox/
drwxrwsr-x  2 list www-data 4096 2012-02-01 02:54 support/
drwxrwsr-x  2 list www-data 4096 2012-02-01 02:54 support.mbox/

Mailman fix_url.py

Reading Why aren’t my mm_cfg.py settings for DEFAULT_URL_PATTERN, DEFAULT_URL_HOST and DEFAULT_EMAIL_HOST effective? tells of /usr/lib/mailman/bin/fix_url.py which can be run on a single list like this:

 bin/withlist -l -r fix_url  [fix_url options]

Or run on all lists like this:

 bin/withlist -l -a -r fix_url -- [fix_url options]

Invoke fix_url.py by itself to get its help text:

jj5@sixsigma:/$ /usr/lib/mailman/bin/fix_url.py
Reset a list's web_page_url attribute to the default setting.

This script is intended to be run as a bin/withlist script, i.e.

% bin/withlist -l -r fix_url listname [options]

Options:
    -u urlhost
    --urlhost=urlhost
        Look up urlhost in the virtual host table and set the web_page_url and
        host_name attributes of the list to the values found.  This
        essentially moves the list from one virtual domain to another.

        Without this option, the default web_page_url and host_name values are
        used.

    -v / --verbose
        Print what the script is doing.

If run standalone, it prints this help text and exits.

So, for example:

root@sixsigma:/var/lib/mailman# vim /etc/mailman/mm_cfg.py
root@sixsigma:/var/lib/mailman# bin/withlist -l -a -r fix_url -- -v
Importing fix_url...
Running fix_url.fix_url()...
Loading list bizdev (locked)
Setting web_page_url to: https://intranet.blackbrick.com/cgi-bin/mailman/
Setting host_name to: blackbrick.com
Saving list
Loading list mailman (locked)
Setting web_page_url to: https://intranet.blackbrick.com/cgi-bin/mailman/
Setting host_name to: blackbrick.com
Saving list
Finalizing