email-validator

Perform basic syntax and deliverability checks on email addresses.

Latest on Hackage:0.0.3

This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow stackage.org to host generated Haddocks.

GPL-3 licensed by Michael Orlitzky
Maintained by Michael Orlitzky

Validate an email address using three techniques:

  • Ensuring that the length of local and domain parts is within the RFC-specified limits.

  • A syntax check using a regular expression, or the full RFC 5322 grammar (see the --rfc5322 option).

  • Confirmation of the existence of an MX record for the domain part of the address. This is not required; in fact many domains accept mail via an A record for e.g. example.com which is used in lieu of an MX record. This behavior can be controlled via the --accept-a flag.

These checks are performed in parallel using the number of available threads. To increase the number of threads, you can pass the appropriate flag to the GHC runtime.

This will set the number of threads to 25:

$ email-validator -i addresses.csv +RTS -N25

Input

The input file (default: stdin) should be a list of email addresses, one per line. Empty lines will be ignored.

Output

Valid email addresses will be written to the output file (default: stdout), one per line.

comments powered byDisqus