10.5 Special Forwarding Features for Mailing Lists

Qmail has some relatively obscure features that make it easier to use .qmail files to manage mailing lists. They rewrite the envelope sender on forwarded messages that are remailed to forwarding addresses in .qmail files, so that bounces come back to the list owner, who can do something about them, rather than to the original sender, who can't. They can also rewrite the sender address in a special form that tells qmail-send to create per-recipient sender addresses, known as Variable Envelope Return Paths (VERPs). The rewritten sender address is used on any forwards, and is also placed in the NEWSENDER variable for command deliveries. Although these features are mostly used by automated list management packages such as ezmlm (see Chapter 14), they can also be useful for small manually maintained lists.

If the local part of the recipient address is user-ext and there is a file .qmail-ext-owner, qmail-local changes the sender address to user-ext-owner. If there is both .qmail-ext-owner and .qmail-ext-owner-default, qmail-local changes the sender address to user-ext-owner-@host-@[ ]. This latter address will be rewritten again by qmail-send.

Assume as an example that you're user fred@example.com, and you have a list fred-fishing. You list all of the recipients in .qmail-fishing, and set the execute bit on that file to tell qmail that it's a list so all of the entries are forwards. Now any mail sent to fred-fishing@example.com is forwarded to all of the people listed in the qmail file. But what if one of the recipient addresses bounces? The bounce goes back to the original sender. To fix that problem, create a file .qmail-fishing-owner, which stores responses in a mailbox or forwards them to someone who can read and act on them. (A simple &fred puts them in your regular mailbox.) Now mail to the list is resent with an envelope sender of fred-fishing-owner@example.com, which will be handled by .qmail-fishing-owner. For manually handled lists that's probably adequate, but to finish the example, let's also create .qmail-fishing-owner-default and put these lines in it:

| echo "$DEFAULT" | sed 's/=/@/' >> badaddrs ./fishingbounces

Now mail to the fishing list is queued with an envelope sender of fred-fishing-owner-@example.com-@[ ]. When qmail-send processes each recipient address, it further translates the sender address so that a message sent to, say, margaret@domain.com is sent to the recipient host with a sender address of fred-fishing-owner-margaret=domain.com@example.com. If that message bounces, the bounce is handled by .qmail-fishing-owner-default. The first line in that file takes $DEFAULT, which in this case is margaret=domain.com, changes the equals sign back to an at-sign, and appends the bouncing address to badaddrs. Then it saves the bounce in a mailbox, in case a person wants to look at it. In a more realistic case, the address from the bounce is used to remove the bad address from the list. A complete bounce handler is also needed to analyze mail to fred-fishing-owner-@example.com (that is, with a null $DEFAULT) since mail addresses for which qmail can't even attempt a delivery bounce differently. I cover that in more detail in Section 10.7.



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