@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.cjs CHANGED
@@ -43275,6 +43275,17 @@ function createEmailPushServer(params) {
43275
43275
  disabledCommands: config.requireAuth ? [] : ["AUTH"],
43276
43276
  allowInsecureAuth: !config.tls,
43277
43277
  size: config.maxMessageBytes,
43278
+ // Bound concurrent SMTP sessions. Cameras deliver one message and hang
43279
+ // up, so real fan-in is tiny; this caps file-descriptor growth if a
43280
+ // batch of half-open sessions ever piles up (default is UNLIMITED) and
43281
+ // keeps the intake from contributing to a process-wide EMFILE.
43282
+ maxClients: 50,
43283
+ // Pin the reap timers explicitly (these match the smtp-server defaults,
43284
+ // but making them visible guards against a future default change): a
43285
+ // battery camera that powers off mid-delivery leaves a half-open socket
43286
+ // that is reclaimed after socketTimeout instead of lingering for days.
43287
+ socketTimeout: 6e4,
43288
+ closeTimeout: 3e4,
43278
43289
  // smtp-server invokes its internal logger as
43279
43290
  // logger.info(metadata, formatString, ...args)
43280
43291
  // where `metadata` is an opaque session/connection object and
@@ -43401,7 +43412,24 @@ function createEmailPushServer(params) {
43401
43412
  });
43402
43413
  next.on("error", (err) => {
43403
43414
  status.lastErrorMessage = err.message;
43404
- log.error(`Email push server error: ${err.message}`);
43415
+ log.error(`Email push server error: ${err.code ?? ""} ${err.message}`);
43416
+ const netServer = next.server;
43417
+ if (server === next && netServer && netServer.listening === false) {
43418
+ status.running = false;
43419
+ setTimeout(() => {
43420
+ if (server !== next) return;
43421
+ try {
43422
+ next.listen(config.port, config.bindHost, () => {
43423
+ status.running = true;
43424
+ log.warn(
43425
+ `Email push SMTP re-listened on ${config.bindHost}:${config.port} after error`
43426
+ );
43427
+ });
43428
+ } catch (e) {
43429
+ log.error(`Email push re-listen failed: ${e.message}`);
43430
+ }
43431
+ }, 5e3).unref?.();
43432
+ }
43405
43433
  });
43406
43434
  await new Promise((resolve, reject) => {
43407
43435
  next.listen(config.port, config.bindHost, () => {