Skip to content

Developer libraries

mailguard

Audits a domain's SPF, DKIM, DMARC, MX, MTA-STS and TLS-RPT records, grades it A–F and gives step-by-step fixes. Built on lessons from Bosta.

The problem

A few DNS records decide whether your mail lands in the inbox or gets spoofed, and a small mistake in them can go unnoticed for months.

How it solves it

mailguard checks those records in one command, grades the domain from A to F and tells you exactly what to fix. Run it by hand, or block deploys in CI when DNS drifts.

Features

  • SPF: duplicates, +all, include loops and recursive lookup counting against the limit of 10
  • DKIM: probes 16 common provider selectors and flags revoked or weak keys
  • DMARC: validates policy, pct and aggregate reporting
  • MX sorted by preference, with null MX support
  • MTA-STS and TLS-RPT checks for inbound transport security
  • -json output and -min-grade exit codes for CI
  • Zero dependencies: pure Go standard library

Install and try

Who it is for

  • DevOps engineers
  • Email administrators
  • SaaS teams
go install github.com/mashraf1997/mailguard/cmd/mailguard@latest
mailguard example.com

Questions

Is mailguard free?

Yes. mailguard is open source under the MIT licence, so you can use it in personal and commercial projects.

What does it run on?

It is written in Go. The README lists its requirements, usage and full API.

How do I report a problem?

Open an issue in the GitHub repository.

Does MirrorORG use it?

mailguard checks those records in one command, grades the domain from A to F and tells you exactly what to fix. Run it by hand, or block deploys in CI when DNS drifts.

More tools

Standard Webhooks signing and verification with key rotation, replay protection and retrying delivery. Born from Mersal's event pipeline.

bundle-budget

Node.js

Performance budgets for build output (raw, gzip, brotli) with baselines, Markdown PR reports and CI exit codes.

arabic-kit

TypeScript

Arabic toolkit: spelling-tolerant search, normalization, slugs, transliteration, digits, direction and number-to-words (تفقيط) for invoices.