mlocati/spf-lib
Parse, build and validate SPF (Sender Policy Framework) DNS records
3.3.0
1.0M downloads/mo
#4699 most downloaded on Packagist
mlocati/spf-lib
What this package is like to depend on
Last release 1 years ago
23 Jun 2025
Ships unpredictably
gaps range from 8 days to 2.5 years
Most releases are documented
notes for 10 of 12 stable releases
Nothing withdrawn
no release was ever pulled
6 years old
12 releases · first in 2020
0 releases in the last 12 months
see the full history below
Release timeline
12 releases · Jul 2020 to Jun 2025Releases
latest 12-
3.3.023 Jun 2025Release notes
Open source →What's Changed
- Add Decoder::getTXTRecordFromDomain() by @BrandonXLF in #40
New Contributors
- @BrandonXLF made their first contribution in #40
Full Changelog: 3.2.0...3.3.0
-
3.2.027 Feb 2025Release notes
Open source →What's Changed
- Add support for PHP up to 8.4 by @mlocati in #35 and in #38
- Include more information about DNS lookups in
OnlineSemanticValidatorby @fyrts in #37
New Contributors
- @buismaarten made their first contribution in #36
- @fyrts made their first contribution in #37
Full Changelog: 3.1.2...3.2.0
-
3.1.209 Sep 2022 -
3.1.107 Feb 2021 -
3.1.017 Nov 2020Release notes
Open source →- Added
OnlineSemanticValidatorto check for issues in real world - see the docs
- Added
-
3.0.121 Oct 2020Release notes
Open source → -
3.0.017 Jul 2020Release notes
Open source →New features
- The semantic validation now also reports usages of "p" (validated domain) macro-letter (which should be avoided)
Bug fixes
A ton of bug fixes have been addresses thanks to the usage of the OpenSPF Test Suite for RFC 7208
The most notable ones are:- correct handling of upper and lower case characters in SPF strings
- when checking an SPF record, we now have a limit of 2 for void DNS lookups
- the code now accepts more that one delimiter in macro-expand strings
- the expansion of exp modifier is now URL encoded (if the macro-string states so)
Breaking changes
- The
getPTRRecords()method of the DNS Resolver interface changed its signature (you have to update your code if you are using a custom DNS resolver)
-
2.0.115 Jul 2020 -
2.0.015 Jul 2020Release notes
Open source →New features
- You can now use this library to check the validity of an IP address/sender domain (see README.md)
- When checking for semantic issues, you can now filter for the minimum issue level
Bug fixes
- The library now handles SPF records in a case-insensitive way (as per RFC 7208)
Breaking changes
- New methods have been added to the DNS Resolver interface (you have to implement them if you are using a custom DNS resolver)
- When parsing an SPF record, the library now also checks the syntax of the mechanism/modifier arguments, throwing a new
SPFLib\Exception\InvalidMacroStringExceptionexception (which extends theSPFLib\Exception\InvalidTermExceptionexception) in case of problems - Cloning instances of
SPFLib\Recordnow clones the contained terms too - The result of the
getDomainSpec()method of thea/exists/include/mx/ptrmechanisms and theexp/redirectmodifiers is now an instance of the newSPFLib\Macro\MacroStringclass instead of a string (to get their string representation simply use(string) $mechamism->getDomainSpec()); the same applies for the result of thegetValue()method of the unknown modifier
-
1.0.208 Jul 2020 -
1.0.108 Jul 2020Nothing published for this version
-
1.0.008 Jul 2020Nothing published for this version