-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.cjs
86 lines (85 loc) · 2.27 KB
/
index.cjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
// DO NOT EDIT DIRECTLY
'use strict';Object.defineProperty(exports,Symbol.toStringTag,{value:'Module'});const dns=require('node:dns/promises');const OTM_HOSTS = new Set([
"recv6.erinn.biz",
"recv7.erinn.biz",
"recv8.erinn.biz",
"recv1.erinn.biz",
"recv100.erinn.biz",
"recv101.erinn.biz",
"recv2.erinn.biz",
"recv3.erinn.biz",
"recv4.erinn.biz",
"email-fake.com",
"emailfake.com",
"emailfake.com",
"generator.email",
"in.mail.tm",
"mail.mailinator.com",
"mail.onetimemail.org",
"mail2.mailinator.com",
"mailinator.com",
"mx.mail-data.net",
"mx1-hosting.jellyfish.systems",
"mx1.emaildbox.pro",
"mx1.forwardemail.net",
"mx1.simplelogin.co",
"mx2-hosting.jellyfish.systems",
"mx2.den.yt",
"mx2.emaildbox.pro",
"mx2.forwardemail.net",
"mx2.simplelogin.co",
"mx3-hosting.jellyfish.systems",
"mx3.emaildbox.pro",
"mx4.emaildbox.pro",
"mx5.emaildbox.pro",
"prd-smtp.10minutemail.com",
"route1.mx.cloudflare.net",
"route2.mx.cloudflare.net",
"route3.mx.cloudflare.net",
"tempm.com",
]);
const OTM_IPS = new Set([
"136.243.103.68",
"137.184.243.159",
"146.190.197.86",
"15.204.213.223",
"15.235.72.244",
"15.235.72.245",
"157.230.67.25",
"164.90.254.47",
"167.114.206.221",
"167.172.1.68",
"173.225.105.34",
"194.31.59.229",
"23.239.2.211",
"24.199.67.157",
"51.222.102.161",
"54.39.17.59",
"54.39.193.199",
"66.70.233.243", // openmail.pro
"92.255.84.131",
"96.126.99.62",
]);const isOneTimeMail = async (domain, options = {}) => {
const otmDns = options.dns || dns;
try {
const records = await otmDns.resolveMx(domain);
if (records.length === 0) { // this email is invalid, but we are not a validator
return false
}
if (records.some((record) => OTM_HOSTS.has(record.exchange))) {
return true
}
// check first record for new
const mxHost = records[0].exchange;
const mxAddresses = await otmDns.resolve4(mxHost);
if (mxAddresses.some((address) => OTM_IPS.has(address))) {
return true
}
return false;
} catch (e) {
if (e.code === "ENOTFOUND") {
return false
}
throw e
}
};exports.isOneTimeMail=isOneTimeMail;//# sourceMappingURL=index.cjs.map