This repository has been archived by the owner on Dec 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: check MAIL FROM against dnsbl, bump deps, fixed uncaught except…
…ion with dkimpy and authheaders
- Loading branch information
1 parent
af2030f
commit c775718
Showing
4 changed files
with
79 additions
and
88 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1122,43 +1122,6 @@ test('should detect executable files', async (t) => { | |
}); | ||
}); | ||
|
||
test('should check against PhishTank', async (t) => { | ||
t.true(t.context.forwardEmail.scanner._phishTankLoaded); | ||
t.true(Array.isArray(t.context.forwardEmail.scanner._phishTankUrls)); | ||
t.true(t.context.forwardEmail.scanner._phishTankUrls.length > 0); | ||
const link = t.context.forwardEmail.scanner._phishTankUrls[0]; | ||
const transporter = nodemailer.createTransport({ | ||
streamTransport: true | ||
}); | ||
const { port } = t.context.forwardEmail.server.address(); | ||
const connection = new Client({ port, tls }); | ||
|
||
const info = await transporter.sendMail({ | ||
html: `<a href="${link}">test</a>`, | ||
text: link, | ||
from: '[email protected]', | ||
envelope: { | ||
to: '[email protected]', | ||
from: '[email protected]' | ||
} | ||
}); | ||
return new Promise((resolve) => { | ||
connection.once('end', resolve); | ||
connection.connect(() => { | ||
connection.send(info.envelope, info.message, (err) => { | ||
t.regex( | ||
err.message, | ||
new RegExp( | ||
`Link of "${link}" was detected by PhishTank to be phishing-related.` | ||
) | ||
); | ||
t.is(err.responseCode, 554); | ||
connection.close(); | ||
}); | ||
}); | ||
}); | ||
}); | ||
|
||
test('should check against Cloudflare', async (t) => { | ||
const link = Buffer.from('eHZpZGVvcy5jb20=', 'base64').toString(); | ||
const transporter = nodemailer.createTransport({ | ||
|
@@ -1183,7 +1146,7 @@ test('should check against Cloudflare', async (t) => { | |
t.regex( | ||
err.message, | ||
new RegExp( | ||
`Link of "${link}" was detected by Cloudflare to contain malware, phishing, and/or adult content.` | ||
`Link hostname of "${link}" was detected by Cloudflare to contain malware, phishing, and/or adult content.` | ||
) | ||
); | ||
t.is(err.responseCode, 554); | ||
|
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