View Source z_email_dnsbl (zotonic_stdlib v1.23.1)

Check an IP address against some DNSBL providers (rfc5782)

Summary

Functions

Default list of DNSWL services

Default list of DNSBL services

Check if the IP address is on one of the default blocklists.

Check if the IP address is on one of the given blocklists.

Check if the IP address is on one of the given blocklists and not on one of the white lists. If an IP address is white listen then this routine always return true.

Check the block- or allowlist status of an IP address. If it is blocked then the blocklists where the IP address is blocked are returned.

Check the block- or allowlist status of an IP address with the given block lists. If it is blocked then the blocklists where the IP address is blocked are returned.

Check the block- or whitelist status of an IP address with the given block- and whitelists. If it is blocked then the blocklists where the IP address is blocked are returned.

Functions

dns_allowlist()

-spec dns_allowlist() -> [string()].

Default list of DNSWL services

dns_blocklist()

-spec dns_blocklist() -> [string()].

Default list of DNSBL services

is_blocked(IP)

-spec is_blocked(inet:ip_address()) -> boolean().

Check if the IP address is on one of the default blocklists.

is_blocked(IP, RTBLs)

-spec is_blocked(inet:ip_address(), [string()]) -> boolean().

Check if the IP address is on one of the given blocklists.

is_blocked(IP, RTBLs, WLs)

-spec is_blocked(inet:ip_address(), [string()], [string()]) -> boolean().

Check if the IP address is on one of the given blocklists and not on one of the white lists. If an IP address is white listen then this routine always return true.

status(IP)

-spec status(inet:ip_address()) -> {ok, notlisted | allowed | {blocked, [string()]}}.

Check the block- or allowlist status of an IP address. If it is blocked then the blocklists where the IP address is blocked are returned.

status(IP, DNSBLs)

-spec status(inet:ip_address(), list()) -> {ok, notlisted | allowed | {blocked, [string()]}}.

Check the block- or allowlist status of an IP address with the given block lists. If it is blocked then the blocklists where the IP address is blocked are returned.

status(IP, DNSBLs, DNSWLs)

-spec status(inet:ip_address(), list(), list()) ->
                {ok, {blocked, list()}} | {ok, notlisted} | {ok, allowed}.

Check the block- or whitelist status of an IP address with the given block- and whitelists. If it is blocked then the blocklists where the IP address is blocked are returned.