Providing practical examples since 1998

Things look quiet here. But I've been doing a lot of blogging at
dan.langille.org because I prefer WordPress now.
Not all my posts there are FreeBSD related.
I am in the midst of migrating The FreeBSD Diary over to WordPress
(and you can read about that here).
Once the migration is completed, I'll move the FreeBSD posts into the
new FreeBSD Diary website.

Mailman is a mailing list manager.
This article will demonstrate how I set up Mailman and converted some mailing lists from
Majordomo. I'll be using FreeBSD 6.0-STABLE,
Postfix 2.2.7, and MailMan 2.17 but you will probably find these instructions useful no matter that operating
system and version you are planning to use.

Mailman has a web component that can be used for subscribing, administration, and archives. I'll be showing
how I configured Apache to work with Mailman.

With this solution, I'm making the following assumptions

All mail for your list goes to a specific domain. In my case, lists.freebsddiary.org. I do it
this way so that I can easily change the mail server to another host should the need arise.
It also simplifies the solution in that all mail for that host goes to Mailman, not to a user.

Postfix is your mail server, and you want to use virtual domains.

You will give unique names to each mailing list. You will not have announce@h1.example.org and
announce@h2.example.org. Instead, you will have announce-h1@h1.example.org and
example-h2@h2.example.org. Again, this simplifies the solution.

Installation

Installation is a no-brainer. But if you are using anything other than sendmail as your
mail server, you'll need to tell Mailman about it. The make options command
shows you a lot of things you can tweak. I recommend leaving everything as the default
value except for setting the right value for MAIL_GID. Since I'm using Postfix,
I'll use the following command for installation:

cd /usr/ports/mail/mailman
make MAIL_GID=mailman install clean

That will install mailman and clean up the working files when it is done.

16 April 2006

When it came time to upgrade Mailman at at later date, I found this worked for me:

export MAIL_GID=mailman
portupgrade mailman

NOTE: after reinstalling mailman, you need to restart it:

/usr/local/etc/rc.d/mailman.sh start

In later versions of Mailman, the command is

/usr/local/etc/rc.d/mailman start

NOTE the missing .sh

This point has stumped me more than once. I'd send a message. Nothing happened.
Starting up the mailman queue processing helps.

Configuration

This isn't the first time I have set up Mailman. I know I played with it twice before, the latest
of which I think was in 2003. At the time, I thought the documentation wasn't very clear in some
crucial aspects. In particular, while they may document things well, they don't provide enough
practical examples to demonstrate how to use a particular feature.
I hope things will go smoother this time.

Be sure to read /usr/local/share/doc/mailman/FreeBSD-post-install-notes.

I started by setting up lists.freebsddiary.org. I'm not going to describe
how to set up the DNS. That is outside the scope of this article and I have several
articles about DNS. Similarly, I won't tell you how to
set up a virtual server in Apache, but you can
read something about that. However, the virtual
host for this:

You'll see a reference to postfix-to-mailman.py above. You need to download that
manually and install it to the indicated directory. You can get that from
http://www.gurulabs.com/goodies/downloads.php.
I grabbed the one for Mailman 2.1 version and renamed the file accordingly.
I changed some items within the file:

Command died with status 1

Symptoms: messages to the list bounce with:

&ltfreebsddiary-anounce@lists.example.org&gt: Command died with status 1:
"/usr/local/mailman/postfix-to-mailman.py". Command output: TO ACCESS THE
MAILING LIST SYSTEM: Start your web browser on http://lists.example.org/
That web page will help you subscribe or unsubscribe, and will give you
directions on how to post to each mailing list.

Solution: Your list does not exist. Spell it correctly. In this case,
I'm missing a n from announce.

command died with status 2

Symptoms: messages to the list bounce with:

<freebsddiary-announce@lists.example.org>: Command died with status 2:
"/usr/local/mailman/postfix-to-mailman.py". Command output: Group mismatch
error. Mailman expected the mail wrapper script to be executed as group
"mail", but the system's mail server executed the mail script as group
"mailman". Try tweaking the mail server to run the script as group "mail",
or re-run configure, providing the command line option
--with-mail-gid=mailman'.

Solution: reinstall mailman using the instruction shown at the start of this
article. Key point: MAIL_GID setting is incorrect.

Forbidden
You don't have permission to access /pipermail/bsdcan-announce/ on this server.

Apache/1.3.34 Server at lists.bsdcan.org Port 80

Looking at the server logs for that website, I saw:

(13)Permission denied: access to /pipermail/bsdcan-announce/ failed because search permissions are missing on a component of the path

Googling led me to suspect symlinks were the cause of the problem. Looking at the mailman directory structure supported this theory.
I was to be proven wrong. The cause of the problem was directory permissions. I show you what I did wrong just to document
what I did wrong. :) I show you the correct solution at the end of this section.

I went back and removed the <Location...> directives from the virtual host, retested the configuration, and did a graceful on Apache.
I browsed to the URL again to confirm the FollowSymLinks directive was not required. All as well.

Adding more domains

The above uses only one domain (lists.freebsddiary.org). I hope to add others later.
That will be in another article. Enjoy.

A word about backups

I'm now backing up /usr/local/mailman. The empty files are about 30MB. No
sense not backing up everything! And, of course, I'm using Bacula.