[ Current Issue Home | Issue #3 Home | FAQ ]��

The FreeBSD 'zine
Featured Articles: Majordomo
## Installing a Mailing List Manager
## Dan Langille <>

The mailing list is a great way to communicate with a large group of people. It forms the basis of many support groups. This article will tell you how to install majordomo, arguably the most robust mailing list manager around. The main website for majordomo is , and one of the interesting things it tells you is the meaning of the name majordomo. This article deals with version 1.94.4.

In order to use majordomo, you need to have sendmail running on your machine. All mail addressed to the mailing list must be processed by your machine.


This should be familiar to you now. Since I have all the ports installed, all I needed to do was:

	[root@ns:~] # cd /usr/ports/mail/majordomo
	[root@ns:/usr/ports/mail/majordomo] # make
	[root@ns:/usr/ports/mail/majordomo] # make install

The full text of the above process is available if you want to see it. I have a few comments about the output produced during the installation.

The output says you should su to root and do a make install-wrapper. The make file doesn't seem to know how to do this as a separate step.

Mention is made of install.sh. I couldn't find any such script.

I found no difficulty associated with not solving the above two anomalies.


Majordomo makes use of the alias feature of sendmail. The first step is to tell sendmail about the majordomo aliases. I've noted that the documentation refers to majordomo.aliases, but the file name is actually aliases.majordomo. Please see the running newaliases section below for a file location problem associated with this file.

If you have an older version of sendmail, modify /etc/sendmail.cf to contain the following lines:


If you use the m4 configuration system that recent versions of sendmail use, you can add the following lines to your .mc file to achieve the same effect. In my case, the following line was added to my hendrix.mc file.


Once your .mc file is saved, you will then have to regenerate your /etc/sendmail.cf file. See the sendmail configuration section of for details.

Majordomo also needs to be added to the list of sendmail trusted users. So you can either add this manually to /etc/sendmail.cf:

	#   Trusted users   #                             


Or add this to your .mc file instead:

	define(`confTRUSTED_USERS', majordom)dnl

Running newaliases

The default alias file is /usr/local/majordomo/aliases.majordomo. You should modify all occurrences of "Postmaster" for your own email. Please note that this example aliases file contains test lists which should be deleted once you have finished your testing.

I found problems using the file in the default location. When I ran newaliases, I was getting the following errors:

  [root@ns:/usr/local/majordomo] # newaliases 
  hash map "Alias0": unsafe map file /usr/local/majordomo/aliases.majordomo.db: Permission denied
  WARNING: cannot open alias database /usr/local/majordomo/aliases.majordomo
  Cannot create database for alias file /usr/local/majordomo/aliases.majordomo

But when I moved the file to /etc, newaliases worked fine:

	[root@ns:/usr/local/majordomo] # newaliases 
	/etc/aliases.majordomo: 16 aliases, longest 235 bytes, 878 bytes total

I'm not sure if it's necessary or not, but I've been HUPing sendmail after each change to the above.

	killall -HUP sendmail

Testing Majordomo

The easiest way to test the mailing list server is by sending messages to [email protected]. Such as this:

	echo 'lists' | mail majordomo

If everything is working correctly, you should get a message back from Majordomo, and not Mailer-Daemon. See docs/INSTALL for more information.

Here's what I received in response to the above command:

	Date: Sat, 6 Feb 1999 01:07:31 +1300 (NZDT)
	To: dan
	From: [email protected]
	Subject: Majordomo results
	Reply-To: [email protected]


	>>>> lists
	[email protected] serves the following lists:


Use the 'info' command to get more information about a specific list.

To subscribe to a list, do the following:

	echo 'subscribe test-l' | mail majordomo

Or send a message to [email protected] with the following in the message body:

	subscribe test-l

You should get messages in return telling you how to confirm your subscription, etc.

Adding message trailers

Here's what I added to /usr/local/majordomo/lists/test-l.config in order to have footers:

	message_footer << END
	To unsubscribe: send mail to [email protected] 
	with "unsubscribe $LIST" in the body of the message


This will produce this at the end of each message in the list:

	To unsubscribe: send mail to [email protected]
	with "unsubscribe test-l" in the body of the message

Note that you specify a blank line by putting a '-' at the start of the line with nothing else on the line. The config file contains a great deal of information on how to modify this file.

Creating a new list

Here is what I did to set up a mailing list. If you want more information, I suggest you also refer to /usr/local/majordomo/doc/NEWLIST.

This section assumes you are creating a new list called newlist. Items in bold are commands you actually enter. Everything else is just a description of what you need to do.

	# cd /usr/local/majordomo/lists
	# touch newlist
	# chown majordom newlist
	# echo 'config newlist newlist.admin' | mail majordomo

Modify newlist.config which the previous step created. Change passwords, add footers, etc. Use the contents of test-l.config as a starting point. Add a section to /etc/aliases.majordomo for your list. Here is an example for you to use.

	# newaliases
	# killall -HUP sendmail
	# echo 'subscribe newlist' | mail majordomo

Respond to any email that majordomo sends back to you. This is normally confirmation that you have supplied a valid email address and that you are subscribing yourself and not somebody else. Send a message to [email protected].

Sending all replies back to the list

When you receive a message from a mailing list, you'll see something like the following in the message headers:

	Subject: sample mail headers
	From: Andrew <[email protected]>
	Reply-To: Andrew <[email protected]>
	Date: Wed, 17 Feb 1999 10:09:27 +0000
	To: [email protected]

When you reply to this message, you will reply to Andrew. That may not be what you want. I prefer mailing lists that default to replying to the list. Something like the following:

	Subject: another sample
	From: Andrew <[email protected]>
	Reply-To: [email protected]
	Date: Mon, 8 Feb 1999 22:12:27 +1300
	To: [email protected]

If you decide this is the type of list for you, then you're in luck because it's a simple change to make. Let's use the example above. Just find the reply_to field in your list file and set the reply_to field. However, before you do this, you might wish to consider the implications of changing the reply-to field. I suggest you read before doing this to decide if it's for you.

	# cd /usr/local/majordomo/lists/
	# ee freebsd-questions.config
	[find and locate the following line and set it just so:]
	reply_to = [email protected]

You should now have a working majordomo installation. If you have any questions or comments, please contact me at the email address at the top of this article.

- Dan

Return to Issue #3

Contact: <>
Last modified: $Date: 1999/06/26 05:29:51 $
Copyright � 2023, The FreeBSD 'zine
All rights reserved.