Name
${client_resolve}
Synopsis
When sendmail first assigns a value to the
${client_name}
macro (${client_name}), it also looks up the hostname of that
connecting client with DNS. Table 21-9 shows the
possible results of that lookup.
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
(Section 7.1.3)
and Local_check_mail
(Section 7.1.2) 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 (Section 21.5.3)
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 last rule
bounces mail from any host that cannot be looked up, or that appears
to be a forged address.
${client_resolve}
is transient. If it is defined in the configuration file or in the command ...
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.