Skip to content

markelog/validate

Repository files navigation

Validate Test

Simple validation HTTP-service

Intro

It's a simple HTTP validation service, with one available route /email/validate. Which validates the email via POST request

Start

$ docker run -t -p 8080:8080 -e PORT=8080 markelog/validate

Example

Request

POST /email/validate

$ curl -i -XPOST -d '{"email":"[email protected]"}' http://localhost:8080/email/validate

Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Vary: Origin
Date: Mon, 24 Feb 2020 12:18:58 GMT
Content-Length: 150

{"valid":true,"validators":{"dmarc":{"valid":true},"domain":{"valid":true},"regexp":{"valid":true},"reputation":{"valid":true},"smtp":{"valid":true}}}

Checks

  • regexp – checks the syntax of the provided email
  • dmarc – checks DMARC related presence in the domain DNS
  • domain – checks if email domain exist
  • smtp – establishes connection to the SMTP service, sends RCPT TO request thus checking if such email address exist
  • reputation – checks the reputation of the email via https://emailrep.io/.
    • Note: Amount of request from one IP-address is limited, it's better to provide the key (see /.env.example). If limit is exceed, response from emailrep.io will not be present in the response

Development

Commands

  • make install – installs stuff
  • make dev – starts the server and watches changes
  • make unit-tests – executes unit-tests
  • make integrations-tests – executes integration-tests
  • make test – executes unit and integration tests
  • make lint – lint sources via multiple linters