Site in development
← Tooling

Oakpost

Email header triage, built for the person writing the sample up.

Point it at a suspicious email and get back the parts you’d normally dig out by hand. Who it claims to be from, the route it really took, and whether SPF, DKIM and DMARC passed.

Updated

RoadmapOn GitHub ↗

  • headers — the four identity headers (done)
  • received — the hop chain, oldest first (done)
  • auth — SPF, DKIM and DMARC verdicts (done)
  • Fail cleanly on a missing, unreadable or non-email file (done)
  • urls — links from both the plain-text and HTML parts (done)
  • Defang everything by default (hxxps://, evil[.]com) (done)
  • --fang — show links live when you need them (done)
  • Highlight lookalike characters in colour (done)
  • --format markdown — output that pastes straight into a write-up (planned)
  • Tag v0.1.0 (planned)
Example output
python oakpost.py examples/demo.eml

== headers ==
From:    "IT Support (DEMO)" <it-support@example[.]com>
To:      analyst@example[.]org
Subject: [oakpost demo] Your mailbox is almost full - TEST EMAIL, NOT REAL
Date:    Sun, 15 Nov 2026 17:30:00 +0000

== received ==
1: from [192.0.2[.]10] (unknown [198.51.100[.]7]) by mail.example[.]net (Postfix) with ESMTPSA id 7B3C2880001 for <analyst@example[.]org>; Sun, 15 Nov 2026 17:30:02 +0000 (UTC)
2: from mail.example[.]net (mail.example[.]net [203.0.113[.]25]) by mx.example[.]org (Postfix) with ESMTPS id 4F2A91C0003 for <analyst@example[.]org>; Sun, 15 Nov 2026 17:30:05 +0000 (UTC)

== auth ==
SPF:   fail (mx.example[.]org: domain of [email protected][.]net does not designate 203.0.113[.]25 as permitted sender)
DKIM:  none (message not signed)
DMARC: fail (p=reject dis=none)

== urls ==
1: hxxps://www.example[.]com/storage  (plain, html)
2: hxxps://login.example[.]net/mailbox/verify  (html, <a href="hxxps://login.example[.]net/mailbox/verify">hxxps://www.example[.]com/storage</a>)
Real output from the current version, run on the demo email in the repo (a test message, not a real phish; every address is a reserved example domain). oakpost defangs everything it prints.

What it does

  • headersShows who really sent itPuts the sender, recipient, subject and date in one place, so a fake display name or an odd sender address stands out in seconds.
    From:    "IT Support (DEMO)" <it-support@example[.]com>
    To:      analyst@example[.]org
    Subject: [oakpost demo] Your mailbox is almost full …
  • receivedTraces where it came fromLists every mail server the email passed through, in order, so you can see where it really started, not just where it claims to.
    1: from [192.0.2[.]10] (unknown [198.51.100[.]7]) by mail.example[.]net …
    2: from mail.example[.]net … by mx.example[.]org …
  • authChecks whether it’s genuineShows whether the email passed SPF, DKIM and DMARC, the checks that prove a sender is allowed to use that domain, and why it failed if it did.
    SPF:   fail (… does not designate 203.0.113[.]25 …)
    DKIM:  none (message not signed)
    DMARC: fail (p=reject dis=none)

Get it

  1. Download it

    Grab oakpost.py from GitHub. It’s a single file that only needs Python 3, with nothing else to install.

  2. Run it

    python oakpost.py sample.eml runs every check. Add a command, like auth, to run just one.

  3. Keep it in a sandbox

    It runs locally and only reads the file you give it, so nothing is uploaded anywhere. Still, keep the tool and the .eml files you download in a sandbox or VM.

Usage

Commands

Oakpost reads a saved email (.eml). Run it with no command and it runs every analysis. Name a command and you get just that section.

Command What it shows
headers From, To, Subject and Date
received The Received chain, oldest hop first, so you can follow the route the mail took
auth SPF, DKIM and DMARC verdicts, with the reason the receiving server gave
urls Every link in the plain-text and HTML versions, tagged with where it was found. In HTML, a link whose visible text is a different web address is shown in full
--fang Not a command: add it to any command to show links live instead of defanged

Installation

You need Python 3.8 or later.

git clone https://github.com/ConnorBaines/oakpost.git
cd oakpost
python oakpost.py examples/demo.eml

Examples

Below are a few ways I use oakpost to find common phishing indicators, like a link that hides where it really goes, or an email that fails its authentication checks.

They use examples/demo.eml and examples/lookalike-demo.eml, test emails made for the README. They aren’t real phishes, and every address in them is a reserved example domain.

More examples, with screenshots, are in the README on GitHub.

$ python oakpost.py urls examples/demo.eml

== urls ==
1: hxxps://www.example[.]com/storage  (plain, html)
2: hxxps://login.example[.]net/mailbox/verify  (html, <a href="hxxps://login.example[.]net/mailbox/verify">hxxps://www.example[.]com/storage</a>)

Line 2 is the trick: the reader sees hxxps://www.example[.]com/storage, but the link goes to login.example[.]net. The plain-text version only has the honest link, so anyone checking that version sees nothing wrong.

Checking authentication on its own

$ python oakpost.py auth examples/demo.eml

== auth ==
SPF:   fail (mx.example[.]org: domain of [email protected][.]net does not designate 203.0.113[.]25 as permitted sender)
DKIM:  none (message not signed)
DMARC: fail (p=reject dis=none)

Spotting letters swapped for lookalikes from other alphabets

$ python oakpost.py headers examples/lookalike-demo.eml

== headers ==
From:    "Ρayroll Τeam (DEMO)" <payroll@example[.]com>
To:      analyst@example[.]org
Subject: [oakpost demo] Yοur 𝗉ayslip is ready - TEST EMAIL, NOT REAL
Date:    Mon, 16 Nov 2026 09:12:00 +0000

Note: 4 lookalike letters found (highlighted in red). Disguised characters are often used to dodge keyword filters. This could be an indicator if unexpected.

lookalike-demo.eml hides Greek and mathematical letters in its sender name and subject. oakpost highlights each one in red and adds a note at the end.

python oakpost.py urls --fang examples/demo.eml

--fang works with any command, for when you need a live link to paste into urlscan.io or VirusTotal.

How it’s built

Python 3 and the standard library only. The built-in email package reads the .eml (including encodings like quoted-printable, where links get split across lines) and re pulls out the verdicts and links. It works in three steps:

  1. Load: read the .eml file and parse it into a message.
  2. Analyse: each command is one small function that takes the message and returns its findings. None of them print anything, so each can be tested on its own.
  3. Print: one output function prints whatever the analysis returned, as a titled section.

Each command is one entry in a COMMANDS registry that maps the command name to its function, so adding a check means writing one function and adding one line.

← Tooling