Email Authentication: DMARC, DKIM, SPF Implementation for Pakistani Organizations
Email Threat Landscape in Pakistan
Phishing emails impersonating banks (Habib Bank, MCB) and e‑wallets (easypaisa, JazzCash) circulate via WhatsApp forwards and fake OTP pages. The NCCIA 1799 helpline regularly receives reports of Business Email Compromise (BEC) that start with spoofed sender domains.
Understanding SPF, DKIM, DMARC
- SPF (Sender Policy Framework): DNS TXT record listing IPs authorized to send mail for your domain.
- DKIM (DomainKeys Identified Mail): Cryptographic signature added to email headers, verified against a public key in DNS.
- DMARC (Domain‑based Message Authentication, Reporting & Conformance): Policy that tells receivers what to do if SPF/DKIM fail, and provides aggregate reports.
Step‑by‑Step DNS Configuration
- Publish SPF
Replacev=spf1 ip4:203.0.113.0/24 include:_spf.google.com ~all203.0.113.0/24with your mail server IPs. - Generate DKIM key pair (e.g., using OpenDKIM):
Add the TXT recordopendkim-genkey -s mail -d example.pk_mail._domainkey.example.pkwith the public key. - Set DKIM selector in your mail server (Postfix, Exchange) and sign outgoing mail.
- Create DMARC record
Start withv=DMARC1; p=quarantine; rua=mailto:dmarc-reports@example.pk; pct=100p=quarantine, then move top=rejectonce you have no legitimate failures. - Monitor DMARC reports (daily) for alignment failures and spoofing attempts.
Monitoring DMARC Reports and Adjusting Policy
- Use a DMARC analyzer tool (e.g., dmarcian) to parse
ruareports. - If legitimate bulk mail (marketing, transactional) fails alignment, update SPF/DKIM for those services.
- Block
p=rejectfor domains with no legitimate email until you have full coverage.
Integrating with SBP Consumer Guidelines
The State Bank of Pakistan’s consumer protection directives require banks to protect customers from phishing. Properly configured DMARC reduces spoofed emails that target easypaisa users, aligning your organization with SBP expectations.
Do / Don't
- Do test configuration with
mail-tester.combefore going live. - Don’t set
p=rejectwithout first reviewing DMARC reports; you may block valid mail. - Do publish a DMARC policy on all subsidiary domains (e.g.,
sub.example.pk). - Don’t use
~allsoftfail forever; it does not prevent spoofing.
Takeaway
Today, add an SPF record for your primary mail domain and create a DKIM key pair. Even if you can’t finalize DMARC yet, publishing SPF will immediately reduce the number of forged emails that appear to come from your organization.
