spamscanner 7.0.11 → 7.0.12

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.
@@ -1,15 +1,17 @@
1
1
  /**
2
2
  * The link hosts of a message and of what it carries, as they are looked up
3
3
  * (see lookupName; an address as it is), in the order they are found, up to
4
- * `maxHosts`; names with no "/" after them come last, as far as there is
5
- * room, as text that is not a link may read as one.
4
+ * `maxHosts` and then the first of each domain not found yet (`maxHosts`
5
+ * domains in all); names with no "/" after them come last, as far as there is
6
+ * room, as text that is not a link may read as one. All of it is read for at
7
+ * most five seconds.
6
8
  * @param {object} mail - the message, as mailparser parsed it
7
9
  * @param {object} [options]
8
10
  * @param {object[]} [options.mails] - the messages attached to it, opened (see expandAttachments)
9
11
  * @param {object[]} [options.attachments] - its attachments and theirs (see expandAttachments)
10
12
  * @param {number} [options.maxHosts]
11
13
  * @param {boolean} [options.hostsInText] - also names with no "/" after them, "evil.example", as mail clients make links of them
12
- * @returns {{hosts: string[], more: boolean, tooComplex: boolean, incomplete: boolean}} `more`: it has more hosts, so not every link was read; `tooComplex`: a link whose host was never read whole (it runs past where the text is cut to be read, it is wrapped deeper than unwrapLink unwraps, or in more documents than are read); `incomplete`: an attachment was left unread for time
14
+ * @returns {{hosts: string[], more: boolean, tooComplex: boolean, incomplete: boolean}} `more`: it has more hosts than are given (at most `maxHosts`, and past them the first host of each domain not found yet, `maxHosts` domains in all), so not every link was read; `tooComplex`: a link whose host was never read whole (its host, or a link of click tracking or a security gateway, runs past where the text is cut to be read, it is in an attribute value or a card longer than is read, it is wrapped deeper than unwrapLink unwraps, or in more documents than are read); `incomplete`: not all of it was read in time
13
15
  */
14
16
  export function carriedLinkHosts(mail: object, { mails, attachments, maxHosts, hostsInText, }?: {
15
17
  mails?: object[];
@@ -7,6 +7,15 @@
7
7
  * @returns {RegExp}
8
8
  */
9
9
  export function characterClass(ranges: number[][], flags?: string): RegExp;
10
+ /**
11
+ * A URL as the URL parser reads it, refused (a TypeError, as for one that is
12
+ * no URL) when its host is longer than any host is, so a link in a message
13
+ * cannot hold the parser for seconds.
14
+ * @param {string} address
15
+ * @returns {URL}
16
+ */
17
+ export function boundedUrl(address: string): URL;
18
+ export function isClickTracker(url: any): any;
10
19
  /**
11
20
  * The address a link goes to, as a URL: through a security gateway, the
12
21
  * address it goes on to (see gatewayTarget), as many as MAX_GATEWAYS
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "spamscanner",
3
3
  "description": "Spam, phishing and malware filter for email in any language: a trainable classifier, link and attachment checks, SPF/DKIM/DMARC, and an optional AI second opinion from any LLM, including local Ollama models. Works as a library, CLI, Postfix milter or HTTP API.",
4
- "version": "7.0.11",
4
+ "version": "7.0.12",
5
5
  "author": "Forward Email (https://forwardemail.net)",
6
6
  "bin": {
7
7
  "spamscanner": "./dist/esm/cli.js"