reacherhq/check-if-email-exists
GitHub: reacherhq/check-if-email-exists
基于Rust的邮箱存在性验证工具,通过SMTP握手和MX查询在不发邮件的情况下判断邮箱有效性。
Stars: 8492 | Forks: 598
[](https://crates.io/crates/check-if-email-exists)
[](https://docs.rs/check-if-email-exists)
[](https://hub.docker.com/r/reacherhq/backend)
[](https://github.com/reacherhq/check-if-email-exists/actions)
Check if an email address exists without sending any email.
## 👉 在线演示:https://reacher.email
这是开源的,但我也提供一个 **SaaS** 解决方案,将 `check-if-email-exists` 封装在一个友好的 Web 界面中。如果你感兴趣,可以在 [No2Bounce.com](https://no2bounce.com/?ref=github) 了解更多信息。如果你有任何问题,可以通过 amaury@reacher.email 联系我。
## 开始使用 使用 `check-if-email-exists` 的 3 种非 SaaS 方式。 ### 1. ⚙️ 使用 Docker 的 HTTP 后端(流行方法 🥇) [[完整文档](./backend/README.md)] 此选项允许你使用 Docker 🐳 在云实例或你自己的服务器上运行 HTTP 后端。请注意,出站端口 25 必须打开。 ``` docker run -p 8080:8080 reacherhq/backend:latest ``` 然后发送一个带有以下 body 的 `POST http://localhost:8080/v0/check_email` 请求: ``` { "to_email": "someone@gmail.com", "proxy": { // (optional) SOCK5 proxy to run the verification through, default is empty "host": "my-proxy.io", "port": 1080, "username": "me", // (optional) Proxy username "password": "pass" // (optional) Proxy password } } ``` **关于代理服务器的说明** 可以使用你自己的 IP 地址运行 Reacher。但如果你希望处理非常小的量级以上的数据,你将需要 SMTP 代理服务器。对于 SMTP 代理服务器,请使用 [proxy25.com](https://proxy25.com/?ref=github) ### 2. 下载 CLI [[完整文档](./cli/README.md)] 前往 [releases 页面](https://github.com/reacherhq/check-if-email-exists/releases) 并下载适合你平台的二进制文件。 ``` > $ check_if_email_exists --help check_if_email_exists 0.9.1 Check if an email address exists without sending an email. USAGE: check_if_email_exists [FLAGS] [OPTIONS] [TO_EMAIL] ``` 查看 [专门的 README.md](./cli/README.md) 了解所有选项和标志。 ### 3. 编程使用 [[完整文档](https://docs.rs/check-if-email-exists)] 在你自己的 Rust 项目中,你可以在 `Cargo.toml` 中添加 `check-if-email-exists`: ``` [dependencies] check-if-email-exists = "0.9" ``` 并在你的代码中按如下方式使用它: ``` use check_if_email_exists::{check_email, CheckEmailInput, CheckEmailInputProxy}; async fn check() { // Let's say we want to test the deliverability of someone@gmail.com. let mut input = CheckEmailInput::new(vec!["someone@gmail.com".into()]); // Verify this email, using async/await syntax. let result = check_email(&input).await; // `result` is a `Vec`, where the CheckEmailOutput
// struct contains all information about our email.
println!("{:?}", result);
}
```
参考文档托管在 [docs.rs](https://docs.rs/check-if-email-exists)。
## ✈️ JSON 输出
输出将是以下格式的 JSON,这些字段应该是不言自明的。对于 `someone@gmail.com`(注意它已被 Gmail 禁用),以下是确切的输出:
```
{
"input": "someone@gmail.com",
"is_reachable": "invalid",
"misc": {
"is_disposable": false,
"is_role_account": false,
"is_b2c": true
},
"mx": {
"accepts_mail": true,
"records": [
"alt3.gmail-smtp-in.l.google.com.",
"gmail-smtp-in.l.google.com.",
"alt1.gmail-smtp-in.l.google.com.",
"alt4.gmail-smtp-in.l.google.com.",
"alt2.gmail-smtp-in.l.google.com."
]
},
"smtp": {
"can_connect_smtp": true,
"has_full_inbox": false,
"is_catch_all": false,
"is_deliverable": false,
"is_disabled": true
},
"syntax": {
"domain": "gmail.com",
"is_valid_syntax": true,
"username": "someone",
"suggestion": null
}
}
```
## 此工具检查什么?
| 包含? | 功能 | 描述 | JSON 字段 |
| --------- | --------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| ✅ | **邮箱可达性** | 我们对此地址发送邮件有多大信心?可以是 `safe`、`risky`、`invalid` 或 `unknown` 之一。 | `is_reachable` |
| ✅ | **语法验证** | 地址的语法是否有效? | `syntax.is_valid_syntax` |
| ✅ | **DNS 记录验证** | 邮箱地址的域名是否有有效的 MX DNS 记录? | `mx.accepts_mail` |
| ✅ | **一次性邮箱地址 (DEA) 验证** | 该地址是否由已知的[一次性邮箱地址](https://en.wikipedia.org/wiki/Disposable_email_address)提供商提供? | `misc.is_disposable` |
| ✅ | **SMTP 服务器验证** | 能否成功连接到邮箱地址域名的邮件交换器? | `smtp.can_connect_smtp` |
| ✅ | **邮件投递性** | 发送到此地址的邮件是否可投递? | `smtp.is_deliverable` |
| ✅ | **邮箱已禁用** | 此邮箱地址是否已被邮件提供商禁用? | `smtp.is_disabled` |
| ✅ | **收件箱已满** | 此邮箱的收件箱是否已满? | `smtp.has_full_inbox` |
| ✅ | **Catch-all 地址** | 此邮箱地址是否为 [catch-all](https://debounce.io/blog/help/what-is-a-catch-all-or-accept-all/) 地址? | `smtp.is_catch_all` |
| ✅ | **角色账户验证** | 邮箱地址是否为已知的角色账户? | `misc.is_role_account` |
| ✅ | **Gravatar URL** | [Gravatar](https://gravatar.com/) 邮箱地址头像的 URL | `misc.gravatar_url` |
| ✅ | **Have I Been Pwned?** | 此邮箱是否在[数据泄露](https://haveibeenpwned.com/)中被泄露? | `misc.haveibeenpwned` |
| 🔜 | **免费邮件提供商检查** | 邮箱地址是否绑定到已知的免费邮件提供商? | [Issue #89](https://github.com/reacherhq/check-if-email-exists/issues/89) |
| 🔜 | **语法验证,特定提供商** | 根据目标邮件提供商的语法规则,该地址的语法是否有效? | [Issue #90](https://github.com/reacherhq/check-if-email-exists/issues/90) |
| 🔜 | **蜜罐检测** | 被测试的邮箱地址是否隐藏了[蜜罐](https://en.wikipedia.org/wiki/Spamtrap)? | [Issue #91](https://github.com/reacherhq/check-if-email-exists/issues/91) |
## 🤔 为什么?
许多在线服务(https://hunter.io, https://verify-email.org, https://email-checker.net)收费提供此服务。这里是这些工具的一个开源替代方案。
## 许可证
`check-if-email-exists` 的源代码在**双许可证模型**下提供。
### 商业许可证
如果你想使用 `check-if-email-exists` 开发商业网站、工具和应用程序,商业许可证是合适的许可证。使用此选项,你的源代码将保持专有。在 https://reacher.email/pricing 购买 `check-if-email-exists` 商业许可证。
### 开源许可证
如果你正在创建一个与 GNU Affero GPL License v3 兼容的开源应用程序,你可以根据 [AGPL-3.0](./LICENSE.AGPL) 的条款使用 `check-if-email-exists`。
[➡️ 阅读更多](https://docs.reacher.email/self-hosting/licensing) 关于 Reacher 许可证的信息。
## 🔨 从源代码构建
从源代码构建 [CLI](./cli/README.md#build-from-source) 或 [HTTP 后端](./backend/README.md#build-from-source)。
check-if-email-exists
Check if an email address exists without sending any email.
Comes with a ⚙️ HTTP backend.
## 👉 在线演示:https://reacher.email
## 开始使用 使用 `check-if-email-exists` 的 3 种非 SaaS 方式。 ### 1. ⚙️ 使用 Docker 的 HTTP 后端(流行方法 🥇) [[完整文档](./backend/README.md)] 此选项允许你使用 Docker 🐳 在云实例或你自己的服务器上运行 HTTP 后端。请注意,出站端口 25 必须打开。 ``` docker run -p 8080:8080 reacherhq/backend:latest ``` 然后发送一个带有以下 body 的 `POST http://localhost:8080/v0/check_email` 请求: ``` { "to_email": "someone@gmail.com", "proxy": { // (optional) SOCK5 proxy to run the verification through, default is empty "host": "my-proxy.io", "port": 1080, "username": "me", // (optional) Proxy username "password": "pass" // (optional) Proxy password } } ``` **关于代理服务器的说明** 可以使用你自己的 IP 地址运行 Reacher。但如果你希望处理非常小的量级以上的数据,你将需要 SMTP 代理服务器。对于 SMTP 代理服务器,请使用 [proxy25.com](https://proxy25.com/?ref=github) ### 2. 下载 CLI [[完整文档](./cli/README.md)] 前往 [releases 页面](https://github.com/reacherhq/check-if-email-exists/releases) 并下载适合你平台的二进制文件。 ``` > $ check_if_email_exists --help check_if_email_exists 0.9.1 Check if an email address exists without sending an email. USAGE: check_if_email_exists [FLAGS] [OPTIONS] [TO_EMAIL] ``` 查看 [专门的 README.md](./cli/README.md) 了解所有选项和标志。 ### 3. 编程使用 [[完整文档](https://docs.rs/check-if-email-exists)] 在你自己的 Rust 项目中,你可以在 `Cargo.toml` 中添加 `check-if-email-exists`: ``` [dependencies] check-if-email-exists = "0.9" ``` 并在你的代码中按如下方式使用它: ``` use check_if_email_exists::{check_email, CheckEmailInput, CheckEmailInputProxy}; async fn check() { // Let's say we want to test the deliverability of someone@gmail.com. let mut input = CheckEmailInput::new(vec!["someone@gmail.com".into()]); // Verify this email, using async/await syntax. let result = check_email(&input).await; // `result` is a `Vec
标签:Crates.io, Docker, HTTP后端, Rust, SaaS, SMTP验证, 二进制发布, 反垃圾邮件, 可视化界面, 后端服务, 地址清洗, 安全防御评估, 开源工具, 异步编程, 数据验证, 电子邮件验证, 网络安全, 网络流量审计, 脚本检测, 请求拦截, 邮箱存在性检查, 隐私保护