Skip to content

callmemagnus/thunderbird-dmarc-report-viewer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DMARC Report Viewer

A Thunderbird extension that detects DMARC aggregate report attachments and displays a parsed, human-readable report inline at the top of the message body.

Features

  • Automatically detects DMARC report attachments (.xml, .xml.gz, .gz, .zip)
  • Decompresses gzip and ZIP archives transparently
  • Renders an inline report panel above the message content with:
    • Summary: reporting org, date range, pass/fail counts
    • Report metadata and published policy details
    • Records table with per-IP authentication results (SPF/DKIM)
    • Color-coded badges for pass/fail/quarantine status
  • Collapsible panel (expanded by default)

Installation

  1. Open Thunderbird
  2. Go to Add-ons and Themes (Tools > Add-ons and Themes)
  3. Click the gear icon > Install Add-on From File...
  4. Select the manifest.json file from this directory

For development, use Debug Add-ons > Load Temporary Add-on instead.

How it works

When a message is displayed, the background script checks its attachments for DMARC report patterns using filename heuristics (e.g. receiver!domain!begin!end.xml.gz), MIME types, and subject line hints. If a report is found, it fetches the attachment, decompresses it if needed, parses the XML, and passes the structured data to a content script injected into the message display area. The content script renders the report as an inline panel at the top of the message.

Supported formats

Format Method
.xml Direct parsing
.gz / .xml.gz Native DecompressionStream
.zip zip.js

Requirements

  • Thunderbird 102 or later
  • Node.js and npm (for building)

Building

npm run build

This installs dependencies, copies vendored files into lib/, and produces dmarc-report-viewer-<version>.xpi, ready for installation or upload to addons.thunderbird.net.

For development, run npm install first, then load the extension as a temporary add-on.

File structure

dmarc-parser/
  manifest.json           # Extension manifest (Manifest V2)
  background.js           # Detection, decompression, parsing, orchestration
  icons/icon.svg          # Shield+checkmark icon
  content/
    message-script.js     # Injected into message display, renders report
    message-style.css     # Inline report styles
  lib/
    dmarc-parser.js       # XML-to-object parser
    zip.min.js            # zip.js (copied from node_modules at build time)
  bin/
    release.sh            # Package .xpi for release
  package.json            # npm dependencies (@zip.js/zip.js)

License

MIT