Clojure library that checks email addresses before you send to them or save them:
jane@gmial.com → did you mean jane@gmail.com?No API key, no account. It's the Clojure version of the free checker at bouncelens.com and returns the same results.
It never connects to the recipient's mail server, so it can't confirm that a mailbox exists. The best status is
:unconfirmed(format and domain OK).
;; deps.edn
net.clojars.akshaycu777/bouncelens-email-check {:mvn/version "1.0.0"}
;; Leiningen
[net.clojars.akshaycu777/bouncelens-email-check "1.0.0"]
(require '[bouncelens.email-check :as ec])
(ec/check-one "jane@gmial.com")
;; => {:status :risky, :did-you-mean "jane@gmail.com",
;; :reasons ["..." "Looks like a typo of gmail.com"], :flags {...}, ...}
(def results (ec/check ["jane@gmail.com" "temp@mailinator.com" "Jane@Gmail.com"]))
(ec/summarize results)
;; => {:total 3, :unconfirmed 1, :risky 1, :duplicates 1, ...}
:status | Meaning |
|---|---|
:invalid | Will bounce: bad syntax, domain doesn't exist, no mail server, or null MX |
:risky | Disposable domain, likely typo, no MX record, non-English characters before @, or the DNS lookup failed |
:unconfirmed | Format and domain OK. The mailbox itself isn't checked |
Options for check: :concurrency (domains looked up at once, default 8), :disposable (your own set), :lookup ((fn [domain] -> info), e.g. a cached resolver).
Each unique domain is looked up once per call. Only the domain is sent to Cloudflare's DNS-over-HTTPS resolver (1.1.1.1). Requires Java 11+.
lein test
Offline: test-resources/dns.json holds recorded DNS answers and golden.json the BounceLens JavaScript engine's results for the same inputs; the Clojure code must match them exactly.
MIT. Disposable-domain list: disposable-email-domains (CC0).
Can you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |