Download the PHP package avvertix/dmarc-report-parser without Composer

On this page you can find all versions of the php package avvertix/dmarc-report-parser. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package dmarc-report-parser

DMARC Report Parser

Latest Version on Packagist Tests Total Downloads

DMARC Report Parser is designed to simplify the analysis of DMARC (Domain-based Message Authentication, Reporting & Conformance) reports:

Installation

You can install the package via composer:

Require PHP 8.3 with xsl and sodium extensions.

Usage

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

from file

See the DmarcReport class below for the full structure.

You can pass directly zip or gzip compressed reports. It is assumed that the XML report file is the first file in the compressed archive.

When working with compressed reports we cap expansion at 10MB by default. An archive that expands past the cap throws Avvertix\DmarcReportParser\Exception\DecompressionLimitException. If necessary you can adjust the expansion limit by providing a ParserConfiguration.

from string

Reading the authentication results of every record, which is what most of a report is about:

DmarcReport class

The DmarcReport class represent the report in a fully typed manner.

A few differences with respect to the spec:

Two things catch people out: the published policy is publishedPolicy, in camel case, while every other property is snake case to match the XML; and the override reasons in PolicyEvaluated property is reasons, plural, because a record may carry more than one.

Common questions to ask a report

Reading a report filename

RFC 9990 standardizes the attachment filename, which yields the policy domain and the reporting window without decompressing or parsing anything:

In case the attachment filename is not following the convention the parse() method returns null.

RFC 7489 vs RFC 9990

DMARC was originally defined in RFC 7489. RFC 9990 revises it. The DmarcReport supports both definitions without indicating if a report satisfy one or the other version as it is possible that sender will take time to move to the new RFC.

Elements RFC 9990 adds are nullable, indicating that the report did not carry them:

Property Element Type
DmarcReport::$generator report_metadata/generator ?string
DmarcReport::$extensions feedback/extension list<Extension>, empty when absent
Policy::$discovery_method policy_published/discovery_method ?DiscoveryMethod — psl or treewalk
Policy::$testing policy_published/testing ?TestingMode — the t tag, y or n
Policy::$np policy_published/np ?DispositionType
Record::$extensions namespaced elements after auth_results list<Extension>, empty when absent

RFC 9990 deprecate or remove few fields and values. Other behaviour worth knowing:

Testing

DMARC Report Parser is covered in unit test. The PestPHP framework is used. To run the whole test suite execute the test script.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of dmarc-report-parser with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
saloonphp/xml-wrangler Version ^1.3
symfony/mime Version ^7.4.0 || ^8.0.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package avvertix/dmarc-report-parser contains the following files

Loading the files please wait ...