def get_mx_from_email_or_fqdn(addr):
    # Match the mail exchanger line in nslookup output.
    MX = re.compile(r'^.*\s+mail exchanger = (?P<priority>\d+) (?P<host>\S+)\s*$')
    # Find mail exchanger of this email address or the current host
    if '@' in addr:
        domain = addr.rsplit('@', 2)[1]
    else:
        domain = '.'.join(addr.rsplit('.')[-2:])
    p = os.popen('/usr/bin/nslookup -q=mx %s' % domain, 'r')
    mxes = list()
    for line in p:
        m = MX.match(line)
        if m is not None:
            mxes.append(m.group('host')[:-1])  #[:-1] just strips the ending dot
    if len(mxes) == 0:
        return ''
    else:
        return mxes[0]
Destroy the JobBinaryInternal or raise if it does not exist.
dataset/ETHPy150Open FredHutch/swift-commander/swift_commander/swsymlinks.py/get_mx_from_email_or_fqdn--crossover with--dataset/ETHPy150Open openstack/sahara/sahara/conductor/manager.py/ConductorManager.job_binary_internal_destroy