This file contains hidden or 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
const dns = require('dns'); | |
// how many parallel "workers" to use | |
let batchSize = 3; | |
// domain list to process | |
let domains = [ | |
'neti.ee', | |
'hot.ee', | |
'zone.ee', |
This file contains hidden or 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
const dns = require('dns').promises; | |
// how many parallel "workers" to use | |
let batchSize = 3; | |
// domain list to process | |
let domains = [ | |
'neti.ee', | |
'hot.ee', | |
'zone.ee', |
This file contains hidden or 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
const dns = require('dns').promises; | |
// how many parallel "workers" to use | |
let batchSize = 3; | |
// domain list to process | |
let domains = [ | |
'neti.ee', | |
'hot.ee', | |
'zone.ee', |
This file contains hidden or 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
const dns = require('dns').promises; | |
// domain list to process | |
let domains = [ | |
'neti.ee', | |
'hot.ee', | |
'zone.ee', | |
'telia.ee', | |
'a.ee', | |
'delfi.ee', |
This file contains hidden or 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
// NB! these counters do not expire so it might be too simplistic | |
class MTALocker { | |
constructor() { | |
this.counters = new Map(); | |
} | |
// helper to get correct counter Map | |
getPidCounters(pid){ | |
if(!this.counters.has(pid)){ | |
this.counters.set(pid, new Map()); |
This file contains hidden or 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
/* eslint no-console: 0 */ | |
'use strict'; | |
const nodemailer = require('nodemailer'); | |
// Create a SMTP transporter object | |
let transporter = nodemailer.createTransport({ | |
host: 'smtp.office365.com', | |
port: 587, |
This file contains hidden or 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
// npm install zone-mta | |
const bounces = require("zone-mta/lib/bounces"); | |
let str = "550 11.22.33.44 listed at spamhaus, see http://www.spamhaus.org"; | |
let bounceInfo = bounces.check(str); | |
console.log("data : %s", str.replace(/\n/g, "\n" + " ".repeat(11))); | |
Object.keys(bounceInfo || {}).forEach((key) => { | |
console.log("%s %s: %s", key, " ".repeat(8 - key.length), bounceInfo[key]); | |
}); |
This file contains hidden or 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
// public domain code | |
// $ npm install dns2 | |
// $ node app.js | |
// $ dig A example.com @127.0.0.1 -p5053 | |
// $ dig A example.com +tcp @127.0.0.1 -p5053 | |
const dns = require("dns2"); | |
const { createDNSUdpServer, createDNSTcpServer } = require("./dns-server.js"); |
This file contains hidden or 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
{ | |
"dkim": { | |
"headerFrom": [ | |
"[email protected]" | |
], | |
"envelopeFrom": "[email protected]", | |
"results": [ | |
{ | |
"signingDomain": "out.srv.dev", | |
"selector": "smtp", |
This file contains hidden or 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
// npm install hi-base32 sha3 | |
const base32 = require("hi-base32"); | |
const { SHA3 } = require("sha3"); | |
function verifyOnionAddress(addr) { | |
const suffixLength = ".onion".length; | |
if (!/\.onion$/i.test(addr) || addr.length != 56 + suffixLength) { | |
return false; | |
} |