Installing a mailing list server – majordomoThe 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
InstallationThis 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.
- 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.
Configurationmajordomo 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:
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.
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:
Running newaliasesThe 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 majordomoThe easiest way to test the mailing list server is by sending messages to email@example.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: firstname.lastname@example.org Subject: Majordomo results Send reply to: email@example.com -- >>>> lists firstname.lastname@example.org 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 email@example.com with the following in the message body:
You should get messages in return telling you how to confirm your subscription etc.
Adding message trailersHere’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 firstname.lastname@example.org
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@example.com 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 listHere 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.
- # cd /usr/local/majordomo/lists
- # touch newlist
- # chown majordom newlist
- # 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. firstname.lastname@example.org).
- 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.
- 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
As in step 4, you may need to use email@example.com.
- 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 firstname.lastname@example.org
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.
Commonly Changed Configuration ItemsHere 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 <email@example.com> 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.
Sending all replies back to the listWhen 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 <firstname.lastname@example.org> Send reply to: Andrew <email@example.com> Date sent: Wed, 17 Feb 1999 10:09:27 +0000 To: firstname.lastname@example.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 <email@example.com> <firstname.lastname@example.org> Send reply to: email@example.com Date sent: Mon, 8 Feb 1999 22:12:27 +1300 To: firstname.lastname@example.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 = email@example.com
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 piecesThere 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
How to Reduce the Exposure of your List to Spam25 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