michael orlitzky


get it

Browse source
Clone it
git clone https://gitweb.michael.orlitzky.com/email-validator.git

What is it?

It validates email addresses, i.e. takes a list and removes the bad ones. Or at least it tries to, without sending any mail.

We validate the email addresses using three techniques:

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:

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


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


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


user $ email-validator [-har] [-i FILE] [-o FILE] <input>


--accept-a, -a
Accept an A record for the domain instead of requiring an MX record (the default).
--input, -i
Specify the input file containing a list of email addresses, rather than using stdin (the default).
--output, -o
Specify the output file to which the good addresses will be written, rather than using stdout (the default).
--rfc5322, -r
Verify addresses against RFC 5322 rather than a naive regular expression. This is much more lenient than the default.


All of the software dependencies are listed in the email-validator.cabal file. Just use cabal to build it.


Cabal handles the build, so do whatever you normally do to install cabal packages. If you just want to install it for your user,

user $ runghc Setup.hs configure --user

user $ runghc Setup.hs build

user $ runghc Setup.hs install

should do it.

How to report bugs

Email them to me at michael@orlitzky.com.