Skip to content

Commit

Permalink
feat: added ability for multiple recipients, global catch-alls, and r…
Browse files Browse the repository at this point in the history
…ecursive lookups, and fixed DNS, FQDN, and custom error handling (closes forwardemail#87, closes forwardemail#112, closes forwardemail#32, closes forwardemail#8, closes forwardemail#24, closes forwardemail#82, closes forwardemail#12)
  • Loading branch information
niftylettuce authored and ImgBotApp committed Aug 26, 2020
1 parent c0477e9 commit 3e2210f
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 17 deletions.
19 changes: 11 additions & 8 deletions test/test.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
const fs = require('fs');
const os = require('os');
const path = require('path');
const uuid = require('uuid');
const Client = require('nodemailer/lib/smtp-connection');
const bytes = require('bytes');
const domains = require('disposable-email-domains');
const isCI = require('is-ci');
const nodemailer = require('nodemailer');
const shell = require('shelljs');
const bytes = require('bytes');
const test = require('ava');
const nodemailer = require('nodemailer');
const Client = require('nodemailer/lib/smtp-connection');
const domains = require('disposable-email-domains');
const uuid = require('uuid');

const ForwardEmail = require('..');
const { beforeEach, afterEach } = require('./helpers');
Expand Down Expand Up @@ -64,7 +64,7 @@ test('rejects forwarding a non-FQDN email', async t => {
connection.connect(() => {
connection.send(info.envelope, info.message, err => {
t.is(err.responseCode, 550);
t.regex(err.message, /is not a FQDN/);
t.regex(err.message, /is not a fully qualified domain name/);
connection.close();
});
});
Expand Down Expand Up @@ -94,7 +94,10 @@ test('rejects forwarding a non-registered email address', async t => {
connection.connect(() => {
connection.send(info.envelope, info.message, err => {
t.is(err.responseCode, 550);
t.regex(err.message, /Invalid forward-email TXT record/);
t.regex(
err.message,
/is not configured properly and does not contain any valid/
);
connection.close();
});
});
Expand Down Expand Up @@ -284,7 +287,7 @@ test('rejects a disposable email sender', async t => {
connection.connect(() => {
connection.send(info.envelope, info.message, err => {
t.is(err.responseCode, 550);
t.regex(err.message, /Disposable email addresses are not permitted/);
t.regex(err.message, /is not permitted/);
connection.close();
});
});
Expand Down
31 changes: 22 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2877,6 +2877,14 @@ get-caller-file@^2.0.1:
resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e"
integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==

get-fqdn@^0.0.2:
version "0.0.2"
resolved "https://registry.yarnpkg.com/get-fqdn/-/get-fqdn-0.0.2.tgz#6ddbce289a9ee0868f6a2b54564910df6a7ae215"
integrity sha512-Xx3bf+8cZRHx7fSFigxu+eFQ617BDCw2H9e8+GruHPiu8A84CjJ6HrSJG9zbyFAhQ0MaaaaLkB6c3zSANW390Q==
dependencies:
ip "^1.1.5"
universalify "^0.1.2"

get-func-name@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41"
Expand Down Expand Up @@ -4091,10 +4099,10 @@ [email protected]:
resolved "https://registry.yarnpkg.com/libbase64/-/libbase64-1.0.3.tgz#de3023234abeefeb9d49378804c8a94404f5c98c"
integrity sha512-ULQZAATVGTAgVNwP61R+MbbSGNBy1tVzWupB9kbE6p+VccWd+J+ICXgOwQic5Yqagzpu+oPZ8sI7yXdWJnPPkA==

[email protected].0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/libmime/-/libmime-4.1.0.tgz#41d53a0160e7c76e117b63c9527ea479b7863ecd"
integrity sha512-SHkLd8rgKC33O9nMea2uKaLRgZgX7/ewniAyLkaTSkRUSXL1StY/GgFR+Xjk5bGU2Er/M93DPtnSuKo/zNViug==
[email protected].1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/libmime/-/libmime-4.1.1.tgz#eb7a60c775ba78c3715ddaec5cd52596a047f8d1"
integrity sha512-HkOfBSj+l7pBOOucEgiI6PdbgHa8ljv+1rARzW743HQ51UP8gabMlcA2wAF3Dg1aeuMjHZ+LzAPYxM52IZsyGA==
dependencies:
iconv-lite "0.4.24"
libbase64 "1.0.3"
Expand Down Expand Up @@ -4440,13 +4448,13 @@ mailparser@^0.5.1:
mimelib "^0.2.19"
uue "^3.0.0"

mailsplit@^4.4.0:
version "4.4.0"
resolved "https://registry.yarnpkg.com/mailsplit/-/mailsplit-4.4.0.tgz#96508f5557a41870e320c57932bf7b9e43e8cd63"
integrity sha512-zbYcmM/USOX9Up+wsdGSAxPhdbZxvGirCR/preKxVmbSJbxt1MnYvHtbtLiDlvP1clBkXL9CB+3ktqFFEKjXvQ==
mailsplit@^4.4.1:
version "4.4.1"
resolved "https://registry.yarnpkg.com/mailsplit/-/mailsplit-4.4.1.tgz#838603af3c1561e27aedd8599cec2a59c097faa6"
integrity sha512-AmWLEHQAg/zbNb1MdrPQS9VOzysHaU9IuoQV9kGU5fgjM5RCbgqVkZzp0+DhPep8sj8iHfbWkl16Nb1PbNlTYg==
dependencies:
libbase64 "1.0.3"
libmime "4.1.0"
libmime "4.1.1"
libqp "1.1.0"

make-dir@^1.0.0:
Expand Down Expand Up @@ -7902,6 +7910,11 @@ unist-util-visit@^1.0.0, unist-util-visit@^1.1.0, unist-util-visit@^1.1.1, unist
dependencies:
unist-util-visit-parents "^2.0.0"

universalify@^0.1.2:
version "0.1.2"
resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66"
integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==

unset-value@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559"
Expand Down

0 comments on commit 3e2210f

Please sign in to comment.