Next: , Previous: , Up: Library   [Contents][Index]

5.36 Blacklisting Functions

The functions described in this subsection allow to check whether the given IP address is listed in certain black list DNS zone.

Library Function: boolean match_dnsbl (string address, string zone, string range)

This function looks up address in the DNS blacklist zone zone and checks if the return falls into the given range of IP addresses.

It is intended as a replacement for the Sendmail macros ‘dnsbl’ and ‘enhdnsbl’.

To use match_dnsbl, require the match_dnsbl module (see Modules).

Arguments:

address

IP address of the SMTP server to be tested.

zone

FQDN of the DNSbl zone to test against.

range

The range of IP addresses in CIDR notation or the word ‘ANY’, which stands for ‘127.0.0.0/8’.

The function returns true if dns lookup for address in the zone dnsbl yields an IP that falls within the range, specified by cidr. Otherwise, it returns false.

This function raises the following exceptions: e_invip if address is invalid and e_invcidr if cidr is invalid.

Library Function: boolean match_rhsbl (string email, string zone, string range)

This function checks if the IP address, corresponding to the domain part of email is listed in the RHS DNS blacklist zone zone, and if so, whether its record falls into the given range of IP addresses range.

It is intended as a replacement for the Sendmail macro ‘rhsbl’ by Derek J. Balling.

To use this function, require the match_rhsbl module (see Modules).

Arguments:

email

E-mail address, whose domain name should be tested (usually, it is $f)

zone

Domain name of the RHS DNS blacklist zone.

range

The range of IP addresses in CIDR notation.


Next: , Previous: , Up: Library   [Contents][Index]