spamscanner 5.1.2 → 5.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/get-classifier.js +4 -1
- package/index.js +10 -4
- package/package.json +5 -2
- package/replacements.js +4 -1
package/README.md
CHANGED
|
@@ -566,7 +566,7 @@ Note that in [Forward Email][forward-email] we use the `client` approach as we h
|
|
|
566
566
|
|
|
567
567
|
## Debugging
|
|
568
568
|
|
|
569
|
-
Spam Scanner has built-in debug output via `util.debuglog('spamscanner')`.
|
|
569
|
+
Spam Scanner has built-in debug output via `util.debuglog('spamscanner')`. You can also pass `debug: true` to your instance to get more verbose output.
|
|
570
570
|
|
|
571
571
|
This means you can run your app with `NODE_DEBUG=spamscanner node app.js` to get useful debug output to your console.
|
|
572
572
|
|
package/get-classifier.js
CHANGED
package/index.js
CHANGED
|
@@ -13,11 +13,11 @@ const NaiveBayes = require('@ladjs/naivebayes');
|
|
|
13
13
|
const RE2 = require('re2');
|
|
14
14
|
const arrayJoinConjunction = require('array-join-conjunction');
|
|
15
15
|
const bitcoinRegex = require('bitcoin-regex');
|
|
16
|
-
const contractions = require('expand-contractions');
|
|
17
16
|
const creditCardRegex = require('credit-card-regex');
|
|
18
17
|
const emailRegexSafe = require('email-regex-safe');
|
|
19
18
|
const emojiPatterns = require('emoji-patterns');
|
|
20
19
|
const escapeStringRegexp = require('escape-string-regexp');
|
|
20
|
+
const expandContractions = require('@stdlib/nlp-expand-contractions');
|
|
21
21
|
const fileExtension = require('file-extension');
|
|
22
22
|
const floatingPointRegex = require('floating-point-regex');
|
|
23
23
|
const franc = require('franc');
|
|
@@ -496,7 +496,7 @@ class SpamScanner {
|
|
|
496
496
|
return tokens;
|
|
497
497
|
};
|
|
498
498
|
|
|
499
|
-
this.clamscan = new ClamScan();
|
|
499
|
+
this.clamscan = this.config.clamscan === false ? false : new ClamScan();
|
|
500
500
|
|
|
501
501
|
this.getTokensAndMailFromSource = universalify.fromPromise(
|
|
502
502
|
this.getTokensAndMailFromSource.bind(this)
|
|
@@ -654,7 +654,13 @@ class SpamScanner {
|
|
|
654
654
|
async getVirusResults(mail) {
|
|
655
655
|
const messages = [];
|
|
656
656
|
|
|
657
|
-
if (!
|
|
657
|
+
if (!this.clamscan) {
|
|
658
|
+
debug('clamscan disabled');
|
|
659
|
+
return messages;
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
if (!Array.isArray(mail.attachments) || mail.attachments.length === 0)
|
|
663
|
+
return messages;
|
|
658
664
|
|
|
659
665
|
try {
|
|
660
666
|
// if it was already loaded, clamscan won't reload itself
|
|
@@ -1258,7 +1264,7 @@ class SpamScanner {
|
|
|
1258
1264
|
//
|
|
1259
1265
|
// NOTE: we're doing this for all languages now, not just en
|
|
1260
1266
|
//
|
|
1261
|
-
string =
|
|
1267
|
+
string = expandContractions(string);
|
|
1262
1268
|
|
|
1263
1269
|
//
|
|
1264
1270
|
// Future research:
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "spamscanner",
|
|
3
3
|
"description": "Spam Scanner - The Best Anti-Spam Scanning Service and Anti-Spam API",
|
|
4
|
-
"version": "5.1.
|
|
4
|
+
"version": "5.1.5",
|
|
5
5
|
"author": "Niftylettuce, LLC. <niftylettuce@gmail.com> (https://niftylettuce.com/)",
|
|
6
6
|
"bugs": {
|
|
7
7
|
"url": "https://github.com/spamscanner/spamscanner/issues",
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
],
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@ladjs/naivebayes": "^0.1.0",
|
|
16
|
+
"@stdlib/nlp-expand-contractions": "^0.0.8",
|
|
16
17
|
"array-join-conjunction": "^1.0.0",
|
|
17
18
|
"bitcoin-regex": "^2.0.0",
|
|
18
19
|
"chinese-tokenizer": "^2.4.0",
|
|
@@ -24,7 +25,6 @@
|
|
|
24
25
|
"email-regex-safe": "^1.0.2",
|
|
25
26
|
"emoji-patterns": "^14.0.1",
|
|
26
27
|
"escape-string-regexp": "4",
|
|
27
|
-
"expand-contractions": "^1.0.1",
|
|
28
28
|
"file-extension": "^4.0.5",
|
|
29
29
|
"file-type": "16",
|
|
30
30
|
"floating-point-regex": "^0.1.0",
|
|
@@ -69,6 +69,7 @@
|
|
|
69
69
|
"@commitlint/cli": "^17.0.2",
|
|
70
70
|
"@commitlint/config-conventional": "^17.0.2",
|
|
71
71
|
"ava": "^4.3.0",
|
|
72
|
+
"chance": "^1.1.8",
|
|
72
73
|
"cross-env": "^7.0.3",
|
|
73
74
|
"delay": "^5.0.0",
|
|
74
75
|
"eslint": "^8.17.0",
|
|
@@ -85,9 +86,11 @@
|
|
|
85
86
|
"numeral": "^2.0.6",
|
|
86
87
|
"nyc": "^15.1.0",
|
|
87
88
|
"p-map": "4",
|
|
89
|
+
"p-queue": "6",
|
|
88
90
|
"read-dir-deep": "^7.0.1",
|
|
89
91
|
"remark-cli": "^10.0.1",
|
|
90
92
|
"remark-preset-github": "^4.0.4",
|
|
93
|
+
"semver": "^7.3.7",
|
|
91
94
|
"xo": "^0.50.0"
|
|
92
95
|
},
|
|
93
96
|
"engines": {
|
package/replacements.js
CHANGED