Skip to the content.

How to find which email provider a company uses

A domain’s MX records reveal who handles its email: Google Workspace, Microsoft 365, or a security gateway like Proofpoint or Mimecast. Sales teams use this to segment accounts (sell a Microsoft 365 add-on to Microsoft shops), and IT and security teams use it with SPF and DMARC to audit email security.

import httpx

def dns(name, rtype):
    r = httpx.get("https://cloudflare-dns.com/dns-query", params={"name": name, "type": rtype}, headers={"accept": "application/dns-json"})
    return [a["data"] for a in r.json().get("Answer", [])]

PROVIDERS = {"google.com": "Google Workspace", "outlook.com": "Microsoft 365", "pphosted.com": "Proofpoint",
             "mimecast": "Mimecast", "messagelabs.com": "Broadcom/Symantec", "zoho": "Zoho Mail"}

def email_setup(domain):
    mx = [m.split()[-1].rstrip(".") for m in dns(domain, "MX")]
    provider = next((name for key, name in PROVIDERS.items() for host in mx if key in host), "Other" if mx else None)
    spf = next((t.strip('"') for t in dns(domain, "TXT") if t.strip('"').startswith("v=spf1")), None)
    dmarc = next((t.strip('"') for t in dns(f"_dmarc.{domain}", "TXT")), None)
    return {"domain": domain, "mx": mx, "provider": provider, "spf": spf, "dmarc": dmarc}

print(email_setup("stripe.com"))

Pitfalls

Want registration data too?

Domain Intelligence does this for any list of domains, plus official RDAP registration data: registrar, creation and expiry dates, days until expiry and nameservers. It recognizes 25+ email providers and gateways and flags null MX. $1 per 1,000 domains. (Built by the author of this guide.)

← Home