$ show reacherhq/check-if-email-exists
Reacher is an open-source email verification system written in Rust. It checks if an email address exists without sending any email by performing syntax validation, MX record lookup, SMTP connection with intelligent response parsing, and miscellaneous checks (disposable, role-based, gravatar, haveibeenpwned). The system is structured as a Rust workspace with four crates: a core library (`check-if-email-exists`), a CLI binary, an HTTP backend server (`reacher_backend`), and an AWS SQS Lambda worker. The backend provides REST API endpoints for single and bulk email verification, supports queue-based scaling via RabbitMQ, and stores results in PostgreSQL. It features a flexible verification method configuration allowing per-provider overrides (Gmail, Hotmail, Yahoo, etc.) with SMTP, headless browser, or API methods, and supports SOCKS5 proxies with routing rules. The codebase demonstrates strong Rust craftsmanship with clean abstractions, builder patterns, comprehensive error handling, and thorough testing.
The LLM identified 4 files worth highlighting for reuse:
Defines a flexible verification method configuration with per-email-provider overrides (Gmail, Hotmail B2B/B2C, Yahoo, Mimecast, Proofpoint, everything else). Each provider can be verified via SMTP, headless browser, or API, with optional proxy assignment from a named proxy pool. Includes validation that referenced proxies exist. This module is self-contained, serializable, and can be extracted as a reusable configuration pattern for any multi-provider service with routing rules.
Parses SMTP server response strings to classify email deliverability outcomes: invalid (mailbox doesn't exist), full inbox, disabled account, greylisting, IP blacklisted, needs reverse DNS. Uses case-insensitive substring matching against known error patterns. This module encapsulates the complex heuristics of SMTP response interpretation and can be reused in any email verification system that needs to interpret server replies.
Implements a thread-safe throttle manager with configurable per-second, per-minute, per-hour, and per-day request limits. Uses an internal mutex-protected state with automatic counter resets. Provides a `check_throttle` method that returns the delay and limit type if exceeded. This module is independent of the rest of the codebase and can be extracted as a reusable rate-limiting component for any Rust service.
Loads domain-specific and MX-specific rules from a JSON file (rules.json) and provides a `has_rule` function to check if a domain or MX host matches a rule (e.g., SkipCatchAll, SmtpTimeout45s). Uses lazy static initialization for efficiency. This pattern is a clean, extensible way to encode per-domain behavior and can be reused in any system that needs rule-based configuration driven by external data.