${client_resolve}
Result of lookup of ${client_name} V8.10 and later
When sendmail first assigns a
value to the ${client_name}
macro (${client_name} on page 812) it also looks up the hostname of
that connecting client with DNS. Table 21-9 shows the possible results of that lookup.
Table 21-9. Possible values for the ${client_resolve} macro
Value |
Meaning |
---|---|
|
The address lookup was successful. |
|
The lookup resulted in a permanent failure. |
|
The forward lookup doesn’t match the reverse lookup. |
|
The lookup resulted in a temporary failure. |
The ${client_resolve}
macro is useful in
the Local_check_rcpt
(Local_check_rcpt and check_rcpt
on page 257), Local_check_mail
(Local_check_mail and check_mail
on page 255), and Local_check_relay
(Local_check_relay and check_relay on page 252) rule sets. It can, for example, be
used to accept mail only from machines whose
hostname can be successfully looked up with
DNS:
LOCAL_RULESETS SLocal_check_mail R$* $: $&{client_resolve} ROK $@ Okay RTEMP $#error $@ 4.7.1 $: "450 Can't resolve hostname just now." R$* $#error $@ 5.7.1 $: "550 Sending hostname must resolve!"
Here, the first rule transfers the value of ${client_resolve}
into
the workspace. The $&
prefix (Use Value As Is with $& on page 793) prevents that macro from wrongly being expanded when the configuration file is read. The second rule accepts the address if it can be looked up. The third rule defers acceptance of any sender address that results in a temporary lookup error. The ...
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.