Download the PHP package emailsherlock/email-guard-core without Composer

On this page you can find all versions of the php package emailsherlock/email-guard-core. 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 email-guard-core

email-guard-core (PHP)

Reference implementation of email-guard-spec: a guard for the email field of your signup form, checkout, or any form where a fake address costs real money.

Without an API key it blocks what it can prove locally: broken syntax, reserved TLDs ([email protected] is syntactically fine and still junk), and 73k+ known disposable domains from the bundled snapshot. Zero network calls, zero latency. An EmailSherlock API key adds the data unlock: live MX, SMTP probe, a fresh disposable list, role and catch-all detection.

No framework dependency. The Symfony bundle and the WordPress plugin build on this library; use it directly anywhere PHP 8.1+ runs.

Install

Use

With an API key and a policy:

What you get back

Every check returns a Result with four spec-defined fields:

Field Type Meaning
verdict Verdict valid, invalid, disposable, role, catch_all, unknown
action Action allow, deny, review, resolved from your policy
reasons string[] machine-readable codes, e.g. reserved_tld, mailbox_not_found
degraded bool true when the API was wanted but unreachable

Plus apiCalled and apiResponse (the raw Verify API payload, informational).

Configuration

Key Default Notes
api_key null null disables the remote check entirely
block_on ['invalid', 'disposable'] verdicts that deny
review_on [] verdicts that flag for a second gate
fail_open true an API outage lets addresses through, never blocks them
timeout_ms 800 total budget for the API call
base_url https://api.emailsherlock.com override for testing

Policy is yours: the guard reports verdicts, your block_on decides what a deny is. The defaults block provable junk and let everything debatable (role addresses, catch-all domains, unknowns) through.

Fail-open is the default on purpose. A blocked legitimate customer costs more than a leaked junk signup. If the API is unreachable, the local checks keep working and the rest passes with degraded: true. Set 'fail_open' => false if your form prefers to reject on outage.

Custom HTTP client

The default transport uses ext-curl. To route the API call through your own PSR-18 client:

PSR-18 carries no per-request timeout, so configure the budget on the client itself.

Decision telemetry (optional)

With an API key you can report decisions back so the account owner sees what the guard blocks (email-guard-spec section 11). Pass a GuardReporter to the guard; it records one event per check, and you flush the batch after the response is sent (the Symfony bundle wires this to kernel.terminate):

Key-gated (no key, no telemetry), fail-silent (a reporting failure never breaks or slows the host), and it sends the domain only, never the address.

Conformance

The test suite runs every vector from email-guard-spec (vendored under tests/vectors/, synced via tests/update-vectors.sh). The same vectors run against every Email-Guard core library, so .invalid gets blocked bit-identically in PHP and in every other language.

Data

data/disposable-snapshot.json.gz is embedded from a pinned release of email-guard-data, refreshed per core-lib release (php bin/build-snapshot.php). Matching is exact, same as the API's live list: the local check never blocks an address the API would let pass.

License

MIT, see LICENSE.


All versions of email-guard-core with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
ext-json Version *
ext-zlib Version *
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 emailsherlock/email-guard-core contains the following files

Loading the files please wait ...