FEATURE(limited_masquerade)

Only masquerade MASQUERADE_DOMAIN hosts V8.8 and later

Ordinarily, addresses can be masqueraded if they are unqualified (lack a domain part) or if they match any hostname in $=w ($=w on page 876) or in the special class defined by the MASQUERADE_DOMAIN mc macro (MASQUERADE_DOMAIN mc Macro on page 600). Masquerading replaces the hostname part of an address with the fully qualified hostname defined by MASQUERADE_AS.

Some sites handle mail for multiple domains. For these sites, it is important to recognize all incoming mail as local via $=w. On the other hand, only a subset of the hosts in $=w should be masqueraded. Consider, for example, the host our.domain that receives mail for the domains his.domain and her.domain:

Cw our.domain his.domain her.domain

In this scenario, we want all but her.domain to be masqueraded as our.domain. The way to create such exceptions is with FEATURE(limited_masquerade).

FEATURE(limited_masquerade) causes masquerading to be based only on the special class defined by the MASQUERADE_DOMAIN mc macro (MASQUERADE_DOMAIN mc Macro on page 600) and not $=w. You use limited_masquerade like this:

MASQUERADE_AS(`our.domain')
FEATURE(`limited_masquerade')
LOCAL_DOMAIN(`our.domain his.domain her.domain')
MASQUERADE_DOMAIN(`our.domain his.domain')

Here, MASQUERADE_AS is declared first to define how masqueraded domains should be rewritten. Then, FEATURE(limited_masquerade) is declared. The LOCAL_DOMAIN declares all three domains to be recognized ...

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.