14.2 Using Ezmlm with qmail

The most popular list manager used with qmail is ezmlm-idx, an extended version of Dan Bernstein's ezmlm. The original ezmlm has a very solid core of mailing list functions: subscription and unsubscription, message distribution and bounce management, and simple message archiving and retrieval. Unlike most list managers, ezmlm lets individual users run automatically managed private lists using subaddresses of their user addresses, as well as the more conventional arrangement where the system manager sets up a list with an address of its own. Ezmlm-idx adds more complex features such as digests, moderated lists, remote list management, and distributed lists with sublists. Nearly all ezmlm users use ezmlm-idx, because the basic ezmlm lacks now-essential abilities such as letting only list members post to a list. The following discussion all applies to ezmlm-index.

14.2.1 Installing Ezmlm-idx

Ezmlm-idx is a little bit tricky to install, because you have to combine the original ezmlm with the additions and patches for ezmlm-idx yourself. The easiest place to find the ezmlm and ezmlm-idx tarballs is http://www.ezmlm.org, where you can click the Download link near the top of the page to find a nearby archive with ezmlm-0.53.tar.gz and ezmlm-idx-0.40.tar.gz (or a newer version if available). While you're there, if you plan to run large lists (tens of thousands of addresses), you might also want to patch qmail, as discussed in Chapter 16, to increase the number of parallel deliveries above 255.

To install ezmlm-idx once you've installed the two archives:

  1. Unzip and untar ezmlm-0.53.tar.gz into a directory in any convenient place, creating a subdirectory ezmlm-0.53 containing the ezmlm files.

  2. Unzip and untar ezmlm-idx-0.40.tar.gz in the same directory, creating an adjacent subdirectory ezmlm-idx-0.40.

  3. Move all of the ezmlm-idx files, which include both new files and patching instructions for existing files, into the ezmlm directory:

    $ mv ezmlm-idx-0.40/* ezmlm-0.53
  4. Go into the ezmlm directory and apply the patches. The patch program should report that all of the patches succeeded. (If not, either you have an obsolete patch program and need to install the current GNU version, or the files in the ezmlm-0.53 directory were already modified, so delete the directory and recreate it from the .gz file.)

    $ cd ezmlm-0.53 $ patch <idx.patch Hmm...  Looks like a unified diff to me... The text leading up to this was: -------------------------- |--- ezmlm-warn.1       1998/02/17 00:32:45     1.1 |+++ ezmlm-warn.1       1998/12/21 04:35:16     1.5 -------------------------- Patching file ezmlm-warn.1 using Plan A... Hunk #1 succeeded at 3. Hunk #2 succeeded at 21.  ... more patch reports ... -------------------------- |--- ezmlm-weed.1       1999/08/01 16:45:46     1.1 |+++ ezmlm-weed.1       1999/12/19 16:53:18     1.3 -------------------------- Patching file ezmlm-weed.1 using Plan A... Hunk #1 succeeded at 7. Hunk #2 succeeded at 35. Hunk #3 succeeded at 113. done
  5. Look at the conf-* files, and adjust them if needed for your local C compiler and qmail installation. One file not present in other packages is conf-cron, the location of the crontab program used to schedule commands for periodic execution. You may also want to change conf-bin from the default /usr/local/bin/ezmlm to a directory that's in the standard search path, such as /usr/local/bin, to make it easier to type the commands to your shell. For now you can ignore conf-sqlcc and conf-sqlld, which are used to build a version of ezmlm-idx that stores its data in SQL databases. Now type make to build ezmlm and make man to format the manpages.

If you want to test ezmlm-index before installing it, INSTALL.idx has test instructions. Briefly, create a user account called eztest (or if you already have a test account set up for other purposes, edit the ezmlm-test script to set EZTEST to the account name), then su to the test account, and in the ezmlm-index build directory, run ./ezmlm-test:

$ ./ezmlm-test testing ezmlm-idx:    ezmlm-idx-0.40 Using FQDN host name:  your host name ezmlm-make (1/2):     OK Using RDBMS support:  No. testing for qmail:    >=1.02 ezmlm-reject:         OK ezmlm-[un|is]sub[n]:  OK ezmlm-send (1/2):     OK ezmlm-tstdig:         OK ezmlm-weed:           OK ezmlm-make (2/2):     OK ezmlm-clean (1/2):    removed mod queue entry 3 that wasn't due

Assuming it worked, become the super-user and make setup to install all the pieces you just built.

14.2.2 Ezmlm List Names

Every ezmlm list has a list name, which is an email address. The list's address is the submission address to which list mail is sent, with subaddresses used for subscription management, fetching archived articles, and bounce management. If an individual user has set up the list, the list address is a subaddress of the user's address, and all of the list's .qmail files and list-specific files are in a subdirectory of the user's home directory. Or the list can have an address of its own in the local domain, in which case its files are in ~alias because addresses that are neither user addresses nor subaddresses are treated as subaddresses of alias. Or the list can have an address in a virtual domain, using qmail's normal virtual domain features.

It's probably easiest overall to put public lists into a virtual domain, so the lists belong to the virtual domain's owner rather than to ~alias.

14.2.3 Creating an Ezmlm List

The ezmlm-make command creates and manages ezmlm mailing lists. It's not hard to use, but it's fussy about its arguments, particularly file and directory names that have to be specified as absolute paths. The information for each ezmlm list is stored in a directory full of files and subdirectories. (The ezmlm(5) manpage describes the directory's contents, nearly all of which is maintained automatically.) The directory name need not have any relation to the list name, although it's hard to think of a good reason to name the directory anything else. The directory is usually in the owning user's home directory or a subdirectory, although it can be anywhere so long as the user has write access.

Create a list with a user's subaddress; if the list were called joe-fishing@example.com:

$ # log in as joe $ ezmlm-make -u ~/fishing ~/.qmail-fishing joe-fishing example.com

The arguments are flags, the full pathname of the directory (abbreviated here with ~ that the shell expands), the full pathname of the list's .qmail file, the mailbox for the list, and the domain. The --u flag only permits subscribers to post to the list, and is highly recommended. Other options include --m to moderate the list and --d to create a digest version. See the ezmlm-make manpage for the entire huge list of options.

Along with the directory, ezmlm-make creates .qmail-fishing, .qmail-fishing-default, .qmail-fishing-owner, and .qmail-fishing-return-default, all linked to newly created files in the ~/fishing directory. If the list is moderated or has a digest version, there will be two more .qmail files for each of those options.

To create a list with a name in the local domain, become alias and run ezmlm-make:

$ # su to alias $ ezmlm-make -u ~alias/fishing ~alias/.qmail-fishing fishing example.com

Whoever administers this list has to su to alias to run administrative commands, which can be a security problem.

14.2.4 Ezmlm Lists in Virtual Domains

Not surprisingly, ezmlm meshes easily with qmail's virtual domains. If individual users want to run lists, each user who runs lists can have a virtual domain. Or a system that hosts a lot of lists can set up a master list management account controlling many lists in multiple domains. (Or both, of course.) To extend this example, assume that user joe wants to run a set of lists about fish. Create a virtual subdomain, add appropriate MX records in the DNS, and route the subdomain's mail with an entry in /var/qmail/control/virtualdomains:

ichthy.myvirt.com:joe

Now Joe can make as many lists as he wants:

$ # log in as joe $ ezmlm-make -u ~/flounder ~/.qmail-flounder flounder ichthy.myvirt.com $ ezmlm-make -u ~/tilapia ~/.qmail-tilapia tilapia ichthy.myvirt.com

This makes two lists, flounder@ichthy.myvirt.com and tilapia@ichthy.myvirt.com, both managed by Joe.

A larger system with multiple lists in multiple domains isn't much harder to set up. Create a user lists to be the list manager, and then map each virtual domain to a subaddress of the lists user:

fish.myvirt.com:lists-fish fowl.myvirt.com:lists-fowl fare.myvirt.com:lists-fare

To make it a little easier to keep track of all of the lists, each domain has a directory to hold its list directories:

$ # log in or su to lists $ mkdir fish fowl fare $ ezmlm-make -u ~/fish/scrod ~/.qmail-fish-scrod scrod fish.myvirt.com $ ezmlm-make -u ~/fowl/duck ~/.qmail-fowl-duck duck fowl.myvirt.com $ ezmlm-make -u ~/fare/stew ~/.qmail-fare-stew stew fare.myvirt.com

This creates three lists, one in each domain: scrod@fish.myvirt.com, duck@fowl.myvirt.com, and stew@fare.myvirt.com. This scheme scales up very well, easily handling a hundred domains each with a hundred lists. (Whether one host could handle the traffic for 10,000 lists is another question, although if the per-list traffic is modest and the computer is fast, the performance could be fine.)

One problem is that all of the .qmail files are in the home directory, and each list has four .qmail files, so that's 40,000 files in one directory, which most Unix systems won't handle well. If the lists are moderated or digested, it could be as many as 80,000 files. A small change to the virtual domain setup solves the problem by putting each domain's .qmail files in a separate directory:

fish.myvirt.com:lists-fish/q fowl.myvirt.com:lists-fowl/q fare.myvirt.com:lists-fare/q

Now the .qmail file for scrod@fish.myvirt.com, rather than being .qmail-fish-scrod, is .qmail-fish/q-scrod. Create directories .qmail-fish, .qmail-fowl, and .qmail-fare, each of which contains the .qmail files for a single domain with names like q-scrod, q-scrod-default, q-scrod-return, and q-scrod-return-default. Or if you want to put the .qmail files in the same directory as the list directories, rather than creating separate directories, just symlink the names:

ln -s fish .qmail-fish ln -s fowl .qmail-fowl ln -s fare .qmail-fare

I prefer this last approach. With a hundred lists, the domain's directory has a hundred list directories each with between 400 and 800 .qmail files, depending on list configuration, which is still a very manageable number.

14.2.5 Sending Mail to and Testing an Ezmlm List

To send mail to an ezmlm list, just send a message to the list's address. If you've used --u and haven't subscribed yourself, the message should bounce back with an error saying Sorry, only subscribers may post. Now subscribe to your list by sending mail to the list's subscription address. If the list is fishing@example.com, the subscription address is fishing-subscribe@example.com. Ezmlm should respond to your request with a confirmation message including a return address with a long random string to deter signup forgery. Respond to that message, and you should get a welcome message confirming that you're on the list. Now send another message to the list itself, which should show up shortly in your mailbox. You can check that it came through ezmlm by looking at the message headers that should include headers such as Mailing-List: and List-Post:. Now the list is ready to go, and anyone can subscribe and post to it. Unsubscribing works just like subscribing, so to get off the list, write to fishing-unsubscribe@example.com and respond to the confirmation message.

If you created a digest version of the list, the digest acts like a separate list whose name is the list name with -digest added, such as fishing-digest@example.com. Subscriptions work the same way, fishing-digest-subscribe@example.com and fishing-digest-unsubscribe@example.com. Subscribers to either version of the list post messages to fishing@example.com. The list of subscribers to the main list and the digest are kept separately so it's possible and occasionally useful to subscribe to both the regular list and the digest.

If you made the list moderated, you have to add the moderators' addresses using ezmlm-sub before anyone can post to the list. (See the next section.) Whenever someone posts a message to the list, the message is forwarded to all of the moderators in a message with instructions containing two return addresses, one to accept the message and one to reject it.

14.2.6 Configuring and Maintaining an Ezmlm List

Ezmlm comes with a long list of programs, some intended to be run from qmail when mail arrives, some to be run by list managers, and in a few cases, either way. To add addresses to a list, use ezmlm-sub:

$ ezmlm-sub ~/fishing mary@example.com fred@myvirt.com

For lists that allow posts only by subscribers, the subdirectory allow contains additional addresses that are allowed to post to the list, typically variant versions of subscriber addresses:

$ ezmlm-sub ~/fishing/allow mary.nade@example.com

If a list has a digest version, the digest subscribers are stored in the subdirectory digest:

$ ezmlm-sub ~/fishing/digest edgar@example.org

If a list is moderated, the moderators are stored in the subdirectory mod:

$ ezmlm-sub ~/fishing/mod jane@myvirt.com

(The list of moderators is unrelated to the list of subscribers. If a moderator should be subscribed to the list, add the address separately to the list and the moderator list.)

To take people off a list, use ezmlm-unsub:

$ ezmlm-unsub ~/fishing mary@example.com          # leave the list $ ezmlm-unsub ~/fishing/allow mary.nade@example.com # alternate address, too $ ezmlm-unsub ~/fishing/digest edgar@example.org  # leave the digest $ ezmlm-unsub ~/fishing/mod jane@myvirt.com       # stop moderating

The boilerplate messages used by ezmlm for subscription request responses, bounce probes, and so forth are kept in files in the text subdirectory of the list directory. The standard messages aren't bad, but to customize them for a particular list, just edit the text files. The files contain codes like <#l#> for the list name that are expanded each time one of the boilerplate messages is sent.

Addresses that bounce are automatically tracked. If an address bounces consistently, ezmlm sends a final probe message and, if the probe bounces, removes the address from the list. In most cases, the bounce management works completely automatically. The only exception is for remote mail systems that mangle the VERP envelope return address so that ezmlm cannot figure out what address is bouncing.

14.2.7 Other Ezmlm Tricks and Features

Ezmlm has provisions for list administration by email for managers without shell access; for message archives, including both mail-based and web-based indexes and retrieval; and a wide variety of other list options, such as rejecting some or all MIME attachments and adding boilerplate text to messages or digests. Ezmlm, like qmail, is built from a collection of small programs run from shell scripts, so even if a particular feature isn't present, it's often possible to adapt the existing programs to do what you want.

For further information, consult the included documentation, which includes manpages for all 30 ezmlm programs, as well as http://www.ezmlm.org where there is both a FAQ and a 30-page printable manual.



qmail
qmail
ISBN: 1565926285
EAN: 2147483647
Year: 2006
Pages: 152

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net