diff --git a/domains.json b/domains.json index 9c5d186..df015eb 100644 --- a/domains.json +++ b/domains.json @@ -78,6 +78,7 @@ "6mail.cf", "6paq.com", "74.ru", + "74gmail.com", "7mail.ga", "7mail.ml", "88.am", @@ -522,8 +523,8 @@ "cia.hu", "ciaoweb.it", "cicciociccio.com", - "cincinow.net", "cinci.rr.com", + "cincinow.net", "citiz.net", "citlink.net", "citromail.hu", @@ -1785,7 +1786,6 @@ "magicmail.co.za", "magspam.net", "mahmoodweb.com", - "mail.bg", "mail-awu.de", "mail-box.cz", "mail-center.com", @@ -1798,6 +1798,7 @@ "mail.austria.com", "mail.az", "mail.be", + "mail.bg", "mail.bulgaria.com", "mail.by", "mail.co.za", @@ -3298,8 +3299,8 @@ "mttestdriver.com", "muehlacker.tk", "muell.icu", - "muellmail.com", "muellemail.com", + "muellmail.com", "mundomail.net", "munich.com", "music.com", @@ -3640,6 +3641,7 @@ "plus.com", "plus.google.com", "plusmail.com.br", + "pm.me", "pmail.net", "pobox.hu", "pobox.sk", @@ -3706,6 +3708,8 @@ "promessage.com", "prontomail.com", "protestant.com", + "proton.me", + "protonmail.ch", "protonmail.com", "prydirect.info", "psv-supporter.com", @@ -4002,12 +4006,12 @@ "spacewar.com", "spainmail.com", "spam.2012-2016.ru", + "spam.care", "spamavert.com", "spambob.com", "spambob.org", "spambog.net", "spambooger.com", - "spam.care", "spamcero.com", "spamdecoy.net", "spameater.com", @@ -4368,8 +4372,8 @@ "ukmax.com", "ukr.net", "uku.co.uk", - "ultra.fyi", "ultapulta.com", + "ultra.fyi", "ultrapostman.com", "ummah.org", "umpire.com", @@ -4755,4 +4759,4 @@ "zzom.co.uk", "zzz.com", "zzz.pl" -] +] \ No newline at end of file diff --git a/package.json b/package.json index e367d7c..c141ae4 100644 --- a/package.json +++ b/package.json @@ -48,10 +48,6 @@ "hubspot", "mail" ], - "dependencies": { - "got": "~13.0.0", - "json-future": "~2.2.13" - }, "devDependencies": { "@commitlint/cli": "latest", "@commitlint/config-conventional": "latest", @@ -70,7 +66,7 @@ "standard-version": "latest" }, "engines": { - "node": ">= 6" + "node": ">= 18" }, "files": [ "domains.js", diff --git a/scripts/postinstall.mjs b/scripts/postinstall.mjs index 6d2bd3a..c224373 100755 --- a/scripts/postinstall.mjs +++ b/scripts/postinstall.mjs @@ -1,20 +1,23 @@ -import jsonFuture from 'json-future' -import got from 'got' +import { writeFile } from 'node:fs/promises' /* List of free email domains by HubSpot https://knowledge.hubspot.com/forms/what-domains-are-blocked-when-using-the-forms-email-domains-to-block-feature */ const URL = 'https://f.hubspotusercontent40.net/hubfs/2832391/Marketing/Lead-Capture/free-domains-2.csv' +/** Additional domains not present in the URL */ +const DOMAINS = ['pm.me', 'proton.me', 'protonmail.ch'] + const trim = text => text.replace(/^\s+|\s+$/g, '') -const save = async body => { - const result = body.split(/[,\n]/g).map(trim).filter(Boolean) - await jsonFuture.saveAsync('domains.json', result) -} +const sanetize = text => text.split(/[,\n]/g).map(trim).filter(Boolean) try { - await save(await got(URL).text()) + const raw = await fetch(URL).then(res => res.text()) + const domains = new Set(sanetize(raw)) + for (const domain of DOMAINS) domains.add(domain) + const sorted = Array.from(domains).sort() + await writeFile('domains.json', JSON.stringify(sorted, null, 2)) } catch (error) { console.error(error) process.exit(1)