Skip to content
Back to Blog
·9 min read·guides

Email Security: SPF, DKIM, and DMARC Explained Simply

What SPF, DKIM, and DMARC are, why your domain needs all three, and step-by-step setup instructions that any developer or IT admin can follow.

Shouvik Mukherjee, Founder of Bachao.AI

Shouvik Mukherjee

Founder, Bachao.AI

Get Your Free VAPT Scan

What this means for your business

Indian businesses without documented security controls face 3× higher breach costs (IBM Cost of a Data Breach 2024). This guide helps you close that gap.

Why Email Authentication Matters

Email is the #1 attack vector for Indian businesses. Without proper authentication, anyone can send emails pretending to be from your domain — to your customers, your employees, or your partners.

79%Of data breaches in India start with email (Verizon DBIR 2025)
62%Of Indian domains have no DMARC policy (Valimail Q4 2025)
₹1,200 CrLosses from email-based scams in India in 2025 (RBI Fraud Report)
3 recordsAll you need to protect your domain: SPF + DKIM + DMARC

The Email Authentication Trinity

graph LR A[📧 Sent Email] --> B[SPF Check
Is sender IP authorized?] B --> C[DKIM Check
Is email signed?] C --> D[DMARC Policy
What to do if both fail?] D -->|Pass| E[📥 Delivered to Inbox] D -->|Fail| F[🗑️ Quarantine or Reject] style B fill:#1e3a5f,stroke:#F97316,color:#e2e8f0 style C fill:#1e3a5f,stroke:#3B82F6,color:#e2e8f0 style D fill:#1e3a5f,stroke:#10B981,color:#e2e8f0 style E fill:#1e5f3a,stroke:#10B981,color:#e2e8f0 style F fill:#5f1e1e,stroke:#EF4444,color:#e2e8f0

SPF (Sender Policy Framework)

What it does: Declares which mail servers are allowed to send email on behalf of your domain.

How it works:

  1. You publish a DNS TXT record listing authorized senders
  2. Receiving servers check if the sending server's IP matches your SPF record
  3. If it doesn't match, the email fails SPF
Setup:
dns
; Add this TXT record to your domain's DNS
yourdomain.com. TXT "v=spf1 include:_spf.google.com include:amazonses.com ~all"
ComponentMeaning
v=spf1This is an SPF record (version 1)
include:_spf.google.comAllow Google Workspace to send for you
include:amazonses.comAllow Amazon SES to send for you
~allSoft-fail everything else (use -all for hard fail)
TIP
Start with ~all (soft fail) while testing. Once you're confident all legitimate senders are listed, switch to -all (hard fail) for maximum protection.

Common SPF mistakes

MistakeProblemFix
Too many includesSPF has a 10 DNS lookup limitConsolidate or flatten
Using +allAllows ANYONE to send as your domainUse -all or ~all
Missing a senderLegitimate emails fail SPFAudit all systems that send email
Multiple SPF recordsInvalid — only one allowedMerge into a single record

Know your vulnerabilities before attackers do

Run a free VAPT scan — takes 5 minutes, no signup required.

Book Your Free Scan

DKIM (DomainKeys Identified Mail)

What it does: Cryptographically signs every email so receivers can verify it wasn't tampered with in transit.

How it works:

  1. Your mail server adds a digital signature to each outgoing email
  2. The public key is published in your DNS
  3. Receiving servers verify the signature using your public key
  4. If the signature is valid, the email passes DKIM
Setup:
dns
; Your email provider gives you a DKIM record to add
selector._domainkey.yourdomain.com. TXT "v=DKIM1; k=rsa; p=MIIBIjANBgkqh..."
ComponentMeaning
selectorIdentifies which signing key (e.g., google, resend)
v=DKIM1DKIM version 1
k=rsaKey type (RSA)
p=MIIBIj...Your public key (base64 encoded)
WARNING
Each email service needs its own DKIM record. If you use Google Workspace AND Resend AND Mailchimp, you need DKIM configured for each one with different selectors.

DMARC (Domain-based Message Authentication, Reporting & Conformance)

What it does: Tells receiving servers what to do when SPF and DKIM fail, and sends you reports about email authentication results.

How it works:

  1. You publish a DMARC policy in DNS
  2. Receiving servers check SPF and DKIM results
  3. If both fail, the server follows your DMARC policy (none, quarantine, or reject)
  4. Servers send you aggregate reports about authentication results
Setup:
dns
; Add this TXT record
_dmarc.yourdomain.com. TXT "v=DMARC1; p=quarantine; rua=mailto:ceo@bachao.ai; pct=100"
ComponentMeaning
v=DMARC1DMARC version 1
p=quarantineQuarantine failing emails (alternatives: none, reject)
rua=mailto:...Send aggregate reports to this email
pct=100Apply policy to 100% of emails

DMARC policy progression

StagePolicyEffectWhen to Use
Monitorp=noneNo action, just reportingFirst 2-4 weeks
Quarantinep=quarantineFailing emails go to spamAfter reviewing reports
Rejectp=rejectFailing emails are droppedFull confidence in setup
Key Takeaway
The progression from p=none to p=reject is critical. Don't jump to reject immediately — monitor first, review reports, fix any legitimate senders that are failing, then gradually tighten the policy.

Verification: Check Your Domain Now

bash
# Check SPF
dig TXT yourdomain.com | grep "v=spf1"

# Check DKIM (replace 'selector' with your actual selector)
dig TXT selector._domainkey.yourdomain.com | grep "v=DKIM1"

# Check DMARC
dig TXT _dmarc.yourdomain.com | grep "v=DMARC1"

Common Setup for Indian Businesses

Most Indian businesses use Google Workspace or Microsoft 365. Here's a quick reference:

Google Workspace

RecordValue
SPFv=spf1 include:_spf.google.com ~all
DKIMGenerate in Admin Console > Apps > Gmail > DKIM
DMARCv=DMARC1; p=none; rua=mailto:your-email@yourdomain.com

Microsoft 365

RecordValue
SPFv=spf1 include:spf.protection.outlook.com ~all
DKIMEnable in Microsoft 365 Defender > Email authentication
DMARCv=DMARC1; p=none; rua=mailto:your-email@yourdomain.com

What Happens Without Email Authentication

ScenarioRiskImpact
No SPFAnyone can send as your domainPhishing emails to your customers
No DKIMEmails can be modified in transitAltered invoices, fake instructions
No DMARCNo policy enforcementSPF/DKIM failures have no consequence
All three missingComplete email impersonationBEC attacks, fraud, reputational damage
DANGER
Without all three records, an attacker can send emails that appear to come from your domain — to your customers, your bank, your partners. There is no technical barrier. SPF + DKIM + DMARC together close this attack vector.

Get Your Email Security Checked

INFO
Bachao.AI's VAPT scans include comprehensive email security assessment — SPF, DKIM, DMARC, and related DNS configurations are all checked and reported with specific fix instructions. Book a free scan to see how your email security stacks up.

Written by Shouvik Mukherjee, Founder of Bachao.AI. Contact: ceo@bachao.ai. Follow me on LinkedIn for email security and cybersecurity insights for Indian businesses.

Shouvik Mukherjee, Founder of Bachao.AI

Shouvik Mukherjee

Founder, Bachao.AI

Ex-enterprise architect turned cybersecurity founder. Built systems for Fortune 500s, now making enterprise-grade security accessible to every Indian business. Writes about threats targeting Indian businesses, practical defenses, and the DPDP Act.

Connect on LinkedIn

Get cybersecurity insights for Indian businesses

Weekly vulnerability alerts, DPDP compliance tips, and security guides. No spam — unsubscribe anytime.

We respect your privacy. Your email is never shared.

Know your vulnerabilities before attackers do

Free automated scan — risk score in under 2 hours. No credit card required.

Get Your Free VAPT Scan
Find your vulnerabilitiesStart free scan →