repositorypackage
0.0.0-20200224140912-628de3e3b07b
Repository: https://github.com/markelog/validate.git
Documentation: pkg.go.dev
# README
Validate 
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 emaildmarc
checks DMARC related presence in the domain DNSdomain
checks if email domain existsmtp
establishes connection to the SMTP service, sendsRCPT TO
request thus checking if such email address existreputation
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 fromemailrep.io
will not be present in the response
- Note: Amount of request from one IP-address is limited, it's better to provide the key (see
Development
Commands
make install
installs stuffmake dev
starts the server and watches changesmake unit-tests
executes unit-testsmake integrations-tests
executes integration-testsmake test
executes unit and integration testsmake lint
lint sources via multiple linters