Skip to content

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

fix: Refactor app to make travis build binaries (#17)

Amaury Martiny9616ef5bcf6c
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b1007dd7..e7914085 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,15 +2,12 @@
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
-# [](https://github.com/amaurymartiny/check_if_email_exists/compare/v0.1.1...v) (2019-05-09)
-
+# [v0.2.0](https://github.com/amaurymartiny/check_if_email_exists/compare/v0.1.1...v0.2.0) (2019-05-09)
### Features
-* Add serverless function ([#15](https://github.com/amaurymartiny/check_if_email_exists/issues/15)) ([532c4eb](https://github.com/amaurymartiny/check_if_email_exists/commit/532c4eb))
-* Return Option<bool> instead of bool ([#13](https://github.com/amaurymartiny/check_if_email_exists/issues/13)) ([2aef345](https://github.com/amaurymartiny/check_if_email_exists/commit/2aef345))
-
-
+- Add serverless function ([#15](https://github.com/amaurymartiny/check_if_email_exists/issues/15)) ([532c4eb](https://github.com/amaurymartiny/check_if_email_exists/commit/532c4eb))
+- Return Option<bool> instead of bool ([#13](https://github.com/amaurymartiny/check_if_email_exists/issues/13)) ([2aef345](https://github.com/amaurymartiny/check_if_email_exists/commit/2aef345))
# [0.1.1](https://github.com/amaurymartiny/check_if_email_exists/compare/v0.1.0...v0.1.1) (2018-12-29)
diff --git a/Cargo.lock b/Cargo.lock
index bc743251..963e14d0 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -118,19 +118,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "check_if_email_exists"
-version = "0.2.0"
+version = "0.2.1"
dependencies = [
- "check_if_email_exists_core 0.2.0",
"clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)",
"env_logger 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
"lettre 0.9.0 (git+https://github.com/lettre/lettre?rev=1cbcbbb11f7a39a5d5d3829ce4162ca1beafedfb)",
-]
-
-[[package]]
-name = "check_if_email_exists_core"
-version = "0.2.0"
-dependencies = [
- "lettre 0.9.0 (git+https://github.com/lettre/lettre?rev=1cbcbbb11f7a39a5d5d3829ce4162ca1beafedfb)",
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"native-tls 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"rayon 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -139,9 +131,9 @@ dependencies = [
[[package]]
name = "check_if_email_exists_serverless"
-version = "0.2.0"
+version = "0.2.1"
dependencies = [
- "check_if_email_exists_core 0.2.0",
+ "check_if_email_exists 0.2.1",
"lambda_http 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"lambda_runtime 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"lettre 0.9.0 (git+https://github.com/lettre/lettre?rev=1cbcbbb11f7a39a5d5d3829ce4162ca1beafedfb)",
diff --git a/Cargo.toml b/Cargo.toml
index 9c3795f1..32f768a2 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,27 @@
+[package]
+name = "check_if_email_exists"
+version = "0.2.1"
+authors = ["Amaury Martiny <[email protected]>"]
+edition = "2018"
+
+[lib]
+name = "check_if_email_exists"
+path = "src/lib.rs"
+
+[[bin]]
+name = "check_if_email_exists"
+path = "src/cli/main.rs"
+
+[dependencies]
+clap = { version = "2.32", features = ["yaml"] }
+env_logger = "0.6"
+lettre = { git = "https://github.com/lettre/lettre", rev = "1cbcbbb11f7a39a5d5d3829ce4162ca1beafedfb" }
+log = "0.4"
+native-tls = "^0.2"
+rayon = "1.0.3"
+trust-dns-resolver = "0.10.2"
+
[workspace]
members = [
- "check_if_email_exists",
- "cli",
"serverless"
]
diff --git a/appveyor.yml b/appveyor.yml
index a7088183..ca7577ba 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -53,7 +53,7 @@ test_script:
before_deploy:
# TODO Update this to build the artifacts that matter to you
- - cargo rustc --target %TARGET% --release --bin check_if_email_exists -- -C lto
+ - cargo rustc --target %TARGET% --release -- -C lto
- ps: ci\before_deploy.ps1
deploy:
diff --git a/check_if_email_exists/Cargo.toml b/check_if_email_exists/Cargo.toml
deleted file mode 100644
index b8faefdf..00000000
--- a/check_if_email_exists/Cargo.toml
+++ /dev/null
@@ -1,12 +0,0 @@
-[package]
-name = "check_if_email_exists_core"
-version = "0.2.0"
-authors = ["Amaury Martiny <[email protected]>"]
-edition = "2018"
-
-[dependencies]
-lettre = { git = "https://github.com/lettre/lettre", rev = "1cbcbbb11f7a39a5d5d3829ce4162ca1beafedfb" }
-log = "0.4"
-native-tls = "^0.2"
-rayon = "1.0.3"
-trust-dns-resolver = "0.10.2"
diff --git a/ci/before_deploy.sh b/ci/before_deploy.sh
index e897710d..ea32cabd 100755
--- a/ci/before_deploy.sh
+++ b/ci/before_deploy.sh
@@ -18,7 +18,7 @@ main() {
test -f Cargo.lock || cargo generate-lockfile
# TODO Update this to build the artifacts that matter to you
- cross rustc --bin check_if_email_exists --target $TARGET --release -- -C lto
+ cross rustc --target $TARGET --release -- -C lto
# TODO Update this to package the right artifacts
cp target/$TARGET/release/check_if_email_exists $stage/
diff --git a/ci/script.sh b/ci/script.sh
index fd3cc920..e64b68a5 100755
--- a/ci/script.sh
+++ b/ci/script.sh
@@ -17,8 +17,8 @@ main() {
# Run the binary with a $TEST_EMAIL, to test that the tool actually works.
# TODO This only works on osx now, see #11
if [ $TRAVIS_OS_NAME = osx ]; then
- cross run --target $TARGET --bin check_if_email_exists $TEST_EMAIL | grep true
- cross run --target $TARGET --release --bin check_if_email_exists $TEST_EMAIL | grep true
+ cross run --target $TARGET $TEST_EMAIL | grep true
+ cross run --target $TARGET --release $TEST_EMAIL | grep true
fi
}
diff --git a/cli/Cargo.toml b/cli/Cargo.toml
deleted file mode 100644
index 75781659..00000000
--- a/cli/Cargo.toml
+++ /dev/null
@@ -1,11 +0,0 @@
-[package]
-name = "check_if_email_exists"
-version = "0.2.0"
-authors = ["Amaury Martiny <[email protected]>"]
-edition = "2018"
-
-[dependencies]
-check_if_email_exists_core = { path = "../check_if_email_exists" }
-clap = { version = "2.32", features = ["yaml"] }
-env_logger = "0.6"
-lettre = { git = "https://github.com/lettre/lettre", rev = "1cbcbbb11f7a39a5d5d3829ce4162ca1beafedfb" }
diff --git a/serverless/Cargo.toml b/serverless/Cargo.toml
index 5a400223..0196b129 100644
--- a/serverless/Cargo.toml
+++ b/serverless/Cargo.toml
@@ -1,11 +1,11 @@
[package]
name = "check_if_email_exists_serverless"
-version = "0.2.0"
+version = "0.2.1"
authors = ["Amaury Martiny <[email protected]>"]
edition = "2018"
[dependencies]
-check_if_email_exists_core = { path = "../check_if_email_exists" }
+check_if_email_exists = { path = ".." }
lambda_http = "0.1"
lambda_runtime = "0.2"
lettre = { git = "https://github.com/lettre/lettre", rev = "1cbcbbb11f7a39a5d5d3829ce4162ca1beafedfb" }
diff --git a/serverless/README.md b/serverless/README.md
index bcbbd4b6..0ff18abe 100644
--- a/serverless/README.md
+++ b/serverless/README.md
@@ -8,7 +8,9 @@ To try it out, follow the steps below:
Follow serverless's guide: https://serverless.com/framework/docs/providers/aws/guide/quick-start/.
-#### Invoke the function locally change `[email protected]` to the email your wish to test inside `payload.json`, and run from the root folder:
+#### Invoke the function locally
+
+Change `[email protected]` to the email your wish to test inside `payload.json`, and run from the root folder:
Note: you need to have Docker installed.
diff --git a/serverless/src/main.rs b/serverless/src/main.rs
index 0ce06d34..7fea79f7 100644
--- a/serverless/src/main.rs
+++ b/serverless/src/main.rs
@@ -3,7 +3,7 @@ extern crate lambda_runtime;
extern crate lettre;
extern crate serde_json;
-use check_if_email_exists_core::email_exists;
+use check_if_email_exists::email_exists;
use lambda_http::{lambda, IntoResponse, Request, RequestExt};
use lambda_runtime::{error::HandlerError, Context};
use lettre::EmailAddress;
diff --git a/cli/src/cli.yml b/src/cli/cli.yml
similarity index 100%
rename from cli/src/cli.yml
rename to src/cli/cli.yml
diff --git a/cli/src/main.rs b/src/cli/main.rs
similarity index 92%
rename from cli/src/main.rs
rename to src/cli/main.rs
index 22ecd211..7904e348 100644
--- a/cli/src/main.rs
+++ b/src/cli/main.rs
@@ -1,10 +1,9 @@
extern crate env_logger;
#[macro_use]
extern crate clap;
-extern crate check_if_email_exists_core;
extern crate lettre;
-use check_if_email_exists_core::email_exists;
+use check_if_email_exists::email_exists;
use clap::App;
use lettre::EmailAddress;
use std::process;
diff --git a/check_if_email_exists/src/lib.rs b/src/lib.rs
similarity index 100%
rename from check_if_email_exists/src/lib.rs
rename to src/lib.rs
diff --git a/check_if_email_exists/src/mx_hosts.rs b/src/mx_hosts.rs
similarity index 100%
rename from check_if_email_exists/src/mx_hosts.rs
rename to src/mx_hosts.rs
diff --git a/check_if_email_exists/src/smtp.rs b/src/smtp.rs
similarity index 100%
rename from check_if_email_exists/src/smtp.rs
rename to src/smtp.rs