@agenticmail/core 0.5.52 → 0.5.55
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/dist/index.cjs +13 -2
- package/dist/index.js +13 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1107,9 +1107,11 @@ var import_mailparser = require("mailparser");
|
|
|
1107
1107
|
async function parseEmail(raw) {
|
|
1108
1108
|
const parsed = await (0, import_mailparser.simpleParser)(raw);
|
|
1109
1109
|
const xOriginalFrom = parsed.headers?.get("x-original-from");
|
|
1110
|
+
const xAgenticMailRelay = parsed.headers?.get("x-agenticmail-relay");
|
|
1110
1111
|
const originalFromAddr = typeof xOriginalFrom === "string" ? xOriginalFrom.trim() : void 0;
|
|
1112
|
+
const isAgenticMailInboundRelay = xAgenticMailRelay === "inbound";
|
|
1111
1113
|
let fromAddrs = parsed.from?.value ?? [];
|
|
1112
|
-
if (originalFromAddr && fromAddrs.length > 0 && fromAddrs[0].address?.endsWith("@localhost")) {
|
|
1114
|
+
if (originalFromAddr && fromAddrs.length > 0 && (isAgenticMailInboundRelay || fromAddrs[0].address?.endsWith("@localhost"))) {
|
|
1113
1115
|
fromAddrs = [{ name: fromAddrs[0].name || "", address: originalFromAddr }];
|
|
1114
1116
|
}
|
|
1115
1117
|
const toAddrs = parsed.to ? Array.isArray(parsed.to) ? parsed.to.flatMap((t) => t.value) : parsed.to.value : [];
|
|
@@ -5744,6 +5746,8 @@ var GatewayManager = class {
|
|
|
5744
5746
|
const mailOpts = {
|
|
5745
5747
|
from,
|
|
5746
5748
|
to: recipients.join(", "),
|
|
5749
|
+
cc: mail.cc ? Array.isArray(mail.cc) ? mail.cc.join(", ") : mail.cc : void 0,
|
|
5750
|
+
bcc: mail.bcc ? Array.isArray(mail.bcc) ? mail.bcc.join(", ") : mail.bcc : void 0,
|
|
5747
5751
|
subject: mail.subject,
|
|
5748
5752
|
text: mail.text || void 0,
|
|
5749
5753
|
html: mail.html || void 0,
|
|
@@ -7411,7 +7415,14 @@ IMAP_PORT=143
|
|
|
7411
7415
|
const composePath = (0, import_node_path8.join)(dataDir, "docker-compose.yml");
|
|
7412
7416
|
(0, import_node_fs7.writeFileSync)(composePath, `services:
|
|
7413
7417
|
stalwart:
|
|
7414
|
-
|
|
7418
|
+
# Pinned to v0.15.5 \u2014 Stalwart 0.16+ moved its config to JSON
|
|
7419
|
+
# at /etc/stalwart/config.json (hardcoded into the container
|
|
7420
|
+
# CMD), runs as UID 2000, and silently ignores our pre-0.10
|
|
7421
|
+
# TOML mount. On those builds Stalwart enters bootstrap mode
|
|
7422
|
+
# and the setup wizard 404s on the admin API. Pinning until
|
|
7423
|
+
# the templates are migrated to the 0.16+ JSON layout.
|
|
7424
|
+
# Tracking: https://github.com/agenticmail/agenticmail/issues/10
|
|
7425
|
+
image: stalwartlabs/stalwart:v0.15.5
|
|
7415
7426
|
container_name: agenticmail-stalwart
|
|
7416
7427
|
ports:
|
|
7417
7428
|
- "127.0.0.1:8080:8080" # HTTP Admin + JMAP (localhost only)
|
package/dist/index.js
CHANGED
|
@@ -354,9 +354,11 @@ import { simpleParser } from "mailparser";
|
|
|
354
354
|
async function parseEmail(raw) {
|
|
355
355
|
const parsed = await simpleParser(raw);
|
|
356
356
|
const xOriginalFrom = parsed.headers?.get("x-original-from");
|
|
357
|
+
const xAgenticMailRelay = parsed.headers?.get("x-agenticmail-relay");
|
|
357
358
|
const originalFromAddr = typeof xOriginalFrom === "string" ? xOriginalFrom.trim() : void 0;
|
|
359
|
+
const isAgenticMailInboundRelay = xAgenticMailRelay === "inbound";
|
|
358
360
|
let fromAddrs = parsed.from?.value ?? [];
|
|
359
|
-
if (originalFromAddr && fromAddrs.length > 0 && fromAddrs[0].address?.endsWith("@localhost")) {
|
|
361
|
+
if (originalFromAddr && fromAddrs.length > 0 && (isAgenticMailInboundRelay || fromAddrs[0].address?.endsWith("@localhost"))) {
|
|
360
362
|
fromAddrs = [{ name: fromAddrs[0].name || "", address: originalFromAddr }];
|
|
361
363
|
}
|
|
362
364
|
const toAddrs = parsed.to ? Array.isArray(parsed.to) ? parsed.to.flatMap((t) => t.value) : parsed.to.value : [];
|
|
@@ -4987,6 +4989,8 @@ var GatewayManager = class {
|
|
|
4987
4989
|
const mailOpts = {
|
|
4988
4990
|
from,
|
|
4989
4991
|
to: recipients.join(", "),
|
|
4992
|
+
cc: mail.cc ? Array.isArray(mail.cc) ? mail.cc.join(", ") : mail.cc : void 0,
|
|
4993
|
+
bcc: mail.bcc ? Array.isArray(mail.bcc) ? mail.bcc.join(", ") : mail.bcc : void 0,
|
|
4990
4994
|
subject: mail.subject,
|
|
4991
4995
|
text: mail.text || void 0,
|
|
4992
4996
|
html: mail.html || void 0,
|
|
@@ -6654,7 +6658,14 @@ IMAP_PORT=143
|
|
|
6654
6658
|
const composePath = join9(dataDir, "docker-compose.yml");
|
|
6655
6659
|
writeFileSync5(composePath, `services:
|
|
6656
6660
|
stalwart:
|
|
6657
|
-
|
|
6661
|
+
# Pinned to v0.15.5 \u2014 Stalwart 0.16+ moved its config to JSON
|
|
6662
|
+
# at /etc/stalwart/config.json (hardcoded into the container
|
|
6663
|
+
# CMD), runs as UID 2000, and silently ignores our pre-0.10
|
|
6664
|
+
# TOML mount. On those builds Stalwart enters bootstrap mode
|
|
6665
|
+
# and the setup wizard 404s on the admin API. Pinning until
|
|
6666
|
+
# the templates are migrated to the 0.16+ JSON layout.
|
|
6667
|
+
# Tracking: https://github.com/agenticmail/agenticmail/issues/10
|
|
6668
|
+
image: stalwartlabs/stalwart:v0.15.5
|
|
6658
6669
|
container_name: agenticmail-stalwart
|
|
6659
6670
|
ports:
|
|
6660
6671
|
- "127.0.0.1:8080:8080" # HTTP Admin + JMAP (localhost only)
|