Name
${addr_type}
Synopsis
Some rule sets are passed only a recipient or a sender address,
supplied from either a header or the envelope. Examples are rule sets
1 and 2, and the rule sets indicated by the R= and
S= equates. Other rule sets, such as the
canonify rule set 3, can be called with any
combination.
When designing rules, it might be necessary to know whether those
rules are dealing with a sender or a recipient, and whether the
address is from the envelope or a header. Beginning with V8.10,
sendmail offers the
${addr_type} macro as a means to solve that very
problem. As shown in Table 21-8 the
${addr_type} macro can hold any of several pairs
of characters, depending on whether the address is from the envelope
or a header, and whether the address is that of a sender or a
recipient.
|
Value |
Meaning |
|
|
An envelope sender address |
|
|
An envelope recipient address |
|
|
A header recipient address or header sender address |
To illustrate one use for this ${addr_type}
macro’s value, consider a rule set that screens
addresses and rejects any that are found in a database of spam sender
hosts:
LOCAL_CONFIG Kspammers hash /etc/mail/spammers LOCAL_RULESETS SDomainLookup R $+ <@ $=w .> $@ OK local users are always OK R $+ <@ $+> $: $1 <@ $2 > <$&{addr_type}> R $+ <@ $+> <e r> $@ OK we only screen envelope senders. R $+ <@ $+> <h> $@ OK we don't screen header addresses. R $+ <@ $+> <$*> $(spammers $2 $: OK $) R OK $@ OK R $* $@ ERROR ...Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access