Download the PHP package cbowofrivia/dmarc-record-builder without Composer

On this page you can find all versions of the php package cbowofrivia/dmarc-record-builder. 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-record-builder

DMARC Record Builder

Latest Version on Packagist Tests codecov Total Downloads

A PHP package for building and parsing DMARC DNS records with a fluent, human-friendly API. Accepts readable values ('relaxed', 'strict', 'reject') and outputs correctly formatted DMARC strings.

Requirements

This package has no runtime dependencies.

Installation

Quick Start

Building a Record

Fluent API

All setter methods return $this, so calls can be chained:

Constructor

All parameters are optional. The constructor accepts the same values as the fluent setters:

Static Factory

DmarcRecord::create() is a convenience wrapper around the constructor, useful when you want to build and cast in one expression:

Parsing an Existing Record

Pass a raw DMARC TXT record string to DmarcRecord::parse() to get a populated DmarcRecord object. This is useful for reading and modifying existing records.

After parsing, you can modify the record and re-cast it to a string:

parse() requires both v and p tags to be present and will throw an InvalidDmarcRecordException if either is missing. Unknown tags are silently ignored.

Tag Reference

Method DMARC Tag Accepted Values Default
version() v 'DMARC1' 'DMARC1'
policy() p 'none', 'quarantine', 'reject' 'none'
subdomainPolicy() sp 'none', 'quarantine', 'reject' null
rua() rua 'mailto:...' null
ruf() ruf 'mailto:...' null
adkim() adkim 'relaxed', 'strict' null
aspf() aspf 'relaxed', 'strict' null
reporting() fo 'all', 'any', 'dkim', 'spf' []
nonExistentSubdomainPolicy() np 'none', 'quarantine', 'reject' null
publicSuffixDomainPolicy() psd 'y', 'n', 'u' null
testingMode() t 'y', 'n' null

Tags with a null value are omitted from the output string. Only v and p are always emitted.

Note: RFC 9989 (DMARCbis) removed the pct and ri tags, so this package no longer supports them (removed in 4.0.0). Records that still contain those tags parse without error — the tags are simply ignored.

Tag Details

policy() / subdomainPolicy() / nonExistentSubdomainPolicy()

Controls how the receiving mail server handles messages that fail DMARC checks.

subdomainPolicy() (sp) overrides policy() for subdomains. If omitted, subdomains inherit the main policy.

nonExistentSubdomainPolicy() (np) applies to non-existent subdomains (RFC 9091 / DMARCbis). Takes precedence over both policy() and subdomainPolicy() for those domains.

rua() / ruf()

URIs for receiving DMARC reports. Must be prefixed with mailto:.

Both tags also accept an array of addresses (RFC 9989 — comma-separated list):

adkim() / aspf()

Alignment mode for DKIM and SPF respectively.

Omitting either defaults to relaxed alignment per the RFC.

reporting()

Specifies which failure conditions trigger a forensic report. Accepts a string or an array of options:

Value fo tag Meaning
'all' fo=0 Report if all mechanisms fail
'any' fo=1 Report if any mechanism fails
'dkim' fo=d Report if DKIM fails
'spf' fo=s Report if SPF fails

Multiple values produce a colon-separated fo tag:

Duplicate values are silently deduplicated. 'all' and 'any' are mutually exclusive — passing both throws an InvalidDmarcRecordException.

publicSuffixDomainPolicy()

Controls DMARC policy application at public suffix domains (DMARCbis extension).

testingMode()

When set to 'y', signals that DMARC is in testing mode. Receivers should not apply policy actions but may still send reports.

Validation

The package validates inputs on each setter call. Passing an invalid value throws a CbowOfRivia\DmarcRecordBuilder\Exceptions\InvalidDmarcRecordException. It extends the native \InvalidArgumentException, so existing catch (\InvalidArgumentException) handlers continue to work.

Testing

Changelog

Please see CHANGELOG for more information on what has changed recently.

Credits

License

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


All versions of dmarc-record-builder with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
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 cbowofrivia/dmarc-record-builder contains the following files

Loading the files please wait ...