cbowofrivia / dmarc-record-builder
A lean package that makes creating DMARC records user friendly
Installs: 84 062
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 0
Open Issues: 3
Requires
- php: ^8.2
- illuminate/collections: ^11.4
- webmozart/assert: ^1.10
Requires (Dev)
- laravel/pint: ^1.15
- pestphp/pest: ^2
- symfony/var-dumper: ^7.0
This package is auto-updated.
Last update: 2024-11-20 08:36:52 UTC
README
Installation
You can install the package via composer:
composer require cbowofrivia/dmarc-record-builder
Usage
$record = new DmarcRecord(); $record->policy('none') ->subdomainPolicy('none') ->pct(100) ->rua('mailto:charlesrbowen93@gmail.com') ->ruf('mailto:charlesrbowen93@gmail.com') ->adkim('relaxed') ->aspf('relaxed') ->reporting('any') ->interval(604800); $record = (string) $record; // v=DMARC1; p=none; sp=none; pct=100; rua=mailto:charlesrbowen93@gmail.com; ruf=mailto:charlesrbowen93@gmail.com; fo=1; adkim=r; aspf=r; ri=604800;
You can also build the record in the constructor
$record = new DmarcRecord( version: 'DMARC1' policy: 'none' subdomain_policy: 'none' pct: 100 rua: 'mailto:charlesrbowen93@gmail.com' ruf: 'mailto:charlesrbowen93@gmail.com' adkim: 'relaxed' aspf: 'relaxed' reporting: 'any' interval: 604800 ); $record = (string) $record; // v=DMARC1; p=none; sp=none; pct=100; rua=mailto:charlesrbowen93@gmail.com; ruf=mailto:charlesrbowen93@gmail.com; fo=1; adkim=r; aspf=r; ri=604800;
Testing
composer test
If you're using WSL2 + Docker, you can install and test with the provided docker-compose.yaml file.
docker-compose run --rm php composer install && \ docker-compose run --rm php composer test
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.