Chapter 11. Mail & News (2.206)

Revision: $Revision: 1.8 $ ($Date: 2004-01-29 20:32:13 $)

This objective has a weight of 9 points and contains the following objectives:

Objective 2.206.1; Configuring mailing lists (1 point)

Install and maintain mailing lists using Majordomo. Monitor Majordomo problems by viewing Majordomo logs.

Objective 2.206.2; Using Sendmail (4 points)

Candidates should be able to manage a Sendmail configuration including email aliases, mail quotas, and virtual mail domains. This objective includes configuring internal mail relays and monitoring SMTP servers.

Objective 2.206.3 Managing Mail Traffic (3 points)

Candidates should be able to implement client mail-management software to filter, sort and monitor incoming user mail. This objective includes using software such as procmail on both server and client side.

Objective 2.206.4; Serving News (1 point)

Candidates should be able to install and configure news servers using inn. This objective includes customizing and monitoring served newsgroups.

Configuring mailing lists (2.206.1)

Install and maintain mailing lists using Majordomo. Monitor Majordomo problems by viewing Majordomo logs.

Key files, terms and utilities include:

Majordomo2

Installing Majordomo

Majordomo is a program which automates the management of Internet mailing lists. Commands are sent to Majordomo via electronic mail to handle all aspects of list maintenance. Once a list is set up, virtually all operations can be performed remotely, requiring no other human intervention.

The INSTALL file contained in the distribution of Majordomo (available from the website), contains very good instructions on installing Majordomo. We will not repeat the entire INSTALL document, but only give a brief outline.

  1. Create a user called majordomo. This user should be in the group daemon, the home directory should be the installation directory and the shell /bin/false.

  2. Edit the Makefile. Define the proper locations of perl, the C compiler and the home directory of the majordomo user (i.e., the installation directory). Also set the user and group id's. Read the entire file for any other values that need to be changed.

  3. Copy sample.cf to majordomo.cf and edit the latter. Most variables are self-explanatory and well-documented.

  4. Type make wrapper and check for errors. This will create the wrapper program that will parse all requests made to Majordomo.

  5. As root, type make install and make install-wrapper. This will install Majordomo and the wrapper.

  6. Add the Majordomo-related aliases to your Sendmail aliases. This is best done by adding the following line to your sendmail.mc:

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

    Change /path/to/majordomo/majordomo.aliases to the real name of the Majordomo aliases file. Now add the following aliases to that file:

    majordomo: "|/path/to/majordomo/wrapper majordomo"
    owner-majordomo: you
    majordomo-owner: you
    

    Change you to your username or E-mail address.

  7. Test the installation. Change to the Majordomo installation directory and, as a normal user, type ./wrapper config-test. This will test the configuration of Majordomo. Fix any errors and run again. When the process is complete, and there are no errors, config-test will offer to register your installation of Majordomo by sending information on your operating system, your Perl version and the address of the Majordomo owner to the Majordomo maintainers.

    If you configured sendmail with the restricted shell feature (smrsh), do not forget to put a link to wrapper in the smrsh directory.

Creating a Mailing list

Creating a mailing list consists of two steps: create the proper aliases for sendmail and create the necessary files for Majordomo to recognize the list. This should be done by the maintainer of the mailinglist server (probably root).

In the following sections, we will assume that Majordomo is installed in /usr/local/majordomo/, and that we want to create a mailinglist called lpic2-examprep.

Aliases

Create the following aliases in either majordomo.aliases or aliases:

lpic2-examprep:          "|/usr/local/majordomo/wrapper resend \
                          -l lpic2-examprep lpic2-examprep-list"
lpic2-examprep-list:     :include:/usr/local/majordomo/lists/lpic2-examprep
owner-lpic2-examprep:    bmesman@snow.nl
lpic2-examprep-owner:    bmesman@snow.nl
lpic2-examprep-request:  "|/usr/local/majordomo/wrapper majordomo \
                          -l lpic2-examprep"
lpic2-examprep-approval: bmesman@snow.nl

The lpic2-examprep-request alias makes it possible to send a message to this alias with a body containing subscribe to subscribe to the mailinglist. Without this alias, the only way to subscribe to the list is sending an E-mail to majordomo with subscribe lpic2-examprep in the body.

The aliases are setup in such a way that E-mail to the list will be passed through resend to catch Majordomo commands before passing them on to the actual list.

For more information on aliases, consult the NEWLIST file in the Majordomo distribution.

Do not forget to run the newaliases command, to update the actual aliases database.

Majordomo Files

In /usr/local/majordomo/lists/ create a file lpic2-examprep:

cd /usr/local/majordomo/lists
touch lpic2-examprep

This file will contain the E-mail addresses of the subscribers. Leave it empty for now.

Create the file lpic2-examprep.info with introductory info about the list:

echo "Discussionlist for LPIc2 exam preparation" > lpic2-examprep.info

The owner of the mailing list can always change the introduction with a simple E-mail (see the section called “Maintaining a Mailinglist”).

Both files should be owned by user majordomo and group daemon and should be group writable.

chown majordomo.daemon lpic2-examprep lpic2-examprep.info
chmod 664 lpic2-examprep lpic2-examprep.info

Now everything is set up properly. All that remains to be done is generating a default configuration file for the mailinglist by sending an E-mail to majordomo@company.com:

echo "config lpic2-examprep lpic2-examprep.admin" | mail majordomo@company.com

Majordomo will create a default configuration file (lpic2-examprep.config) and send it to the list owner. The list owner can change the configuration (e.g., the list password!) and use the newconfig command to send it back.

Maintaining a Mailinglist

After a mailinglist is set up, all maintenance can be done remotely by sending an E-mail to majordomo@company.com. Maintenance commands should be put in the body of the message. The Subject: header will not be parsed by Majordomo. Available commands include:

lists

Show the lists available on this Majordomo server.

info <list>

Retrieve the general introductory information for the named <list>.

subscribe <list> [<address>]

Subscribe yourself (or <address> if specified) to the named <list>. Depending on the configuration of the mailinglist, you may be added directly or you may be asked to authorise the request (to prevent other people subscribing you to unwanted lists).

unsubscribe <list> [<address>]

Unsubscribe yourself (or <address> if specified) from the named <list>. unsubscribe * will remove you (or <address>) from all lists. This may not work if you have subscribed using multiple addresses.

intro <list>

Retrieve the introductory message, containing list policies and features. This is also sent when you subscribe to a list.

newintro <list> <password>

Replace the information file that people get when they subscribe or do a intro <list>. It reads everything after the newintro command to the end of the message or the word EOF on a line by itself as the new intro for the list.

newinfo <list> <password>

Replace the information file that people get when they do info <list>. (This file is also sent as the intro if the intro file does not exist.) This reads everything after the newinfo command to the end of the message or the word EOF on a line by itself as the new info for the list.

passwd <list> <old_passwd> <new_passwd>

This will change the list password.

config <list> <password>

Retrieves a self-documenting configuration file for the list <list>.

newconfig <list> <password>

Validates and installs a new configuration file. It reads everything after the newconfig command to the end of the message or the word EOF on a line by itself as the new configuration for the list. The config file is expected to be a complete config file as returned by config. Incremental changing of the config file is not yet supported. As soon as the config file is validated and installed its settings are available for use. This is useful to remember if you have multiple commands in your mail message since they will be subject to the settings of the new config file. If there is an error in the config file (incorrect value...), the config file will not be accepted and an error message identifying the problem line(s) will be returned to the sender. Note that only error messages are returned to the sender, not the entire config file, so it would be a good idea to keep a copy of your outgoing email message.

Copyright Snow B.V. The Netherlands