Back to prompts
Code13.11.2026
Write a Script That Checks Your SPF, DKIM, and DMARC Records Before Holiday Email Campaigns
#python#dns#email deliverability#spf#dkim#dmarc#holiday marketing#script
You are a careful developer who helps small businesses keep their email out of spam folders. Holiday campaigns send more email than any other time of year, and large mailbox providers expect bulk senders to have working SPF, DKIM, and DMARC records. Write a small, readable Python script that checks the DNS records for my sending domains and tells me in plain words what looks fine, what is missing, and what to ask my email provider about. The script only reads public DNS records. It must never send email, change DNS, or call any paid API. If something about my setup is unclear, mark it [NEEDS INPUT] instead of guessing. Domains I send from (main site, newsletter subdomain, store domain): [DOMAINS] Email services I use to send (newsletter tool, store platform, help desk, workspace mail): [SENDERS] DKIM selectors my providers gave me, if I know them: [SELECTORS] Python version and whether I can install one package such as dnspython: [ENVIRONMENT] How I want the results (terminal table, CSV file, or both): [OUTPUT] Requirements: 1. Before the code, explain in 4 short lines what SPF, DKIM, and DMARC each do, in plain language for a non technical owner. 2. For each domain in [DOMAINS], look up the SPF TXT record, warn if there is none or more than one, flag a missing all mechanism at the end, and estimate whether the include chain risks going past the 10 DNS lookup limit. 3. For each selector in [SELECTORS], check that a DKIM record exists at selector._domainkey.domain. If [SELECTORS] is empty, explain how to find the real selector in a sent email header instead of trying random selectors. 4. Look up the DMARC record at _dmarc.domain, read the policy (none, quarantine, reject) and whether a reporting address is set, and explain what each policy means for my holiday sends. 5. Handle timeouts, missing records, and typos in domain names without crashing, and print a clear message for each. 6. Print a summary per domain with three states only: looks fine, needs a look, missing. Write a CSV as well if [OUTPUT] asks for it. 7. Add a short note that a passing check does not guarantee inbox placement, and that list quality, unsubscribe links, and sending volume still matter. 8. Include the exact commands to install the dependency and run the script, plus 3 example output lines using example.com, clearly labeled as example data. Deliverables: 1. Plain language explainer 2. Complete Python script with comments 3. Install and run commands 4. Example output labeled as example data 5. Checklist of questions to send my email provider for anything marked needs a look
How to use this prompt
- 1Copy the prompt using the button above.
- 2Open your AI tool (ChatGPT, Claude, Midjourney, etc.)
- 3Paste and customize any variables in the prompt.
- 4Generate your result.
Tip
Fill every placeholder before you run the prompt. Keep one clear goal per run, then refine with a follow-up if needed.
When to use this prompt
- •Good for first drafts in Code
- •Keep variables filled so the model has enough context
- •Review AI output before sending or publishing