Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Email validation with disposable detection, blocklists and allowlists in TypeScript

Описание и применение

mailrules позволяет разработчикам конфигурировать правила проверки email, включая блокировку disposable‑провайдеров, списки блокировки и разрешения, а также доменные ограничения, возвращая стабильные коды причин отказа.

Задача

An email can have valid syntax and still fail an application's signup rules, such as rejecting disposable providers, blocking specific mailboxes, or accepting only addresses from a company's domain.

Результат

mailrules enables developers to enforce complex email validation policies without network requests, providing clear reason codes for each rejection and supporting custom disposable domain data.

Рабочий процесс

  • Install mailrules via npm
  • Create a validator with createEmailValidator and configure blocklist, allowlist, or disposableDomains
  • Reuse the validator instance for multiple checks
  • Call validator.check(email) to get a result object with valid and reasons
  • Use allowlistMode:'only' to restrict access to specific domains or addresses
  • Set includeSubdomains:false to require exact domain matches
  • Update dependencies or supply new data to refresh disposable domain lists

Доказательства

I built mailrules to bring those decisions into one configurable TypeScript/JavaScript API.

Источник

Create the validator once and reuse it. Lists are copied, normalized and indexed during construction. Validation is synchronous and makes no network requests.

Источник

An explicit block always wins over an allowlist exception. The result includes a stable reason code so the application can decide what feedback to show.

Источник

  • Дата записи: 2026-10-27T01:11:17.374Z