Name

FEATURE(genericstable)

Synopsis

The User Database (userdb) allows recipient addresses to be changed so that they can be delivered to new hosts. For example, gw@wash.dc.gov can be transformed with the User Database into george@us.edu. The genericstable provides the same type of transformation on the sender’s address.

To begin, create a file of the form:

user                newuser@new.host.domain
user@host.domain    newuser@new.host.domain

In it, each line begins with the old address, either the user part alone, or the full address. On the right is the new address for that sender. One example of a use for this table might be to make the user news always appear as though it was from the news machine:

news            news@news.our.domain
news@our.domain news@news.our.domain

Note that the bare user part (news in the first line) is looked up only if sendmail considers it to be in the local domain. If a domain is listed (as in the second line in the preceding example) that entry is looked up only if it is in a special class defined with the GENERICS_DOMAIN mc macro (Section 4.8.1). If you want subdomains to also match, you must declare the generics_entire_domain feature (FEATURE(generics_entire_domain)). Ways to list domains in that special class are outlined later in this chapter.

The makemap(1) program (Section 5.5) is then used to convert this file into a database:

makemap hash db_file <  text_file

Here, db_file is the name you give to the created database, and text_file is the name of the source text file.

Note ...

Get Sendmail, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.