An open API service indexing awesome lists of open source software.

https://github.com/markelog/validate

Simple validation HTTP-service
https://github.com/markelog/validate

dmarc email http reputation smtp validate

Last synced: 14 days ago
JSON representation

Simple validation HTTP-service

Awesome Lists containing this project

README

          

# Validate [![Test](https://github.com/markelog/validate/workflows/Test/badge.svg?branch=master)](https://github.com/markelog/validate/actions)

> 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

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

### Example

#### Request

`POST /email/validate`

```sh
$ curl -i -XPOST -d '{"email":"markelog@gmail.com"}' http://localhost:8080/email/validate
```

#### Response

```sh
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`](https://en.wikipedia.org/wiki/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`](https://en.wikipedia.org/wiki/Reputation_system) � 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`](https://github.com/markelog/validate/tree/master/.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