Skip to content

Check if an email address exists without sending any email, written in Rust. Comes with a ⚙️ HTTP backend.

refactor: Move CLI to subfolder (#1137)

Amaury329af49d0638
diff --git a/Cargo.lock b/Cargo.lock
index 722b9f94..bd077b4c 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -312,7 +312,7 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "check-if-email-exists"
-version = "0.8.31"
+version = "0.8.32"
dependencies = [
"async-native-tls",
"async-recursion",
@@ -334,7 +334,7 @@ dependencies = [
[[package]]
name = "check-if-email-exists-cli"
-version = "0.8.31"
+version = "0.8.32"
dependencies = [
"check-if-email-exists",
"clap",
diff --git a/Cargo.toml b/Cargo.toml
index 43860615..80996153 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,39 +1,6 @@
-[package]
-name = "check-if-email-exists-cli"
-version = "0.8.31"
-default-run = "check_if_email_exists"
-edition = "2018"
-description = "Check if an email address exists without sending any email."
-authors = ["Amaury <[email protected]>"]
-license = "AGPL-3.0"
-publish = false
-
-[[bin]]
-name = "check_if_email_exists"
-path = "src/main.rs"
-
-[dependencies]
-check-if-email-exists = { path = "./core" }
-clap = { version = "3.2.16", features = ["derive", "env"] }
-env_logger = "0.9.0"
-once_cell = "1.13.0"
-openssl = { version = "0.10.41", features = ["vendored"] }
-serde = "1.0.143"
-serde_json = "1.0.83"
-
-[dependencies.hyper]
-version = "0.14.20"
-features = ["full"]
-
-[dependencies.tokio]
-version = "1.16.1"
-features = ["macros", "net", "io-util", "rt-multi-thread"]
-
-[profile.release]
-lto = true
-
[workspace]
members = [
+ "cli",
"core",
"test_suite"
]
diff --git a/Dockerfile b/Dockerfile
index 4d836796..9030999f 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -8,7 +8,7 @@ FROM alpine
# `ciee` stands for check-if-email-exists
WORKDIR /ciee
# Fetch latest version
-ENV CIEE_VERSION 0.8.31
+ENV CIEE_VERSION 0.8.32
# Install needed libraries
RUN apk update && \
diff --git a/README.md b/README.md
index ca2eda79..fd31c7eb 100644
--- a/README.md
+++ b/README.md
@@ -88,7 +88,7 @@ Head to the [releases page](https://github.com/reacherhq/check-if-email-exists/r
```
> $ check_if_email_exists --help
-check_if_email_exists 0.8.31
+check_if_email_exists 0.8.32
Check if an email address exists without sending an email.
USAGE:
@@ -164,9 +164,11 @@ async fn check() {
input
.set_from_email("[email protected]".into()) // Used in the `MAIL FROM:` command
.set_hello_name("example.org".into()) // Used in the `EHLO` command
- .set_proxy(CheckEmailInputProxy { // Use a SOCKS5 proxy to verify the email
+ .set_proxy(CheckEmailInputProxy { // Use a SOCKS5 proxy to verify the email
host: "my-proxy.io".into(),
- port: 1080
+ port: 1080,
+ username: None, // You can also set it non-empty
+ password: None
});
// Verify this email, using async/await syntax.
diff --git a/cli/Cargo.toml b/cli/Cargo.toml
new file mode 100644
index 00000000..07664721
--- /dev/null
+++ b/cli/Cargo.toml
@@ -0,0 +1,33 @@
+[package]
+name = "check-if-email-exists-cli"
+version = "0.8.32"
+default-run = "check_if_email_exists"
+edition = "2018"
+description = "Check if an email address exists without sending any email."
+authors = ["Amaury <[email protected]>"]
+license = "AGPL-3.0"
+publish = false
+
+[[bin]]
+name = "check_if_email_exists"
+path = "src/main.rs"
+
+[dependencies]
+check-if-email-exists = { path = "../core" }
+clap = { version = "3.2.16", features = ["derive", "env"] }
+env_logger = "0.9.0"
+once_cell = "1.13.0"
+openssl = { version = "0.10.41", features = ["vendored"] }
+serde = "1.0.143"
+serde_json = "1.0.83"
+
+[dependencies.hyper]
+version = "0.14.20"
+features = ["full"]
+
+[dependencies.tokio]
+version = "1.16.1"
+features = ["macros", "net", "io-util", "rt-multi-thread"]
+
+[profile.release]
+lto = true
diff --git a/src/http.rs b/cli/src/http.rs
similarity index 100%
rename from src/http.rs
rename to cli/src/http.rs
diff --git a/src/main.rs b/cli/src/main.rs
similarity index 100%
rename from src/main.rs
rename to cli/src/main.rs
diff --git a/core/Cargo.toml b/core/Cargo.toml
index be307bd2..9dccd789 100644
--- a/core/Cargo.toml
+++ b/core/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "check-if-email-exists"
-version = "0.8.31"
+version = "0.8.32"
authors = ["Amaury <[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.rs
index 74d3f9f5..db5dfad2 100644
--- a/core/src/lib.rs
+++ b/core/src/lib.rs
@@ -45,10 +45,12 @@
//! input
//! .set_from_email("[email protected]".into()) // Used in the `MAIL FROM:` command
//! .set_hello_name("example.org".into()) // Used in the `EHLO` command
-//! .set_smtp(587) // Use port 587 instead of 25
+//! .set_smtp_port(587) // Use port 587 instead of 25
//! .set_proxy(CheckEmailInputProxy { // Use a SOCKS5 proxy to verify the email
//! host: "my-proxy.io".into(),
-//! port: 1080
+//! port: 1080,
+//! username: None, // You can also set it non-empty
+//! password: None
//! });
//!
//! // Verify this input, using async/await syntax.