Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Don't check inputted email if catch-all #714

Merged
merged 3 commits into from
Nov 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "check-if-email-exists-cli"
version = "0.8.14"
version = "0.8.15"
default-run = "check_if_email_exists"
edition = "2018"
license = "AGPL-3.0"
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM alpine
# `ciee` stands for check-if-email-exists
WORKDIR /ciee
# Fetch latest version
ENV CIEE_VERSION 0.8.14
ENV CIEE_VERSION 0.8.15

# Install needed libraries
RUN apk update && \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,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.14
check_if_email_exists 0.8.15
Check if an email address exists without sending any email.

USAGE:
Expand Down
2 changes: 1 addition & 1 deletion core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "check-if-email-exists"
version = "0.8.14"
version = "0.8.15"
authors = ["Amaury Martiny <amaury.martiny@protonmail.com>"]
categories = ["email"]
description = "Check if an email address exists without sending any email"
Expand Down
13 changes: 11 additions & 2 deletions core/src/smtp/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ async fn email_deliverable(
let message = message.to_lowercase();
let is_deliverable = message.contains("2.1.5") ||
// 250 Recipient address accepted
message.contains("recipient address accepted");
// 250 Accepted
message.contains("accepted");
Ok(Deliverability {
has_full_inbox: false,
is_deliverable,
Expand Down Expand Up @@ -357,7 +358,15 @@ async fn create_smtp_future(
let is_catch_all = smtp_is_catch_all(&mut smtp_client, domain)
.await
.unwrap_or(false);
let deliverability = email_deliverable(&mut smtp_client, to_email).await?;
let deliverability = if is_catch_all {
Deliverability {
has_full_inbox: false,
is_deliverable: true,
is_disabled: false,
}
} else {
email_deliverable(&mut smtp_client, to_email).await?
};

smtp_client.close().await?;

Expand Down
2 changes: 1 addition & 1 deletion test_suite/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "check-if-email-exists-test-suite"
version = "0.8.14"
version = "0.8.15"
edition = "2018"
publish = false

Expand Down