spamscanner 7.0.9 → 7.0.10

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.
@@ -3797,7 +3797,16 @@ function shorten(name, max = 100) {
3797
3797
  return characters.length <= max ? name : `${characters.slice(0, max - 41).join("")}\u2026${characters.slice(-40).join("")}`;
3798
3798
  }
3799
3799
  function extensionOf(name) {
3800
- const base = trimEndOf(String(name).toLowerCase().split(/[/\\]/).pop(), ". ");
3800
+ const base = trimEndOf(String(name).toLowerCase().replace(ALL_BIDI_CONTROLS, "").split(/[/\\]/).pop(), ". ");
3801
+ const whole = lastExtension(base);
3802
+ const file = base.replace(/^[a-z]:/, "");
3803
+ const colon = file.indexOf(":");
3804
+ if (colon !== -1 && /^(?::?\$data)?$/.test(file.slice(colon + 1))) {
3805
+ return lastExtension(trimEndOf(file.slice(0, colon), ". "));
3806
+ }
3807
+ return whole;
3808
+ }
3809
+ function lastExtension(base) {
3801
3810
  const dot = base.lastIndexOf(".");
3802
3811
  return dot === -1 ? "" : base.slice(dot + 1).trim();
3803
3812
  }
@@ -3882,7 +3891,7 @@ function inspectAttachments(attachments = []) {
3882
3891
  }
3883
3892
  return findings;
3884
3893
  }
3885
- var import_node_buffer, EXECUTABLE_EXTENSIONS, RISKY_EXTENSIONS, SCRIPT_EXTENSIONS, MACRO_EXTENSIONS, DOCUMENT_EXTENSIONS, TEMPORARY_EXTENSIONS, BIDI_CONTROLS, ARCHIVE_TYPES, ZIP_FAMILY, OFFICE_TYPES, OFFICE_EMBEDDED, ENTRIES, MAX_NAME_LENGTH, MAX_NAME_BYTES, DIRECTORY, isDirectory, VBA_NAMES, PDF_ACTIVE, escaped, WORD_ESCAPE, PDF_ACTIVE_ESCAPED, pdfActive;
3894
+ var import_node_buffer, EXECUTABLE_EXTENSIONS, RISKY_EXTENSIONS, SCRIPT_EXTENSIONS, MACRO_EXTENSIONS, DOCUMENT_EXTENSIONS, TEMPORARY_EXTENSIONS, BIDI_CONTROLS, ALL_BIDI_CONTROLS, ARCHIVE_TYPES, ZIP_FAMILY, OFFICE_TYPES, OFFICE_EMBEDDED, ENTRIES, MAX_NAME_LENGTH, MAX_NAME_BYTES, DIRECTORY, isDirectory, VBA_NAMES, PDF_ACTIVE, escaped, WORD_ESCAPE, PDF_ACTIVE_ESCAPED, pdfActive;
3886
3895
  var init_attachments = __esm({
3887
3896
  "src/attachments.js"() {
3888
3897
  import_node_buffer = require("node:buffer");
@@ -4033,6 +4042,7 @@ var init_attachments = __esm({
4033
4042
  DOCUMENT_EXTENSIONS = /* @__PURE__ */ new Set(["pdf", "doc", "docx", "xls", "xlsx", "ppt", "pptx", "txt", "rtf", "jpg", "jpeg", "png", "gif", "zip", "csv", "odt", "ods", "html", "htm", "mp3", "mp4", "mov", "wav", "eml", "msg", "xml", "json"]);
4034
4043
  TEMPORARY_EXTENSIONS = /* @__PURE__ */ new Set(["tmp"]);
4035
4044
  BIDI_CONTROLS = characterClass([[8234, 8238], [8294, 8297]], "u");
4045
+ ALL_BIDI_CONTROLS = characterClass([[8234, 8238], [8294, 8297]], "gu");
4036
4046
  ARCHIVE_TYPES = /* @__PURE__ */ new Set(["zip", "rar", "7z", "gz", "bz2", "xz", "cab", "iso", "tar", "zst", "lzh", "ace", "arj"]);
4037
4047
  ZIP_FAMILY = /* @__PURE__ */ new Set(["zip", "docx", "xlsx", "pptx"]);
4038
4048
  OFFICE_TYPES = /* @__PURE__ */ new Set(["docx", "xlsx", "pptx"]);
@@ -7666,7 +7676,7 @@ var init_package = __esm({
7666
7676
  package_default = {
7667
7677
  name: "spamscanner",
7668
7678
  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.",
7669
- version: "7.0.9",
7679
+ version: "7.0.10",
7670
7680
  author: "Forward Email (https://forwardemail.net)",
7671
7681
  bin: {
7672
7682
  spamscanner: "./dist/esm/cli.js"