PHPackages                             avvertix/dmarc-report-parser - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. avvertix/dmarc-report-parser

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

avvertix/dmarc-report-parser
============================

Parse DMARC xml reports

v0.1.0(1y ago)072[1 PRs](https://github.com/avvertix/dmarc-report-parser/pulls)MITPHPPHP ^8.3CI passing

Since Mar 13Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/avvertix/dmarc-report-parser)[ Packagist](https://packagist.org/packages/avvertix/dmarc-report-parser)[ Docs](https://github.com/avvertix/dmarc-report-parser)[ RSS](/packages/avvertix-dmarc-report-parser/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (5)Versions (3)Used By (0)

DMARC Report Parser
===================

[](#dmarc-report-parser)

[![Latest Version on Packagist](https://camo.githubusercontent.com/6c2fbf17771fed1151e4f71dae7cac63005e138781b11de28e0378eb0c583ce7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f61767665727469782f646d6172632d7265706f72742d7061727365722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/avvertix/dmarc-report-parser)[![Tests](https://camo.githubusercontent.com/1292df8fb79d6f8a6ec86f57e533ae52a275226e231f8faee7ebd5544d26c335/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f61767665727469782f646d6172632d7265706f72742d7061727365722f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/avvertix/dmarc-report-parser/actions/workflows/run-tests.yml)[![Total Downloads](https://camo.githubusercontent.com/6ba34be4ac8bfc03b2591e50cbac49c35dc59c6c66f28e5b924ec13804faa8d1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f61767665727469782f646d6172632d7265706f72742d7061727365722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/avvertix/dmarc-report-parser)

DMARC Report Parser is designed to simplify the analysis of [DMARC](https://dmarc.org/) (Domain-based Message Authentication, Reporting &amp; Conformance) reports:

- Parse the XML-based report into fully typed classes
- Read reports from GZip files without decompressing first (coming soon)

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require avvertix/dmarc-report-parser
```

Require PHP 8.3 with `xsl` and `sodium` extensions.

Usage
-----

[](#usage)

It is possible to parse reports from XML files or strings. The output is fully typed instance of `DmarcReport`.

**from file**

```
$dmarc = new Avvertix\DmarcReportParser\DmarcReportParser();

/**
 * @var Avvertix\DmarcReportParser\Data\DmarcReport
 */
$report = $dmarc->fromFile('path/to/report.xml');
```

**from string**

```
$dmarc = new Avvertix\DmarcReportParser\DmarcReportParser();

$xml =
