@lacspace/email-verify 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +45 -15
- package/README.md +82 -0
- package/package.json +3 -3
package/LICENSE
CHANGED
|
@@ -1,21 +1,51 @@
|
|
|
1
|
-
|
|
1
|
+
Lacspace Free Licence
|
|
2
|
+
Version 1.0, August 2026
|
|
2
3
|
|
|
3
4
|
Copyright (c) 2026 Lacspace
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
6
|
+
PREAMBLE
|
|
11
7
|
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
This software is published by Lacspace under the Lacspace Free Licence — a free,
|
|
9
|
+
permissive licence that lets you use this software for any purpose, including in
|
|
10
|
+
commercial products and services, at no cost. It grants the same freedoms as
|
|
11
|
+
common permissive open-source licences; the only condition is that this notice
|
|
12
|
+
travels with the software. The canonical, always-current text of this licence is
|
|
13
|
+
maintained at https://lacspace.com/licenses/lacspace-free-1.0
|
|
14
|
+
|
|
15
|
+
GRANT OF RIGHTS
|
|
16
|
+
|
|
17
|
+
Permission is hereby granted, free of charge, to any person or organisation
|
|
18
|
+
obtaining a copy of this software and its associated documentation and data files
|
|
19
|
+
(the "Software"), to deal in the Software without restriction, including without
|
|
20
|
+
limitation the rights to use, copy, modify, merge, publish, distribute,
|
|
21
|
+
sublicense, and/or sell copies of the Software, and to permit persons to whom the
|
|
22
|
+
Software is furnished to do so, subject to the conditions below. These rights are
|
|
23
|
+
granted for any purpose, personal or commercial, and are perpetual, worldwide,
|
|
24
|
+
non-exclusive, and royalty-free.
|
|
25
|
+
|
|
26
|
+
CONDITIONS
|
|
27
|
+
|
|
28
|
+
The above copyright notice, this permission notice, and the name of this licence
|
|
29
|
+
("Lacspace Free Licence") shall be included in all copies or substantial portions
|
|
30
|
+
of the Software.
|
|
31
|
+
|
|
32
|
+
TRADEMARKS
|
|
33
|
+
|
|
34
|
+
This licence does not grant permission to use the trade names, trademarks, service
|
|
35
|
+
marks, logos, or product names of Lacspace, except as required to reproduce the
|
|
36
|
+
notice above or to describe the origin of the Software in a truthful manner.
|
|
37
|
+
|
|
38
|
+
DISCLAIMER OF WARRANTY AND LIMITATION OF LIABILITY
|
|
14
39
|
|
|
15
40
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
41
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
42
|
+
FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
43
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN
|
|
44
|
+
AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION
|
|
45
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
The Lacspace Free Licence is a source-available, permissive licence and is not (as
|
|
50
|
+
of this version) an OSI-approved licence. In substance it grants the same freedoms
|
|
51
|
+
as the MIT Licence. Learn more at https://lacspace.com/licenses
|
package/README.md
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
# @lacspace/email-verify
|
|
4
|
+
|
|
5
|
+
**Does this mailbox actually exist? — best-effort deliverability checks (MX + SMTP probe).**
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/@lacspace/email-verify)
|
|
8
|
+
[](https://packagephobia.com/result?p=@lacspace/email-verify)
|
|
9
|
+
[](https://bundlephobia.com/package/@lacspace/email-verify)
|
|
10
|
+
[](https://www.npmjs.com/package/@lacspace/email-verify)
|
|
11
|
+
[](https://github.com/lacspace/npm-packages/blob/main/LICENSE)
|
|
12
|
+
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
> Goes one step past syntax: resolves the domain's **MX records** and (optionally) runs a real **SMTP `RCPT TO` probe** to ask the receiving server whether the mailbox exists — **without ever sending a message**. Built on Node's `dns` + `net`.
|
|
16
|
+
|
|
17
|
+
- 🔎 Syntax + disposable (via [`@lacspace/email-validate`](https://www.npmjs.com/package/@lacspace/email-validate))
|
|
18
|
+
- 📇 MX record lookup, sorted by priority
|
|
19
|
+
- 📡 Optional SMTP RCPT probe → `deliverable` / `undeliverable` / `unknown`
|
|
20
|
+
- 🚫 No email is ever sent
|
|
21
|
+
- 🟢 Node 18+ · zero **npm** dependencies (only our own `email-validate`)
|
|
22
|
+
|
|
23
|
+
> ⚠️ **Read this.** Live SMTP verification is inherently unreliable. Many mail servers **greylist**, use **catch-all** (accept every address), or block probes outright — so `unknown` is common and a positive means *"likely deliverable"*, never a guarantee. Outbound port 25 is also blocked on many hosts (incl. most serverless/PaaS). Use it to catch obvious typos and dead domains, not as a hard gate.
|
|
24
|
+
|
|
25
|
+
## Install
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npm install @lacspace/email-verify # or pnpm add / yarn add / bun add
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Usage
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
import { verifyEmail } from "@lacspace/email-verify";
|
|
35
|
+
|
|
36
|
+
await verifyEmail("someone@gmail.com");
|
|
37
|
+
// {
|
|
38
|
+
// email: "someone@gmail.com",
|
|
39
|
+
// valid: true,
|
|
40
|
+
// syntax: true,
|
|
41
|
+
// disposable: false,
|
|
42
|
+
// role: false,
|
|
43
|
+
// mxFound: true,
|
|
44
|
+
// mxRecords: [{ exchange: "gmail-smtp-in.l.google.com", priority: 5 }, …],
|
|
45
|
+
// smtp: "unknown" // Gmail greylists probes — expected
|
|
46
|
+
// }
|
|
47
|
+
|
|
48
|
+
// MX-only (fast, reliable, no port-25 needed) — great default in cloud/serverless
|
|
49
|
+
await verifyEmail(email, { checkSmtp: false });
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Lower-level helpers
|
|
53
|
+
|
|
54
|
+
```ts
|
|
55
|
+
import { resolveMx, smtpCheck } from "@lacspace/email-verify";
|
|
56
|
+
|
|
57
|
+
await resolveMx("lacspace.com");
|
|
58
|
+
// [{ exchange, priority }, …] (sorted best-first; [] if none)
|
|
59
|
+
|
|
60
|
+
await smtpCheck("user@example.com", "mx.example.com", { timeout: 8000 });
|
|
61
|
+
// "deliverable" | "undeliverable" | "unknown"
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Options
|
|
65
|
+
|
|
66
|
+
| Option | Default | Description |
|
|
67
|
+
| --- | --- | --- |
|
|
68
|
+
| `checkSmtp` | `true` | run the live RCPT probe (set `false` for MX-only) |
|
|
69
|
+
| `fromAddress` | `verify@<hostname>` | MAIL FROM used in the probe |
|
|
70
|
+
| `timeout` | `10000` | per-connection timeout (ms) |
|
|
71
|
+
| `extraDisposable` | — | extra throwaway domains |
|
|
72
|
+
|
|
73
|
+
## The Lacspace MailKit
|
|
74
|
+
|
|
75
|
+
| Package | For |
|
|
76
|
+
| --- | --- |
|
|
77
|
+
| [`@lacspace/mailer`](https://www.npmjs.com/package/@lacspace/mailer) | Send email over SMTP |
|
|
78
|
+
| [`@lacspace/email-templates`](https://www.npmjs.com/package/@lacspace/email-templates) | Build responsive HTML emails |
|
|
79
|
+
| [`@lacspace/email-validate`](https://www.npmjs.com/package/@lacspace/email-validate) | Validate & normalize addresses |
|
|
80
|
+
| **`@lacspace/email-verify`** | MX + SMTP deliverability checks (this package) |
|
|
81
|
+
|
|
82
|
+
<div align="center"><sub>Built with care by <a href="https://lacspace.com">Lacspace</a> · Lacspace Free Licence · <a href="https://github.com/lacspace/npm-packages">source</a></sub></div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lacspace/email-verify",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Best-effort email deliverability checks for Node — syntax + disposable, MX record lookup and an optional SMTP RCPT probe (no mail sent). Zero npm dependencies.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"typescript"
|
|
38
38
|
],
|
|
39
39
|
"author": "Lacspace <contact@lacspace.com>",
|
|
40
|
-
"license": "
|
|
40
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
41
41
|
"homepage": "https://lacspace.com/packages",
|
|
42
42
|
"repository": {
|
|
43
43
|
"type": "git",
|
|
@@ -51,6 +51,6 @@
|
|
|
51
51
|
"node": ">=18"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@lacspace/email-validate": "^1.0.
|
|
54
|
+
"@lacspace/email-validate": "^1.0.1"
|
|
55
55
|
}
|
|
56
56
|
}
|