General-Purpose Mail Filter
Site administrators often do not wish to accept mail from hosts that
do not have a proper reverse delegation in the Domain Name System.
In the previous section we introduced the library function
hostname, that looks up in the DNS the name corresponding to
the IP address specified as its argument. If there is no
corresponding name, the function returns its argument unchanged. This
can be used to test if the IP was resolved, as illustrated in the
require 'dns' prog envfrom do if hostname($client_addr) = $client_addr reject fi done
#require dns statement loads the module dns.mf,
after which the definition of
hostname becomes available.
A similar function,
resolve, which resolves the symbolic
name to the corresponding IP address is provided in the same
This document was generated on January 3, 2019 using makeinfo.Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.