Test client for WildDuck WebAuthn API endpoints
View transport.js
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
// The following example sets up Nodemailer in a way that it does not perform any DNS resolving on its own | |
const hostname = 'smtp.gmail.com'; | |
const resolved = (await dns.promises.resolve(hostname))[0]; | |
const transporter = nodemailer.createTransport({ | |
host: resolved, // <- IP address of the SMTP server | |
name: 'my.machine.hostname', // <- PTR name of sender's public IP address, ends up in the Recieved: header | |
tls: { | |
servername: hostname, // <- hostname of the SMTP server, needed to verify TLS |
View fetch-attachment.js
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
"use strict"; | |
const fs = require("fs"); | |
const http = require("http"); | |
const API_PATH = "http://127.0.0.1:3000"; | |
const ACCESS_TOKEN = "b2d73a529d602c0c9dfec62227a22151af04ca45227a7c7f5e24c35a6b004584"; | |
const ACCOUNT_ID = "ekiri"; | |
const ATTACHMENT_ID = "AAAAAQAABPsy"; |
View Using EmailEngine.md
Step 1. Register a new account
Register a new account with IMAP and SMTP settings (reference)
curl -XPOST "http://127.0.0.1:3000/v1/account" \
-H "Authorization: Bearer f77cf263b70488c7a35bf1539fd544a81a88711ff74326ce9793022df08d91b9" \
-H "Content-type: application/json" \
-d '{
"account": "example",
View install-node-app.sh
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
#!/bin/bash | |
SERVICE_NAME=$1 | |
DOMAIN_NAME=$2 | |
HTTP_PORT=$3 | |
SERVICE_USER=${4:-www-data} | |
DEPLOY_KEY=$5 | |
NODE_ENV=${6:-production} | |
DEPLOY_USER="deploy" |
View bull-ui.js
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
// npm install bull bull-arena express | |
// node bull-ui.js | |
// open http://localhost:6789 | |
const Arena = require("bull-arena"); | |
const Bull = require("bull"); | |
const express = require("express"); | |
const app = express(); | |
const router = express.Router(); |
View onion.js
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
// 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; | |
} |
View mailauth.json
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
{ | |
"dkim": { | |
"headerFrom": [ | |
"info@srv.dev" | |
], | |
"envelopeFrom": "andris@ekiri.ee", | |
"results": [ | |
{ | |
"signingDomain": "out.srv.dev", | |
"selector": "smtp", |
View app.js
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
// 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"); |
View bounces.js
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
// 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]); | |
}); |
NewerOlder