@apocaliss92/nodelink-js 0.6.8-beta.0 → 0.6.8

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.js CHANGED
@@ -8898,6 +8898,17 @@ function createEmailPushServer(params) {
8898
8898
  disabledCommands: config.requireAuth ? [] : ["AUTH"],
8899
8899
  allowInsecureAuth: !config.tls,
8900
8900
  size: config.maxMessageBytes,
8901
+ // Bound concurrent SMTP sessions. Cameras deliver one message and hang
8902
+ // up, so real fan-in is tiny; this caps file-descriptor growth if a
8903
+ // batch of half-open sessions ever piles up (default is UNLIMITED) and
8904
+ // keeps the intake from contributing to a process-wide EMFILE.
8905
+ maxClients: 50,
8906
+ // Pin the reap timers explicitly (these match the smtp-server defaults,
8907
+ // but making them visible guards against a future default change): a
8908
+ // battery camera that powers off mid-delivery leaves a half-open socket
8909
+ // that is reclaimed after socketTimeout instead of lingering for days.
8910
+ socketTimeout: 6e4,
8911
+ closeTimeout: 3e4,
8901
8912
  // smtp-server invokes its internal logger as
8902
8913
  // logger.info(metadata, formatString, ...args)
8903
8914
  // where `metadata` is an opaque session/connection object and
@@ -9024,7 +9035,24 @@ function createEmailPushServer(params) {
9024
9035
  });
9025
9036
  next.on("error", (err) => {
9026
9037
  status.lastErrorMessage = err.message;
9027
- log.error(`Email push server error: ${err.message}`);
9038
+ log.error(`Email push server error: ${err.code ?? ""} ${err.message}`);
9039
+ const netServer = next.server;
9040
+ if (server === next && netServer && netServer.listening === false) {
9041
+ status.running = false;
9042
+ setTimeout(() => {
9043
+ if (server !== next) return;
9044
+ try {
9045
+ next.listen(config.port, config.bindHost, () => {
9046
+ status.running = true;
9047
+ log.warn(
9048
+ `Email push SMTP re-listened on ${config.bindHost}:${config.port} after error`
9049
+ );
9050
+ });
9051
+ } catch (e) {
9052
+ log.error(`Email push re-listen failed: ${e.message}`);
9053
+ }
9054
+ }, 5e3).unref?.();
9055
+ }
9028
9056
  });
9029
9057
  await new Promise((resolve, reject) => {
9030
9058
  next.listen(config.port, config.bindHost, () => {