Skip to content

Commit

Permalink
fix: Don't check inputted email if catch-all (#714)
Browse files Browse the repository at this point in the history
* fix: Don't check inputted email if catch-all

* 0.8.15

* Fix lint
  • Loading branch information
amaury1093 authored Nov 11, 2020
1 parent 18a97af commit 5129dd1
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 10 deletions.
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

0 comments on commit 5129dd1

Please sign in to comment.