@agenticmail/core 0.5.50 → 0.5.52
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 +22 -2
- package/dist/index.js +22 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1616,8 +1616,28 @@ var StalwartAdmin = class {
|
|
|
1616
1616
|
}
|
|
1617
1617
|
async healthCheck() {
|
|
1618
1618
|
try {
|
|
1619
|
-
const response = await fetch(`${this.baseUrl}/health`, { signal: AbortSignal.timeout(
|
|
1620
|
-
|
|
1619
|
+
const response = await fetch(`${this.baseUrl}/health`, { signal: AbortSignal.timeout(3e3) });
|
|
1620
|
+
if (response.ok) return true;
|
|
1621
|
+
} catch {
|
|
1622
|
+
}
|
|
1623
|
+
try {
|
|
1624
|
+
const net = await import("net");
|
|
1625
|
+
return await new Promise((resolve) => {
|
|
1626
|
+
const smtpPort = parseInt(process.env.SMTP_PORT || "25", 10);
|
|
1627
|
+
const smtpHost = process.env.SMTP_HOST || "localhost";
|
|
1628
|
+
const socket = net.createConnection({ host: smtpHost, port: smtpPort, timeout: 3e3 }, () => {
|
|
1629
|
+
socket.destroy();
|
|
1630
|
+
resolve(true);
|
|
1631
|
+
});
|
|
1632
|
+
socket.on("error", () => {
|
|
1633
|
+
socket.destroy();
|
|
1634
|
+
resolve(false);
|
|
1635
|
+
});
|
|
1636
|
+
socket.on("timeout", () => {
|
|
1637
|
+
socket.destroy();
|
|
1638
|
+
resolve(false);
|
|
1639
|
+
});
|
|
1640
|
+
});
|
|
1621
1641
|
} catch {
|
|
1622
1642
|
return false;
|
|
1623
1643
|
}
|
package/dist/index.js
CHANGED
|
@@ -863,8 +863,28 @@ var StalwartAdmin = class {
|
|
|
863
863
|
}
|
|
864
864
|
async healthCheck() {
|
|
865
865
|
try {
|
|
866
|
-
const response = await fetch(`${this.baseUrl}/health`, { signal: AbortSignal.timeout(
|
|
867
|
-
|
|
866
|
+
const response = await fetch(`${this.baseUrl}/health`, { signal: AbortSignal.timeout(3e3) });
|
|
867
|
+
if (response.ok) return true;
|
|
868
|
+
} catch {
|
|
869
|
+
}
|
|
870
|
+
try {
|
|
871
|
+
const net = await import("net");
|
|
872
|
+
return await new Promise((resolve) => {
|
|
873
|
+
const smtpPort = parseInt(process.env.SMTP_PORT || "25", 10);
|
|
874
|
+
const smtpHost = process.env.SMTP_HOST || "localhost";
|
|
875
|
+
const socket = net.createConnection({ host: smtpHost, port: smtpPort, timeout: 3e3 }, () => {
|
|
876
|
+
socket.destroy();
|
|
877
|
+
resolve(true);
|
|
878
|
+
});
|
|
879
|
+
socket.on("error", () => {
|
|
880
|
+
socket.destroy();
|
|
881
|
+
resolve(false);
|
|
882
|
+
});
|
|
883
|
+
socket.on("timeout", () => {
|
|
884
|
+
socket.destroy();
|
|
885
|
+
resolve(false);
|
|
886
|
+
});
|
|
887
|
+
});
|
|
868
888
|
} catch {
|
|
869
889
|
return false;
|
|
870
890
|
}
|