Check if an email address exists without sending any email, written in Rust. Comes with a ⚙️ HTTP backend.
Rust emailemail-validationemail-validation-apiemail-verificationemail-verification-apiemail-verifierhacktoberfest
feat: Expose misc, syntax, mx, smtp modules (#373)
Amaury Martiny7c1d741f00b3
diff --git a/Cargo.lock b/Cargo.lockindex 64e26321..9a7cfc23 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -213,7 +213,7 @@ checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"[[package]]name = "check-if-email-exists"-version = "0.8.4"+version = "0.8.5"dependencies = ["async-smtp","fast-socks5",@@ -228,7 +228,7 @@ dependencies = [[[package]]name = "check-if-email-exists-cli"-version = "0.8.4"+version = "0.8.5"dependencies = ["check-if-email-exists","clap",@@ -241,7 +241,7 @@ dependencies = [[[package]]name = "check-if-email-exists-test-suite"-version = "0.8.4"+version = "0.8.5"dependencies = ["check-if-email-exists","serde",diff --git a/Cargo.toml b/Cargo.tomlindex c26340da..74cdb1ef 100644--- a/Cargo.toml+++ b/Cargo.toml@@ -1,6 +1,6 @@[package]name = "check-if-email-exists-cli"-version = "0.8.4"+version = "0.8.5"default-run = "check_if_email_exists"edition = "2018"license = "AGPL-3.0"diff --git a/Dockerfile b/Dockerfileindex 719fb763..e9c11cfd 100644--- a/Dockerfile+++ b/Dockerfile@@ -3,7 +3,7 @@ FROM alpine# `ciee` stands for check-if-email-existsWORKDIR /ciee# Fetch latest version-ENV CIEE_VERSION 0.8.4+ENV CIEE_VERSION 0.8.5# Install needed librariesRUN apk update && \diff --git a/Procfile b/Procfilenew file mode 100644index 00000000..bdab52f6--- /dev/null+++ b/Procfile@@ -0,0 +1 @@+web: ./target/release/check_if_email_exists --http --http-host 0.0.0.0diff --git a/README.md b/README.mdindex ab050958..63d9093c 100644--- a/README.md+++ b/README.md@@ -12,9 +12,12 @@<br /><br /><br />-#### 👉 Try it here: https://reacher.email+## 👉 Live Demo: https://reacher.email-This software is licensed under the AGPL-3.0 license, which forbids it being integrated and distributed in closed-source commercials projects. [Message me](mailto:[email protected]) if you wish an alternate licensing.+You can also:+[](https://heroku.com/deploy?template=https://github.com/amaurymartiny/check-if-email-exists)++**IMPORTANT:** This software is licensed under the AGPL-3.0 license, which forbids it being integrated and distributed in closed-source commercials projects. [Message me](mailto:[email protected]) if you wish an alternate licensing.## What Does This Tool Check?@@ -40,17 +43,23 @@ This software is licensed under the AGPL-3.0 license, which forbids it being intMany online services (https://hunter.io, https://verify-email.org, https://email-checker.net) offer this service for a paid fee. Here is an open-source alternative to those tools.-## 🚀 Try It Yourself+## Try It Yourself-There are 4 ways you can try `check-if-email-exists`.+There are 5 ways you can try `check-if-email-exists`.-### 1. Use the Hosted Version: https://reacher.email+### 1. Use the Hosted Version: https://reacher.email 🥇-This web app is also open-source, at https://github.com/reacherhq/.+This simple SaaS is also open-source by the way: https://github.com/reacherhq.If you would like to self-host it yourself and have questions, send me a message.-### 2. Use Docker+### 2. Deploy to Heroku++[](https://heroku.com/deploy?template=https://github.com/amaurymartiny/check-if-email-exists)++Heroku's servers have SMTP port 25 open, and have static IPs able to connect to most email providers (unless of course if you start heavily spamming these providers).++### 3. Use DockerThe [Docker image](./Dockerfile) is hosted on Docker Hub: https://hub.docker.com/r/amaurymartiny/check-if-email-exists.@@ -76,7 +85,7 @@ curl -X POST -d'{"to_emails":["[email protected]"]}' http://localhost:3000Optionally, you can also pass in `from_email` and `hello_name` fields into the JSON object, see the help message below to understand their meanings.-### 3. Download the Binary+### 4. Download the Binary> Note: The binary doesn't connect to any backend, it checks the email directly from your computer.@@ -84,7 +93,7 @@ Head to the [releases page](https://github.com/amaurymartiny/check-if-email-exis```> $ check_if_email_exists --help-check_if_email_exists 0.8.4+check_if_email_exists 0.8.5Check if an email address exists without sending any email.USAGE:@@ -132,7 +141,7 @@ Optionally, you can also pass in `from_email` and `hello_name` fields into the JRUST_LOG=debug check_if_email_exists [FLAGS] [OPTIONS] [TO_EMAIL]```-### 4. Usage as a Rust Library+### 5. Usage as a Rust LibraryIn your own Rust project, you can add `check-if-email-exists` in your `Cargo.toml`:@@ -208,9 +217,13 @@ You can also take a look at the [OpenAPIv3 specification](https://reacher.email/## ❓ FAQ+### What does `is_reachable: "unknown"` mean?++This means that the server does not allow real-time verification of an email right now. It may happen for multiple reasons: your IP is blacklisted, the SMTP port 25 is blocked, the email account is momentarily receiving too many emails (spam protection)... or the email provider simply does not allow real-time verification at all. The details of this `"unknown"` case can be found in the `smtp.error` and `mx.error` fields.+### The library hangs/takes a long time/doesn't show anything after 1 minute.-Most ISPs block outgoing SMTP requests through port 25, to prevent spam. `check-if-email-exists` needs to have this port open to make a connection to the email's SMTP server, so won't work behind these ISPs, and will instead hang until it times out. There's unfortunately no easy workaround for this problem, see for example [this StackOverflow thread](https://stackoverflow.com/questions/18139102/how-to-get-around-an-isp-block-on-port-25-for-smtp). One solution is to rent a Linux cloud server with a static IP and no blocked ports.+Most ISPs block outgoing SMTP requests through port 25, to prevent spam. `check-if-email-exists` needs to have this port open to make a connection to the email's SMTP server, so won't work behind these ISPs, and will instead hang until it times out. There's unfortunately no easy workaround for this problem, see for example [this StackOverflow thread](https://stackoverflow.com/questions/18139102/how-to-get-around-an-isp-block-on-port-25-for-smtp). One solution is to rent a Linux cloud server with a static IP and no blocked ports, see for example our [Deploy to Heroku](#2-deploy-to-heroku) section.To see in details what the binary is doing behind the scenes, run it in verbose mode to see the logs.diff --git a/app.json b/app.jsonnew file mode 100644index 00000000..0ab225e8--- /dev/null+++ b/app.json@@ -0,0 +1,14 @@+{+ "name": "check-if-email-exists",+ "buildpacks": [{ "url": "emk/rust" }],+ "description": "Check if an email address exists without sending any email, written in Rust",+ "keywords": [+ "email",+ "smtp",+ "rust",+ "email-validation",+ "email-verification"+ ],+ "logo": "https://storage.googleapis.com/saasify-uploads-prod/696e287ad79f0e0352bc201b36d701849f7d55e7.svg",+ "repository": "https://github.com/amaurymartiny/check-if-email-exists"+}diff --git a/core/Cargo.toml b/core/Cargo.tomlindex 59e866eb..2ad75350 100644--- a/core/Cargo.toml+++ b/core/Cargo.toml@@ -1,6 +1,6 @@[package]name = "check-if-email-exists"-version = "0.8.4"+version = "0.8.5"authors = ["Amaury Martiny <[email protected]>"]categories = ["email"]description = "Check if an email address exists without sending any email"diff --git a/core/src/lib.rs b/core/src/lib.rsindex 88da990a..fa2a68c6 100644--- a/core/src/lib.rs+++ b/core/src/lib.rs@@ -55,10 +55,10 @@//! }//! ```-mod misc;-mod mx;-mod smtp;-mod syntax;+pub mod misc;+pub mod mx;+pub mod smtp;+pub mod syntax;mod util;use async_smtp::{smtp::SMTP_PORT, EmailAddress};diff --git a/test_suite/Cargo.toml b/test_suite/Cargo.tomlindex 82c651b8..4692d101 100644--- a/test_suite/Cargo.toml+++ b/test_suite/Cargo.toml@@ -1,6 +1,6 @@[package]name = "check-if-email-exists-test-suite"-version = "0.8.4"+version = "0.8.5"edition = "2018"publish = false