'>>> from mailpile.crypto.dnspka import *
>>> d = DNSPKALookup()
>>> res = d.lookup("smari@immi.is")
>>> res["result"]["count"] == 1'

def _lookup(self, address, strict_email_match=True):

    if (not DNS):
        return {}
    dom = address.replace('@', '._pka.')
    result = self.req.req(dom)
    for res in (result.answers if result else []):
        if (res['typename'] != 'TXT'):
            continue
        for entry in res['data']:
            return self._keyinfo(entry)
    return {}
