-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disallow known throwaway email domains
2 data sources with updates.
- Loading branch information
Showing
12 changed files
with
13,278 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "disposable-email-domains"] | ||
path = disposable-email-domains | ||
url = [email protected]:disposable-email-domains/disposable-email-domains.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
const { readFile, writeFile } = require('node:fs/promises') | ||
const { join } = require('node:path') | ||
const emailvalidDomains = require('emailvalid/domains.json') | ||
|
||
const disposableEmailDomains = new Set() | ||
|
||
const disposableEmailDomainsPath = join(__dirname, 'disposable-email-domains', 'disposable_email_blocklist.conf') | ||
|
||
readFile(disposableEmailDomainsPath, { encoding: 'utf-8' }) | ||
.then(async data => { | ||
const disposableEmailDomainsRaw = data | ||
const disposableEmailDomainsList = disposableEmailDomainsRaw.split('\n').slice(0, -1) | ||
for (const domain of disposableEmailDomainsList) { | ||
disposableEmailDomains.add(domain) | ||
} | ||
}) | ||
.then(async () => { | ||
const disposableOnly = Object.entries(emailvalidDomains).filter(([domain, type]) => type === 'disposable').map(([domain, type]) => domain) | ||
|
||
for (const domain of disposableOnly) { | ||
disposableEmailDomains.add(domain) | ||
} | ||
}) | ||
.then(async () => { | ||
return await writeFile('disposable.json', JSON.stringify(Array.from(disposableEmailDomains).sort(), null, ' ')) | ||
}) | ||
.then(async () => { | ||
console.log('done') | ||
}) | ||
.catch(err => { | ||
console.error(err) | ||
process.exit(1) | ||
}) |
Submodule disposable-email-domains
added at
baba31
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const disposableArray = require('./disposable.json') | ||
|
||
module.exports.disposable = new Set(disposableArray) |
Oops, something went wrong.