An important but tedious part of a transition from sendmail to qmail is to convert /etc/aliases. There are two general strategies. The first is to create a .qmail file in ~alias corresponding to each entry, which works fine for small alias files but becomes unwieldy after a few dozen entries. The other is to install the fastforward package (described at the end of Chapter 4) which handles a version of /etc/aliases pretty close to sendmail's, and then just adjust the alias entries that fastforward doesn't handle well. When sendmail runs a program for a delivery from the aliases file, it uses a variety of heuristics to decide which user runs the program. Qmail's model is much simpler: all programs run from ~alias, including fastforward when it does /etc/aliases deliveries, are run as the alias user. In most cases that's fine for deliveries that don't store messages or update files. For deliveries that do store messages or update files, you may need to rewrite the delivery rules to be sure that they're run as the appropriate, user as described next. 5.4.1 Address ForwardingThe syntax for addressing forwarding is: address1: address2 address1: address2, address3, address4 Alias entries that just forward one address to another can be left in aliases as is. To rewrite them as a .qmail file instead, create ~alias/.qmail-address1 and put address2 in it. If an address is forwarded to multiple addresses, put each one on a separate line in the .qmail file. 5.4.2 Mailing ListsThe syntax for mailing lists is: mylist: :include: /usr/fred/listfile owner-mylist: fred fastforward's aliases emulation supports sendmail-style lists directly. The only difference is that the included file has to be compiled into a .bin file using newinclude, as described in Chapter 4. Although included lists are most easily handled by fastforward, it's also possible to convert them to .qmail files. Copy listfile to ~alias/.qmail-mylist, stripping out any address comments that aren't permitted in .qmail files, and create ~alias/.qmail-owner-mylist containing the address of the list owner. Qmail provides more facilities for list management, including easy ways for users to handle their own lists. See Chapter 14. 5.4.3 Program DeliveriesThe syntax for program deliveries is: progaddr: "|someprogram -flags" Program deliveries are supported by fastforward, so long as it's acceptable to run the programs as the alias user. To run programs as any other user, rewrite the delivery instructions to forward to a subaddress of the desired user. If, for example, this program should run as user fred, change the aliases entry to: progaddr: fred-progaddr Then as user fred, create ~fred/.qmail-progaddr with instructions to run the program: |someprogram -flags Program delivery lines in .qmail files start with a vertical bar and feed everything after the bar to the shell. See Chapter 10 for details of how qmail runs program deliveries. |