emails-help 0.0.0-stage → 0.1.1
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 +21 -0
- package/README.md +172 -2
- package/dist/chunk-OIVBYFTS.js +1665 -0
- package/dist/cli.cjs +1782 -0
- package/dist/cli.d.cts +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +110 -0
- package/dist/index.cjs +1711 -0
- package/dist/index.d.cts +272 -0
- package/dist/index.d.ts +272 -0
- package/dist/index.js +26 -0
- package/package.json +61 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 emails.help
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
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:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
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
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,173 @@
|
|
|
1
|
-
#
|
|
1
|
+
# emails-help
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Resolve IMAP and SMTP settings for any email address or domain — and find out **how certain the answer actually is**.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/emails-help)
|
|
6
|
+
[](./LICENSE)
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
npx emails-help someone@fastmail.com
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Zero runtime dependencies. Node 18+. Works in browsers and edge runtimes too (everything except the MX step).
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Why another one of these
|
|
17
|
+
|
|
18
|
+
Every library in this space returns a host and a port as though the two were equally certain, whether they came from the provider's own documentation or from a guess about its MX records. They are not the same thing, and the difference is the one that bites.
|
|
19
|
+
|
|
20
|
+
Spectrum is the case worth knowing. Its support article publishes outgoing port 587 with "SSL: On", and never says whether that means STARTTLS or implicit TLS. Every tool that prints a value for it is printing a guess the reader cannot tell apart from a fact. This one returns:
|
|
21
|
+
|
|
22
|
+
```js
|
|
23
|
+
smtp: {
|
|
24
|
+
host: 'mobile.charter.net',
|
|
25
|
+
port: 587,
|
|
26
|
+
security: null, // nobody stated it
|
|
27
|
+
securityDocumented: false // and that absence is the answer
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
So every result carries two extra fields nothing else gives you:
|
|
32
|
+
|
|
33
|
+
| Field | What it tells you |
|
|
34
|
+
|---|---|
|
|
35
|
+
| `method` | `dataset`, `autoconfig`, `well-known`, `ispdb`, or `mx` — where the answer came from |
|
|
36
|
+
| `confidence` | `documented`, `undocumented`, or `inferred` |
|
|
37
|
+
|
|
38
|
+
`inferred` is the one to watch. It means the MX records matched a known provider and you are being handed that provider's settings. Usually right. Never stated.
|
|
39
|
+
|
|
40
|
+
## Install
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
npm install emails-help
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Use
|
|
47
|
+
|
|
48
|
+
```js
|
|
49
|
+
import { resolve } from 'emails-help';
|
|
50
|
+
|
|
51
|
+
const result = await resolve('someone@fastmail.com');
|
|
52
|
+
|
|
53
|
+
if (result.found) {
|
|
54
|
+
console.log(result.imap); // { host, port, security, securityDocumented }
|
|
55
|
+
console.log(result.smtp);
|
|
56
|
+
console.log(result.method, result.confidence);
|
|
57
|
+
console.log(result.sources); // the pages each value was read from
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Custom domains
|
|
62
|
+
|
|
63
|
+
A business on Google Workspace has its own domain and Google's MX records. The `mx` method catches it:
|
|
64
|
+
|
|
65
|
+
```js
|
|
66
|
+
const result = await resolve('finance@somecompany.com');
|
|
67
|
+
// method: 'mx', confidence: 'inferred'
|
|
68
|
+
// notes: ['Matched by MX record (aspmx.l.google.com). The provider documents
|
|
69
|
+
// these settings; that this domain uses the provider is inferred,
|
|
70
|
+
// not stated.']
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Offline
|
|
74
|
+
|
|
75
|
+
The dataset is compiled into the package, so this makes no network calls at all:
|
|
76
|
+
|
|
77
|
+
```js
|
|
78
|
+
const result = await resolve('gmail.com', { methods: ['dataset'] });
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Providers with no IMAP or SMTP
|
|
82
|
+
|
|
83
|
+
Tuta encrypts mailboxes end to end and offers no client access. That is an answer, not missing data:
|
|
84
|
+
|
|
85
|
+
```js
|
|
86
|
+
const result = await resolve('me@tuta.com');
|
|
87
|
+
result.found; // true
|
|
88
|
+
result.clientAccess; // false
|
|
89
|
+
result.imap; // null
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Check `clientAccess` before you fall through to a guess. If it is `false`, stop.
|
|
93
|
+
|
|
94
|
+
## Options
|
|
95
|
+
|
|
96
|
+
```js
|
|
97
|
+
await resolve(input, {
|
|
98
|
+
methods: ['dataset', 'autoconfig', 'well-known', 'ispdb', 'mx'],
|
|
99
|
+
timeout: 5000, // per request, ms
|
|
100
|
+
live: false, // fetch the newest dataset instead of the bundled copy
|
|
101
|
+
});
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Methods are tried in order and the first hit wins. Drop `'mx'` if you would rather have no answer than an inferred one.
|
|
105
|
+
|
|
106
|
+
## Result
|
|
107
|
+
|
|
108
|
+
```ts
|
|
109
|
+
interface Resolution {
|
|
110
|
+
input: string;
|
|
111
|
+
domain: string;
|
|
112
|
+
|
|
113
|
+
found: boolean;
|
|
114
|
+
method: 'dataset' | 'autoconfig' | 'well-known' | 'ispdb' | 'autodiscover' | 'mx' | null;
|
|
115
|
+
confidence: 'documented' | 'undocumented' | 'inferred' | null;
|
|
116
|
+
|
|
117
|
+
provider: string | null;
|
|
118
|
+
clientAccess: boolean;
|
|
119
|
+
|
|
120
|
+
imap: Server | null;
|
|
121
|
+
pop3: Server | null;
|
|
122
|
+
smtp: SmtpServer | null;
|
|
123
|
+
|
|
124
|
+
username: string | null;
|
|
125
|
+
authentication: string | null;
|
|
126
|
+
|
|
127
|
+
undocumented: string[]; // fields the provider publishes a server for but never specifies
|
|
128
|
+
notes: string[];
|
|
129
|
+
sources: string[]; // first-party pages the values were read from
|
|
130
|
+
guide: string | null;
|
|
131
|
+
verified: string | null; // date the values were last checked
|
|
132
|
+
|
|
133
|
+
checkedAt: string;
|
|
134
|
+
trail: Array<{ method: Method; outcome: 'hit' | 'miss' | 'error'; detail?: string }>;
|
|
135
|
+
}
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
`trail` records every method tried and what it returned. Paste it into a bug report.
|
|
139
|
+
|
|
140
|
+
## CLI
|
|
141
|
+
|
|
142
|
+
```
|
|
143
|
+
npx emails-help <address|domain> [options]
|
|
144
|
+
|
|
145
|
+
--json Print the full result as JSON
|
|
146
|
+
--offline Use only the bundled dataset; make no network calls
|
|
147
|
+
--live Fetch the newest dataset from emails.help
|
|
148
|
+
--no-infer Never fall back to MX-based inference
|
|
149
|
+
--timeout <ms> Per-request timeout (default 5000)
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Exit code `0` on a hit, `2` on a miss, `1` on an error — so a script can branch on it.
|
|
153
|
+
|
|
154
|
+
## Where the data comes from
|
|
155
|
+
|
|
156
|
+
The bundled dataset is [emails.help](https://emails.help), where every value is read off the provider's own documentation and carries the page it came from and the date it was last checked. You can fetch it directly:
|
|
157
|
+
|
|
158
|
+
```
|
|
159
|
+
https://emails.help/api/email-providers.json
|
|
160
|
+
https://emails.help/api/email-providers.json?domain=posteo.de
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Licensed CC BY 4.0. The browsable version is at <https://emails.help/email-settings-dataset>.
|
|
164
|
+
|
|
165
|
+
Where the dataset has no row, the package falls back to the same lookups a mail client performs: the domain's own autoconfig file, Mozilla's ISPDB, then MX inference.
|
|
166
|
+
|
|
167
|
+
## Contributing a provider
|
|
168
|
+
|
|
169
|
+
Wrong or missing settings are a dataset problem, not a code problem. Open an issue on [emails.help](https://emails.help) with the provider's own documentation page and it gets checked against the source. Corrections ship in the next release.
|
|
170
|
+
|
|
171
|
+
## Licence
|
|
172
|
+
|
|
173
|
+
MIT for the code. The bundled dataset is CC BY 4.0, attributed to [emails.help](https://emails.help).
|