e1c2e42d5d Dockerfile: bind-mount the wheel so it stops shipping in every published image (#893)
* Dockerfile: bind-mount the wheel instead of COPYing it

The runtime stage COPYs the built wheel out of the build stage and the
RUN that installs it rm -rf's it again. A RUN cannot remove what an
earlier instruction already committed -- it writes a whiteout on top --
so the COPY layer ships in every pull.

Measured on ghcr.io/domainaware/parsedmarc:11.0.0: on amd64 layer 4 is
10,713,473 bytes of a 267,653,434-byte image (4.0%); on arm64
10,713,473 of 270,400,579 (3.96%). Layer 5 carries tmp/.wh.dist.
The 10.5.0 and 10.0.0 tags carry the same layer.

Bind mounts are not committed to layers, so the rm -rf /tmp/dist clause
is no longer needed and is removed. A # syntax=docker/dockerfile:1
directive is added so RUN --mount is guaranteed available.

* Add --no-cache-dir option to pip install

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Dockerfile: drop the syntax directive; document the size win

`RUN --mount=type=bind,from=<stage>` has been stable in BuildKit's built-in
Dockerfile frontend since 2020, and the Docker workflow builds through
docker/setup-buildx-action + docker/build-push-action, so the mount works
without `# syntax=docker/dockerfile:1`. The directive only adds an
unpinned Docker Hub round trip before the Dockerfile can be read
(`resolve image config for docker-image://docker.io/docker/dockerfile:1`),
on a floating tag, and it does not help the legacy non-BuildKit builder,
which rejects `RUN --mount` either way.

Verified on linux/amd64 with BuildKit (buildx 0.37.0, Docker 29.8.0):
building with and without the directive produced five layers totalling
163,757,439 and 163,757,152 compressed bytes respectively -- a 287-byte
gzip nondeterminism, otherwise identical. The master baseline built six
layers totalling 272,138,724 bytes, whose wheel layer of 10,713,475 bytes
reproduces the published 11.0.0 image's 10,713,473 to within two bytes.

The comment block is trimmed to state the invariant rather than narrate
what the code used to do, and CHANGELOG.md gains an entry: the change is
user-visible, and the ~40% reduction is mostly the pip download cache
that --no-cache-dir removes, not the wheel layer the PR was opened for.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Sean Whalen <44679+seanthegeek@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-09 13:10:37 -04:00
2018-02-05 20:23:07 -05:00
2026-03-09 18:24:16 -04:00

parsedmarc

Build
Status Code
Coverage PyPI
Package PyPI - Downloads

A screenshot of DMARC summary charts in Kibana

parsedmarc is a Python module and CLI utility for parsing DMARC reports. When used with Elasticsearch and Kibana (or Splunk), or with OpenSearch and Grafana, it works as a self-hosted open-source alternative to commercial DMARC report processing services such as Agari Brand Protection, Dmarcian, OnDMARC, ProofPoint Email Fraud Defense, and Valimail.

Note

Domain-based Message Authentication, Reporting, and Conformance (DMARC) is an email authentication protocol.

Sponsors

This project is maintained by one developer. Please consider sponsoring my work if you or your organization benefit from it.

Features

  • Parses aggregate/rua DMARC reports: the legacy draft and 1.0 schemas (RFC 7489) and the new RFC 9990 schema for the final DMARC standard (RFC 9989)
  • Parses failure/ruf DMARC reports (RFC 6591 and RFC 9991; formerly called forensic reports)
  • Parses reports from SMTP TLS Reporting (TLS-RPT, RFC 8460)
  • Can parse reports from an inbox over IMAP, Microsoft Graph, or Gmail API
  • Transparently handles gzip or zip compressed reports
  • Consistent data structures
  • Simple JSON and/or CSV output
  • Optionally email the results
  • Optionally send the results to Elasticsearch, OpenSearch, Splunk, or PostgreSQL, for use with premade dashboards
  • Optionally send the results to Apache Kafka, Amazon S3, Azure Log Analytics (Microsoft Sentinel), a Graylog (GELF) endpoint, a syslog server, or an HTTP webhook

Python Compatibility

This project supports the following Python versions, which are either actively maintained or are the default versions for RHEL or Debian.

Version Supported Reason
< 3.6 End of Life (EOL)
3.6 Used in RHEL 8, but not supported by project dependencies
3.7 End of Life (EOL)
3.8 End of Life (EOL)
3.9 Used in Debian 11 and RHEL 9, but not supported by project dependencies
3.10 Actively maintained
3.11 Actively maintained; supported until June 2028 (Debian 12)
3.12 Actively maintained; supported until May 2035 (RHEL 10)
3.13 Actively maintained; supported until June 2030 (Debian 13)
3.14 Supported (requires imapclient>=3.1.0)
S
Description
No description provided
Readme Apache-2.0
342 MiB
Languages
Python 98.5%
Shell 1.4%