Skip to content

Commit 8fa0cb3

Browse files
committed
v4.1.0
1 parent 41b8e03 commit 8fa0cb3

File tree

3 files changed

+94
-22
lines changed

3 files changed

+94
-22
lines changed

lib/tools.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ const https = require('https');
1010
const packageData = require('../package');
1111
const parseDkimHeaders = require('./parse-dkim-headers');
1212
const psl = require('psl');
13-
const pki = require('node-forge').pki;
1413
const Joi = require('joi');
1514
const base64Schema = Joi.string().base64({ paddingRequired: false });
1615

@@ -288,14 +287,7 @@ const getPublicKey = async (type, name, minBitLength, resolver) => {
288287
throw err;
289288
}
290289

291-
let modulusLength;
292-
if (publicKeyObj.asymmetricKeyDetails) {
293-
modulusLength = publicKeyObj.asymmetricKeyDetails.modulusLength;
294-
} else {
295-
// fall back to node-forge
296-
const pubKeyData = pki.publicKeyFromPem(publicKeyPem.toString());
297-
modulusLength = pubKeyData.n.bitLength();
298-
}
290+
let modulusLength = publicKeyObj.asymmetricKeyDetails.modulusLength;
299291

300292
if (keyType === 'rsa' && modulusLength < 1024) {
301293
let err = new Error('RSA key too short');

package.json

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mailauth",
3-
"version": "4.0.2",
3+
"version": "4.1.0",
44
"description": "Email authentication library for Node.js",
55
"main": "lib/mailauth.js",
66
"scripts": {
@@ -32,29 +32,28 @@
3232
},
3333
"homepage": "https://github.com/postalsys/mailauth",
3434
"devDependencies": {
35-
"chai": "4.3.6",
36-
"eslint": "8.24.0",
35+
"chai": "4.3.7",
36+
"eslint": "8.32.0",
3737
"eslint-config-nodemailer": "1.2.0",
38-
"eslint-config-prettier": "8.5.0",
38+
"eslint-config-prettier": "8.6.0",
3939
"js-yaml": "4.1.0",
40-
"license-report": "6.1.0",
40+
"license-report": "6.3.0",
4141
"marked": "0.7.0",
4242
"marked-man": "0.7.0",
4343
"mbox-reader": "1.1.5",
44-
"mocha": "10.0.0",
44+
"mocha": "10.2.0",
4545
"pkg": "5.8.0"
4646
},
4747
"dependencies": {
4848
"@postalsys/vmc": "1.0.6",
49-
"fast-xml-parser": "4.0.10",
49+
"fast-xml-parser": "4.0.15",
5050
"ipaddr.js": "2.0.1",
51-
"joi": "17.6.1",
52-
"libmime": "5.1.0",
53-
"node-forge": "1.3.1",
54-
"nodemailer": "6.7.8",
51+
"joi": "17.7.0",
52+
"libmime": "5.2.0",
53+
"nodemailer": "6.9.0",
5554
"psl": "1.9.0",
56-
"punycode": "2.1.1",
57-
"yargs": "17.5.1"
55+
"punycode": "2.3.0",
56+
"yargs": "17.6.2"
5857
},
5958
"engines": {
6059
"node": ">=16.0.0"

test/fixtures/zbimi.eml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
Delivered-To: andris.reinman@gmail.com
2+
Received: by 2002:a05:6358:e483:b0:ed:1eae:60a3 with SMTP id by3csp989960rwb;
3+
Fri, 27 Jan 2023 00:11:26 -0800 (PST)
4+
X-Google-Smtp-Source: AMrXdXt9ZDtCSpBT4PpRtX+y+rFOSXiuPOVh5SS9kHTJgYYUrxY9xMBwzMUsnfRENIFzrsH35hk0
5+
X-Received: by 2002:a6b:4412:0:b0:704:b2a2:2be8 with SMTP id r18-20020a6b4412000000b00704b2a22be8mr27481410ioa.1.1674807086154;
6+
Fri, 27 Jan 2023 00:11:26 -0800 (PST)
7+
ARC-Seal: i=1; a=rsa-sha256; t=1674807086; cv=none;
8+
d=google.com; s=arc-20160816;
9+
b=SF4m6JK1jzrUVX9CbY7IT4SLc9LdwZ+aJO6ToT8desK8lrJJq3399lC5VP1NXoQftQ
10+
75vadyXEQWUWia9AMFvWQ4MrMqO1ahn7o5jPV24/ijGjDlCFLbYuxmeBtW0yo9938f1d
11+
MKVwpbZxhUdgrNqfD8gNqpak/a6QEST6Y+LvA8TTMXuBVFkeK2BhGbDMBc01ka+gLdWK
12+
UNPWuTjg7a+wSQUNlDzWc4xZ4rneq1OAD7z7/2KyVkdCzJUjHarj6ShB/ZJ/rbAmtdPt
13+
G+cUAAvsrsu6+PCzIXYIJqB0mp0Bzv+4AqGVGX2KD7fYSnPxjWR/NH1ouxVeQ9BWmpe/
14+
SxTg==
15+
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
16+
h=to:date:message-id:subject:mime-version:from:dkim-signature;
17+
bh=3sI3aH0s30d02osd7KMI81J1rHUHJpO2hlIBn8wI8QE=;
18+
b=sGUgNkRO4JQ4nXxl35P0BUnf0hjqIaDKskMd8RtmplkmiqdELvrUc2u7YeqDzS0eiP
19+
hsnf+ZYkJxNxGqxSSDyoWHjGnUGzAyzb4ixqnJnG59cCrP/QgR8/v0Y68h8SBUUbjBEa
20+
SeAzMjFvxUCAvHdLEKvpxG/0V+vyTvTR4WKAZ1Bzef0XFcOg95brkMLlJG2NTbk4IrBF
21+
Lh32QW2ON2FZ0OnX3vm6glbwp7eUzWwTanazk9vjYRDdHeUkGBCygSu8GPEwnOD+iQuS
22+
uVkNJK2wPyujrTqRskxBsd5+YXJMWSOxxXSP52JM3kB3F8rtbnQHpc5WoTthZfslqiHo
23+
srAw==
24+
ARC-Authentication-Results: i=1; mx.google.com;
25+
dkim=pass header.i=@zone.ee header.s=zone header.b=lztj248j;
26+
spf=pass (google.com: domain of andris@zone.ee designates 85.234.244.117 as permitted sender) smtp.mailfrom=andris@zone.ee;
27+
dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=zone.ee
28+
Return-Path: <andris@zone.ee>
29+
Received: from MTA-244-117.TLL07.ZONEAS.EU (mta-244-117.tll07.zoneas.eu. [85.234.244.117])
30+
by mx.google.com with ESMTPS id i7-20020a056e020d8700b0030d70d9a6absi3210775ilj.159.2023.01.27.00.11.25
31+
for <andris.reinman@gmail.com>
32+
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
33+
Fri, 27 Jan 2023 00:11:26 -0800 (PST)
34+
Received-SPF: pass (google.com: domain of andris@zone.ee designates 85.234.244.117 as permitted sender) client-ip=85.234.244.117;
35+
Authentication-Results: mx.google.com;
36+
dkim=pass header.i=@zone.ee header.s=zone header.b=lztj248j;
37+
spf=pass (google.com: domain of andris@zone.ee designates 85.234.244.117 as permitted sender) smtp.mailfrom=andris@zone.ee;
38+
dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=zone.ee
39+
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zone.ee; q=dns/txt;
40+
s=zone; bh=3sI3aH0s30d02osd7KMI81J1rHUHJpO2hlIBn8wI8QE=;
41+
h=from:subject:date:message-id:to:mime-version:content-type;
42+
b=lztj248jOAs5yYbjBQDCCk4e1ySReWh+b3G6HfuhtbcVC9pWRokOQ5AMgQIRIuNRm6U/8YpnF
43+
E7nBmgQUsxXemLWLD9vgMdD0zrqRsBkCKKSWX4BQH57pzApqzJkWaa6i+KdS2tSIIcovX8G6rsm
44+
zlTiQ3PZork9uknWu6BfcZJ/LDxFu1XkFw/m+m9pd7mhAst0Ozwmw+4RysjxH+BO02JbyBB9TvF
45+
BOUxXugjPp+mPJHr5mNTFnK7W1YKjbpdGclgEH4z0s5jyAtr8shiaf32npewu9MMXqmLuqr4jrm
46+
jDIlRZ1x32S7jOww8ig/VwLN5qM8EoAOsJOlp+6Jc8Xg==
47+
Received: from smtpclient.apple ([51.195.117.31] vpn.srv.dev)
48+
(Authenticated sender: zmail-364712[andris@zone.ee])
49+
by MTA-244-117.TLL07.ZONEAS.EU (ZoneMTA Forwarder) with ESMTPSA id 185f247f1cb000bca9.001
50+
for <andris.reinman@gmail.com>
51+
(version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256);
52+
Fri, 27 Jan 2023 08:11:19 +0000
53+
From: Andris Reinman <andris@zone.ee>
54+
Content-Type: multipart/alternative;
55+
boundary="Apple-Mail=_F1CA573B-BCF5-4EF8-9669-10092D971828"
56+
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.300.101.1.3\))
57+
Subject: =?utf-8?B?SGFsbG8gaGFsbG8sIGhlbGdpIHNhbGxvIPCfmLXigI3wn5Kr?=
58+
Message-Id: <C6877778-B292-40DC-A93A-4DE108441876@zone.ee>
59+
Date: Fri, 27 Jan 2023 10:11:08 +0200
60+
To: Andris Reinman <andris.reinman@gmail.com>
61+
X-Mailer: Apple Mail (2.3731.300.101.1.3)
62+
63+
64+
--Apple-Mail=_F1CA573B-BCF5-4EF8-9669-10092D971828
65+
Content-Transfer-Encoding: quoted-printable
66+
Content-Type: text/plain;
67+
charset=utf-8
68+
69+
Hallo hallo, helgi sallo =F0=9F=98=B5=E2=80=8D=F0=9F=92=AB=
70+
71+
--Apple-Mail=_F1CA573B-BCF5-4EF8-9669-10092D971828
72+
Content-Transfer-Encoding: quoted-printable
73+
Content-Type: text/html;
74+
charset=utf-8
75+
76+
<html><head><meta http-equiv=3D"content-type" content=3D"text/html; =
77+
charset=3Dutf-8"></head><body style=3D"overflow-wrap: break-word; =
78+
-webkit-nbsp-mode: space; line-break: after-white-space;">Hallo hallo, =
79+
<b>helgi</b> sallo =F0=9F=98=B5=E2=80=8D=F0=9F=92=AB</body></html>=
80+
81+
--Apple-Mail=_F1CA573B-BCF5-4EF8-9669-10092D971828--

0 commit comments

Comments
 (0)