The FreeBSD Diary

The FreeBSD Diary (TM)

Providing practical examples since 1998

If you buy from Amazon USA, please support us by using this link.
[ HOME | TOPICS | INDEX | WEB RESOURCES | BOOKS | CONTRIBUTE | SEARCH | FEEDBACK | FAQ | FORUMS ]
Installing a mailing list server - majordomo 6 February 1999
Need more help on this topic? Click here
This article has no comments
Show me similar articles
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 server around.  The main website for majordomo is http://www.greatcircle.com/majordomo/ 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.

Here's a good and useful page:  http://www.uoregon.edu/~llynch/majordomo/get-config.html

Installation
This should be familiar to you now.  Since I have all the ports installed, all I needed to do was:
# cd /usr/ports/mail/majordomo
# make
# 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.

  1. 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.
  2. 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.

Configuration
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:

OA/usr/local/majordomo/aliases.majordomo

But if you use the M4 configuration system of recent sendmails, 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.

define(`ALIAS_FILE',`/etc/aliases,/etc/aliases.majordomo')

and you will then have to regenerate your /etc/sendmail.cf file.  See the sendmail configuration section 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   #                             
#####################

Tmajordom

Or add this to your .mc file instead:

define(`confTRUSTED_USERS', majordom)dnl
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:

# newaliases 
<junkmale>hash map "Alias0": unsafe map file 
                /usr/local/majordomo/aliases.majordomo.db: \
                                          Permission denied
<junkmale>WARNING: cannot open alias database
                        /usr/local/majordomo/aliases.majordomo
<junkmale>Cannot create database for alias file 
                        /usr/local/majordomo/aliases.majordomo

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

# 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 majordomo@yourdomain.com.   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 sent:      	Sat, 6 Feb 1999 01:07:31 +1300 (NZDT)
To:             	dan
From:           	majordomo@ns.freebsddiary.cx
Subject:        	Majordomo results
Send reply to:  	majordomo@ns.freebsddiary.cx

--

>>>> lists
majordomo@ns.freebsddiary.cx serves the following lists:

  test                    
  test-l                  
  test-l-digest           

Use the 'info <list>' 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 majordomo@yourdomain.com 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 majordomo@freebsddiary.cx
with "unsubscribe $LIST" in the body of the message

END

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

To unsubscribe: send mail to majordomo@freebsddiary.cx
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.

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.

If you are creating a mailing list for virtual domains, I suggest you read Creating a majordomo mailing list for a virtual domain.

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.

  1. # cd /usr/local/majordomo/lists
  2. # touch newlist
  3. # chown majordom newlist
  4. # echo 'config newlist newlist.admin' | mail majordomo
    If you are creating virtual domains or if you are not on the box on which majordomo resides, then you need to specify the domain in the mail message (i.e. majordomo@yourdomain.org).
  5. Modify newlist.config which the previous step created.  Change passwords, add footers, etc.  Use the contents of test-l.config as a starting point  You may also wish to see my list of Commonly Changed Configuration Items.
  6. add a section to /etc/aliases.majordomo for your list.  Here is an example for you to use.
  7. # newaliases
  8. # killall -HUP sendmail
  9. # echo 'subscribe newlist' | mail majordomo
    As in step 4, you may need to use majordomo@yourdomain.org.
  10. 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.
  11. send a message to newlist@yourdomain.com

I strongly urge you to make digests/archives of every list you create.  It doesn't take much time and it require very little additional system resources.  I wish I'd done that when I started my ADSL mailing list.  But then, if I had, I wouldn't have written the "Creating a digest and archive for a majordomo mailing list" article.  Look in the sample config files for the appropriate settings in the aliases file.

Here are the key items which I normally change within a new list configiration file.  You should replace the values within angle brackets (<...>) with your own values.
admin_passwd   = <admin password>
administrivia  = no
approve_passwd = <approve password>
description    = <some discription about your list>
get_access     = open
message_footer << END
-
To unsubscribe: send mail to <majordomo@yourdomain.org>
with "unsubscribe $LIST" in the body of the message

END
restrict_post = <yourlist>:<yourlist>-digest
unsubscribe_policy  =   open+confirm
which_access  = closed
who_access    = closed

Note that the restrict_post item shown assumes you have both a list and a digest version of your list.  If you don't have a digest version, then just supply <yourlist> for this value.

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 <nobody@fakedomain.org>
Send reply to: 		Andrew <nobody@fakedomain.org>
Date sent: 		Wed, 17 Feb 1999 10:09:27 +0000
To: 			freebsd-questions@freebsd.org

When you reply to this message, you will reply to Andrew, which is how most lists are set up and it is the default.  However, that may not be what you want.  Perhaps you want something like the following:

Subject:        	another sample
From:           	Andrew <nobody@fakedomain.org> <dan.langille@dvl-software.com>
Send reply to:  	freebsd-questions@freebsd.org
Date sent:      	Mon, 8 Feb 1999 22:12:27 +1300
To:             	freebsd-questions@freebsd.org

If you decide this is the type of list for you, then you're in luck because it's a simple change to make.  However, before you do this, perhaps you might wish to consider the implications of changing the reply-to field.  I suggest you read ``Reply-To'' Munging Considered Harmful before you do that.  Once, you've done that, and you still wish to proceed, just find the reply_to field in your list file and set the reply_to field.

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

I don't use the above option mainly for the following reason:  a public message wrongly sent privately to a list member is much less likely to embarrass than a private message wrongly sent to the list.

The various bits and pieces
There are two major components to a majordomo mailing list.

The first is the configuration files.  These normally reside within /usr/local/majordomo/lists/ and have a .config suffix.  The configuration file determines how people subscribe to the list, what actions they can take, the passwords for list maintenance, and various other options.  Basically, the config file determines the look and feel of the list.

The second is the aliases file.  This file determines various essential items including:

  • the list owner
  • archive locations
  • digest locations
25 August 1999 - Today I was trying to figure out how hide certain lists from the lists command.  I found my solution at http://www-uclink.berkeley.edu/major/major.hide.html and I recommend that resource to you.

Here's what I put in the configuration file for the list in question:

noadvertise << END
/.*/
END

Need more help on this topic? Click here
This article has no comments
Show me similar articles