Courier+Mailman using AuthUserDB on Debian Linux

By Jason Gordon

Background Info / Purpose

I spent a great deal of time trying to setup Courier and Mailman together and get them to work properly. This tutorial or HOW-TO covers how to setup Mailman on Courier under Debian GNU Linux. For this tutorial, I assume that you have root on the machine where you are trying to set this up. Most tutorials I read had assumed that you would be runnign virtual domains on your mail server. My tutorial does not cover virtual domains and assumes you are accecpting mail for one domain. Setting up Courier itself is alsio beyond the scope of this document as well and I assume it is installed and properly receiving mail for regular system users.

I had tried many times to do this by setting up aliases in /etc/courier/aliases/ but failed each time.

1. Install Mailman

For me this step was as easy as issuing

apt-get install mailman
For other Linux flavors you should follow the mailman instructions.

2. Setup a mailing list directory

I called mine Mailing-Lists and I put this is /root but you can put it anywhere you want. So on my system I have a directory called /root/Mailing-Lists. In that directory, create a directory for the mailing list. In this tutorial, the mailing list will be called mylist so you would create the directory /root/Mailing-Lists/mylist. Within that directory, you need to create four .courier files:

 .courier   .courier-admin   .courier-owner    .courier-request

The content of those files is as follows:


   |/var/lib/mailman/mail/wrapper post mylist
   |/var/lib/mailman/mail/wrapper mailowner mylist
where is your email address or the email address of the owner of the list


   |/var/lib/mailman/mail/wrapper mailcmd mylist

Obviously, you must alter the paths so they correspond to your mailman installation.

Next, change to the /root/Mailing-Lists directory and issue the command:

chmod -R username.usergroup mylist
where username and usergroup are the user and group names of who you want to own your mailing list. This is important. The user and group should be real usernames and groups that exist on the system.
IMPORTANT: Do not use root for the user or group... it will not work!!!!!!!

3. Setup AuthUserDB

In Courier, AuthUserDB or UserDB is a means for setting up virtual accounts. These accounts have an associated home directory and Maildir somewhere on disk. They also have a password to allow login. Normally, you would use UserDB to create mail accounts for people who you wouldn't want to have shell access to the system like if you are an ISP. UserDB is how we connect Courier to Mailman.

First edit /etc/courier/authdaemonrc and find the line authmodulelist=" .... "

Change that line and add authuserdb as one of the authentication modules.

Note: By enabling authuserdb, courier will now try to read /etc/passwd when looking for accounts. Make sure your mailing list address doesnt share the same name as anything it /etc/passwd.

Create or edit the file /etc/courier/userdb and add an entry of the following form:

mylist	home=/root/Mailing-Lists/mylist|uid=12|gid=12
Note: there is a tab after mylist. The uid and gid listed must correspond to the username and group you chomoded /root/Mailing-Lists/mylist to. To find out what the uid and gid are, use the command: "id username" if it is available on your system.
See "man makeuserdb" for more info.

In the directory /etc/courier issue the following:

userdbpw -md5 | userdb mylist set systempw
This will prompt you for a password. Set it to something long and random. You don't need to know it. This is only so someone won't log into your mail server as your mailing list user.

Issue the command:

If the command doesnt complain, AuthUserDB and your userdb should be set up.

Maybe try sending an email to mylist-owner@yourdomain and see if it goes through.

4. Make the mailing list

Use the command "newlist" to make the mailing list. That's prety much it. You might want to set up some Apache configuration stuff as suggested by mailman.

Misc Info

If you found this document useful, please e-mail me and let me know. Also send in any corrections or mistakes. Special thanks to all who write open source software and Sam Varshavchik whose help on the courier mailing list helped me figure most of this out.

What's new  - Résumé  - E-mail me