Appendix b
Appendix b
The technique described in this chapter will help you map e-mail
addresses to a system mailbox. While in most installations you won't
have to worry about this because UNIX will handle this for you, more
complex installations that make use of virtual do mains will probably
require you to provide some sort of e-mail address support.
The user portion usually matches the login name of a local user. It
can also be an alias to a different user or a distribution list for
many other users in the system. As you may be aware, you cannot create
two identical login names on the same machine under UNIX. It would
also be unwise to create an alias that matched an existing user's
login name. If you did create such an inconsistency, the results will
be unexpected and more than likely not be what you want. Mail
addressed to the user will e nd up delivered to someone else.
[email protected] [email protected]
[email protected] [email protected]
[email protected] [email protected]
you'll need a way to map the full e-mail address to use an external
database. You will also need to do some minor Ruleset rewriting in the
sendmail.cf. Many Internet Service Providers have asked for a general
solution to this problem, and here's the so lution.
[email protected] [email protected]
[email protected] [email protected]
[email protected] [email protected]
The left column contains the e-mail address of a particular user, and
the right column contains the corresponding mailbox. If you maintain
several domains, you may want to create several databases (one per
domain) and cat them together (using th e UNIX cat program) prior to
compilation. This may make it easier to maintain domain aliases for a
domain in the future because maps for each domain are saved on their
own file.
The following example may closely match your needs. Some of the
destination addresses are forwarded to other domains for resolution
([email protected]). Others will be remapped to other addresses
that will require reprocessing and derefencing the ad dress several
times before arriving at the final mailing address
([email protected]):
[email protected] [email protected]
[email protected] [email protected]
[email protected] [email protected]
[email protected] [email protected]
[email protected] [email protected]
[email protected] joeuser
Note that you need to write the complete e-mail address in the left
column. The right column entry can be a local address (for example
johan if that account exists) or a complete e-mail address on another
system (or a domain the server recognizes as lo cal).
After you build the ASCII representation of the database, you'll need
to compile it into a more efficient lookup table using the makemap
utility that came with your sendmail distribution (if your system
supports hash, dbm or btree, you can use those co mmands instead).
Your command will look something like the following:
Edit the ruleset 98 section (S98) and add the following inside the
ruleset. Which modifications you make will depend on the version of
sendmail you are using.
Restarting sendmail
Summary
This technique will make it easier for you to support multiple info
and webmaster mailboxes for the various domains you host. Because the
various mapping are external to the sendmail configuration file,
adding and deleting entries are much easier to ma intain than would
otherwise be possible.