Sendmail Virtual Domains ------------------------------------------------------------- This document contains an outline on how to alias full user@domain to another local user. With the Cw directive, you can let Sendmail deliver mail for the specified domain. The disadvantage to this approach is that you cannot alias the same login to different domains; for example, webmaster@dom1.com would go to the same person as webmaster@dom2.com. Same goes for sales, info and other important aliases you can sell. For it to work, you need to have a Sendmail with Berkeley db(1) support. This means compilation with -DNEWDB and linking with -ldb. See the Makefile in the src/obj* directory for more information. In /etc/sendmail.cf, you need to specify a db file for the maildomain lookup: Kmaildomains hash /etc/maildomains.db Also, the following rule needs to be added: ################################################################### ### Ruleset 98 -- local part of ruleset zero (can be null) ### ################################################################### # Try to remap domains via /etc/maildomains. S98 R$+ < @ $+ . > $: $1 < @ $2 > . R$+ < @ $+ > $* $: $(maildomains $1@$2 $: $1 < @ $2 > $3 $) R$+ < @ $+ > $* $: $(maildomains $2 $: $1 < @ $2 > $3 $) R$+ < @ $+ > . $: $1 < @ $2 . > It is possible to integrate all this into the m4 system Sendmail uses to generate its config file. My config.mc is available online. (You can use the LOCAL_RULE_0 directive to set up S98.) I have also modified some things in the cf/ directory, most notably the handling of so-called plussed users (I use = instead), and some comments for clarity. /etc/maildomains contains the following fields, separated by tabs: webmaster@dom1.com userthatdoestheirwww sales@dom2.com salesdroidfordom2 dom2.com dom2owner This means, that all mail to webmaster@dom1.com will go to userthatdoestheirwww. Same for sales@dom2.com. All mail addressed to anything@dom2.com will be dropped into dom2owner's mailbox. To create the necessary db(1) files, run the following command: # makemap hash /etc/maildomains.db < maildomains Instead of hash, you can also specify btree. You will also have to change this in /etc/sendmail.cf. Note: dbm does not work in this case! Note that procmail(1) can be a very nice thing to have: you can mail to user+webmaster, for example, and that user can sort his/her mail into different mailboxes, using procmail(1). (If you have applied a part of my diff, it would of course be user=webmaster.) ---------------------------------------------------------------------------- [-Niels' Home Page-] Comments [-Mail-] PGP Key [-PI NL-]