Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your profile (name, country/region, and company) is displayed to the public and will accompany any content you post. You may update your IBM account at any time.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

LPI exam prep: Mail and news

Intermediate Level Administration (LPIC-2) topic 206

David Mertz (mertz@gnosis.cx), Developer, Gnosis Software
David Mertz
David Mertz has been writing the developerWorks columns Charming Python and XML Matters since 2000. Check out his book Text Processing in Python. For more on David, see his personal Web page.

Summary:  This is the second of seven tutorials covering intermediate network administration on Linux. In this tutorial, David Mertz discusses how to use Linux as a mail server and as a news server. Overall, e-mail is probably the main use of the Internet, and Linux is perhaps the best platform for e-mail services. This tutorial covers mail transport, local mail filtering, and mailing list maintenance software. It also briefly discusses server software for the NNTP protocol.

29 Mar 2012 - In response to reader feedback, updated URLs to "INN home page," "LPIC Program," and "list of Sendmail books" links in Resources.

View more content in this series

Date:  29 Mar 2012 (Published 22 Nov 2005)
Level:  Intermediate PDF:  A4 and Letter (291 KB | 15 pages)Get Adobe® Reader®

Activity:  46084 views
Comments:  

Configuring mailing lists

What does Majordomo do?

A mailing list manager program is basically a local extension for a mail transport program (MTA) such as Sendmail. Basically, the MTA running on a system passes off a set of addresses to the control of the mailing list manager, and the mailing list manager modifies, processes, and perhaps re-mails the messages it receives. Some messages received by a mailing list manager are messages meant for distribution to the mailing list itself (perhaps needing to be verified for permission to distribute to the list(s). Other messages are control messages that change the status of the mailing list, such as the subscription options of a particular subscriber. A mailing list manager does not perform mail delivery itself, but passes that function to its supporting MTA.

As the introduction to this tutorial stated, Majordomo is not currently the state-of-the-art choice for mailing lists. Rather, the best choice for a new installation of a mailing list is probably Mailman. Majordomo, however, is still perfectly functional and is installed on many older systems which continue to operate without problem (sometimes supporting lists that have been operational for many years).

There is a wrinkle with Majordomo versions, however. Some years ago, a rewrite of the Majordomo 1.x series was started, called Majordomo2. Unfortunately, that rewrite fizzled out without ever reaching release status. While Majordomo2 (in a beta version) may be used in a very small number of systems, Majordomo 1.9.5 is the most recent stable version and is the version discussed in this tutorial.


Installing Majordomo

You can obtain an archive of the Majordomo software at the Majordomo site (see Resources for a link).

After unpacking a file that will be named something like majordomo-1.94.5.tgz, be sure to read the INSTALL file carefully. You need to follow all the steps it describes for getting a working Majordomo system. Building the system uses the usual make; make install steps of most source installs, as well as make install-wrapper. The install can and should verify itself with a command like cd /usr/local/majordomo-1.94.5; ./wrapper config-test (the make install provides details in a message).

Before building, modify the Makefile and create and/or modify majordomo.cf. As a starting point, you can copy the latter file from sample.cf in the source distribution. In the Makefile, a number of environment variables are set, but the most critical and subtle of these is probably W_GROUP. This is the numeric gid of the group Majordomo will run under, almost always the group "daemon." The gid for daemon is 1 on most systems, but be sure to check using the following:

$ id daemon
uid=1(daemon) gid=1(daemon) groups=1(daemon)

Other variables in Makefile include PERL for the path to the interpreter, and W_HOME for the location where Majordomo will be installed.

Your new majordomo.cf file also needs to be edited before the make install. The Perl variables that need to be modified appear mainly near the top of the file. Definitely adjust $whereami and $homedir, and examine the others to make sure they are sensible.


Telling Sendmail to use Majordomo

The final step in installation is convincing Sendmail to talk with Majordomo. Within the /etc/sendmail.cf file, this involves a line like this:

OA/path/to/majordomo/majordomo.aliases

If you use the M4 processor to generate Sendmail configuration files, you can use a line like this:

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

The sample majordomo.aliases contains some sample values:


Listing 1. Sample majordomo.aliases
                    
majordomo:  "|/usr/test/majordomo-1.94.5/wrapper majordomo"
majordomo-owner: you
owner-majordomo: you
test:           "|/usr/test/majordomo-1.94.5/wrapper resend -l test test-list"
test-list:      :include:/usr/test/majordomo-1.94.5/lists/test
owner-test:     you
test-owner:     you
test-request:   you

These, of course, need to be customized for your particular setup. In particular, "you" means the name of the list administrator (who is not necessarily the overall system administrator).


Creating a new Majordomo list

The sample setup given above created a list called "test," with addresses for "test-owner," "test-request," etc. for administering the list. In real use, you will probably want lists with other names. To accomplish that, do the following:

  1. Switch to the directory $listdir, as defined in majordomo.cf.

  2. Create files called my-list-name and my-list-name.info (adjust appropriately); chmod them to 664. The latter file contains an introduction to the list.

  3. Create several aliases in your majordomo.aliases file, following the pattern of the "test" examples -- for example, "foo-owner," "foo," "foo-request," and so on.

  4. Send requests to subscribe, unsubscribe, signoff, and so on, for members of the list.

  5. Create an archive directory in the location specified by the $filedir and $filedir_suffix variables.

  6. Create a digest subdirectory under $digest_work_dir. Use the same name as the digest list (for example: test-digest).

  7. Make sure everything is owned by user majordomo, group majordomo, and is writeable by both owner and group (in other words, mode 664 for files and mode 775 for directories).

  8. Issue a config <listname> <listname>admin command to Majordomo. This will cause it to create a default configuration file for the list, and send it back to you.

3 of 8 | Previous | Next

Comments



static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Linux
ArticleID=132975
TutorialTitle=LPI exam prep: Mail and news
publish-date=03292012
author1-email=mertz@gnosis.cx
author1-email-cc=