我构建了 burner-bouncer:一个零依赖的一次性邮箱检测器,适用于 JavaScript 和 Python
Source: Dev.to
概述
有没有遇到用户使用 test@mailinator.com 或 fake@guerrillamail.com 注册?
一次性邮箱地址会给任何依赖真实用户联系信息的应用带来麻烦。
我创建了 burner‑bouncer 来解决这个问题——一个零依赖的库,能够即时检测一次性/临时邮箱域名,无需 API 调用,也不进行外部请求。
- 🚫 开箱即用,阻止 629 个真实一次性域名
- ⚡ 零运行时依赖
- 🟦 TypeScript 优先(ESM + CJS)
- 🐍 支持 Python 3.8+
- 🔁 两种语言的 API 完全一致
JavaScript / TypeScript
npm install burner-bouncer
import { isDisposable, check } from 'burner-bouncer';
isDisposable('test@mailinator.com'); // true
isDisposable('user@gmail.com'); // false
const result = check('test@mailinator.com');
// {
// email: 'test@mailinator.com',
// domain: 'mailinator.com',
// isDisposable: true,
// reason: 'blocklist'
// }
Python
pip install burner-bouncer
from burner_bouncer import is_disposable, check
is_disposable('test@mailinator.com') # True
is_disposable('user@gmail.com') # False
result = check('test@mailinator.com')
print(result.to_dict())
# {'email': 'test@mailinator.com', 'domain': 'mailinator.com',
# 'is_disposable': True, 'reason': 'blocklist'}
阻止列表是一个包含 629 个已知一次性域名的 JSON 文件,随安装一起打包。没有网络请求、没有 API 密钥、没有速率限制——只需一次快速的 Set 查找。
链接
- GitHub:
- npm:
- PyPI:
欢迎提交 PR 添加更多域名!