Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can I supply the starting SPF record? #24

Closed
gunsuka opened this issue Mar 9, 2022 · 4 comments
Closed

Can I supply the starting SPF record? #24

gunsuka opened this issue Mar 9, 2022 · 4 comments

Comments

@gunsuka
Copy link

gunsuka commented Mar 9, 2022

Is there any way to use this library by supplying the IP, and SPF record to see if it is a valid IP according to the SPF record I provide?

Currently you can supply the IP & domain name and it will lookup the TXT record in DNS.

I would like to supply my own starting TXT record and an associated IP address. Then the system could perform its checks. Possible?

@mlocati
Copy link
Owner

mlocati commented Mar 9, 2022

Sure: you can use the SPFLib\Check\Environment class to do that.

@mlocati
Copy link
Owner

mlocati commented Mar 9, 2022

You can also use a custom SPFLib\DNS\Resolver class to emulate a TXT record for specific domains.

@gunsuka
Copy link
Author

gunsuka commented Mar 9, 2022

That is fantastic that the library can already do it. Is there any documentation or example? I looked through the code but I can't see anything that looks like I would be able to push an IP address and SPF record into the system.

@mlocati
Copy link
Owner

mlocati commented Mar 9, 2022

No documentation.
You can use the SPFLib\Checker class.

  • When building an instance of it, use a custom SPFLib\DNS\Resolver instance that provides the TXT records for your domiains.
  • When invoking its check method, use an SPFLib\Check\Environment containing the IP address you want.

@mlocati mlocati closed this as completed Mar 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants