FEATURE(genericstable)

Transform sender addresses V8.8 and later

The User Database (userdb on page 942) allows recipient addresses to be changed so that they can be delivered to new hosts. For example, can be transformed with the User Database into . 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 (GENERICS_DOMAIN mc macro on page 624). If you want subdomains to also match, you must declare FEATURE(generics_entire_domain) (FEATURE(generics_entire_domain) on page 622). Ways to list domains in that special class are outlined later in this chapter.

The makemap(1) program (The makemap Program on page 370) is then used to convert this file into a database:

makemap hash db_file <  text_file

Here, db_file is the name ...

Get sendmail, 4th 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.