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.
Table 21-9. Possible values for the ${client_resolve} macro
OK
|
The address lookup was successful.
|
FAIL
|
The lookup resulted in a permanent failure.
|
FORGED
|
The forward lookup doesn't match the reverse lookup.
|
TEMP
|
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 line, that definition can
be ignored by sendmail. Note that
${client_resolve} is not
guaranteed to be available in the check_compat
rule set (Section 7.1.4). Also note that a
$& prefix is necessary when you reference this
macro in rules (that is, use
$&{client_resolve}, not
${client_resolve}).