t.m.r.MXCalculator : class documentation

Part of twisted.mail.relaymanager View Source View In Hierarchy

A utility for looking up mail exchange hosts and tracking whether they are working or not.
Instance VariablesclockIReactorTime provider which will be used to decide when to retry mail exchanges which have not been working.
Method __init__ Undocumented
Method markBad Indicate a given mx host is not currently functioning.
Method markGood Indicate a given mx host is back online.
Method getMX Find an MX record for the given domain.
Method _filterRecords Convert a DNS response (a three-tuple of lists of RRHeaders) into a mapping from record names to lists of corresponding record payloads.
Method _cbMX Try to find the MX host from the given DNS information.
Method _ebMX Undocumented
def __init__(self, resolver=None, clock=None): (source)
Undocumented
def markBad(self, mx): (source)
Indicate a given mx host is not currently functioning.
ParametersmxThe hostname of the host which is down. (type: str )
def markGood(self, mx): (source)
Indicate a given mx host is back online.
ParametersmxThe hostname of the host which is up. (type: str )
def getMX(self, domain, maximumCanonicalChainLength=3): (source)
Find an MX record for the given domain.
ParametersdomainThe domain name for which to look up an MX record. (type: str )
maximumCanonicalChainLengthThe maximum number of unique CNAME records to follow while looking up the MX record. (type: int )
ReturnsA Deferred which is called back with a string giving the name in the found MX record or which is errbacked if no MX record can be found.
def _filterRecords(self, records): (source)
Convert a DNS response (a three-tuple of lists of RRHeaders) into a mapping from record names to lists of corresponding record payloads.
def _cbMX(self, answers, domain, cnamesLeft): (source)

Try to find the MX host from the given DNS information.

This will attempt to resolve CNAME results. It can recognize loops and will give up on non-cyclic chains after a specified number of lookups.
def _ebMX(self, failure, domain): (source)
Undocumented
API Documentation for Twisted, generated by pydoctor at 2011-10-27 16:27:37.