There are several ways to manage a mailing list. The most commonly available methods under Unix are direct use of aliases in the MTA (most often sendmail)and the Majordomo list server. Which method to use depends on the size and complexity of the mailing list. Using aliases in the MTA is typically only useful for a mailing list with a small number of recipients that do not change often, as every change in the list structure involves human intervention. Majordomo automates many mailing list functions, which makes large mailing lists easier for to manage.
Creating a mailing list using sendmail simply involves creating some new aliases. (The procedure for creating mail aliases is described in the previous section). There are usually three addresses associated with the list:
For example, suppose we want to set up a mailing list on foo.bar.com for developers of a widget, called "widget-dev". The manager of this list would be joe@foo.bar.com, and the mailing list members would be baz@foo.bar.com, zippy@pinhead.com, and hoosier@indiana.edu. The following would be added to the sendmail aliases file (usually /etc/aliases) on foo.bar.com:
widget-dev: baz@foo.bar.com, zippy@pinhead.com, hoosier@indiana.edu widget-dev-request: joe owner-widget-dev: widget-dev-request
In this case, owner-widget-dev has been aliased to point to the same address as widget-dev-request.
If a mailing list is larger than just a few recipients, it is sometimes too cumbersome to keep all of the information in the aliases file. In this case, the list of addresses is kept in a file, and is referred to by the sendmail :include: directive. (Note that not all versions of sendmail support file inclusion; see the documentation for your version of sendmail for details). So, following the previous example, the list of recipients will be moved to the file /home/lists/widget-members. The file will typically look like this:
baz@foo.bar.com zippy@pinhead.com hoosier@indiana.edu . .
The aliases file is changed to look like this:
widget-dev: :include:/home/lists/widget-members widget-dev-request: joe owner-widget-dev: widget-dev-request
Include files might also be used for widget-dev-request and owner-widget-dev if a number of people manage the list.
Always remember to run newaliases after modifying any mailing list addresses.
Under the simple setup outlined above, mail that bounces from any of the addresses on the mailing list will go back to the sender, rather than the list administrator (except under sendmail version 8; see below). This is obviously not a good idea, since the list administrator is the only one who can remedy the situation. One solution to this problem is to run a new sendmail process for every message sent to the list. This requires creating a new alias to refer to the recipients of the list; using our above example, the new alias will be called widget-dev-recipients. The new alias file will look like this:
widget-dev: "|/usr/lib/sendmail -fowner-widget-dev -oi widget-dev-recipients" widget-dev-recipients: :include:/home/lists/widget-members widget-dev-request: joe owner-widget-dev: widget-dev-requestThis tells sendmail to create a new envelope for mail sent to widget-dev. All mail that is distributed to the widget-dev list will have a Return-Path: address of owner-widget-dev@foo.bar.com, so that errors will go to the list owner rather than to the original sender.
One problem with this setup is that the sendmail -f option only works for trusted users such as root or daemon. This is fine for mail sent from off-site, but will not work for local users. Local users may have to use the widget-dev-recipients address instead. Another solution is to keep the mailing list on a machine where none of the members have accounts. This is a workable solution if you already use a dedicated mail server.
Note: Under sendmail version 8, if a mail alias contains a corresponding alias with an "owner-" prefix, bounces and errors for that list will automatically be sent to the owner- address.
For large mailing lists that change frequently, it is usually impractical to use mail aliases, since every change requires the list administrator's personal attention. Majordomo is a set of Perl scripts to automate many mailing list tasks. Although it does not eliminate the need for human intervention, it makes list management easier.
Advantages to using Majordomo include:
For an excellent tutorial and manual on Majordomo, see the nabyal.
The Majordomo Frequently Asked Questions list is also available. Other information about Majordomo, as well as the Majordomo source distribution, can be found at the official Majordomo distribution site.
Terms used: mailing list, sendmail, mail alias, MTA, mail server.