API

DNSBL checking SMTPD-Proxy on gevent steroids

fu.resolve(zone)

Checks if the name resolves and if the last part of the reply is >= the predicate.

Parameters:zone (string) – A valid zone for lookup ex: ‘234.52.218.89.ix.dnsbl.manitu.net.’
Return type:integer
fu.as_reversed(ip, suffix)

Reverses the ipv4 so that it can be checked >>> as_reversed(ip=‘89.218.52.234’, suffix=’ix.dnsbl.manitu.net’) ‘234.52.218.89.ix.dnsbl.manitu.net.’

Parameters:
  • ip (string) – A IPv4 address.
  • suffix – The FQDN of the DNSBL Provider.
Return type:

string

fu.check_lists(ip, providers, threshhold, predicate=2)

Checks a ip against a list of DNSBL providers.

Parameters:
  • ip (string) – A IPv4 address to be checked.
  • providers (Mapping) – A mapping (dict) containing FQDN’s as keys and weights as values (floats).
  • threshhold (float) – If the combined results >= this value, we deem it as spam.
  • predicate (integer) – The DNSBL-reply must be equal to this or higher.
Return type:

bool

fu.is_spam(ip, provider, predicate=2)

Returns either True or False depending on if the last digits in the reply is >= the predicament. 2 is the default as per RFC.

Parameters:
  • ip (string) – A IPv4 address to be checked.
  • provider (string) – The FQDN of the DNSBL Provider.
  • predicate (integer) – The DNSBL-reply must be equal to this or higher.
Return type:

bool

Project Versions

Previous topic

FU - The Funneling Unit

This Page