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U,GAC7B,MAAM,EAAe,KAAK,UAAU,EAAM,KAAM,GAChD,EAAO,KAAK,0CAA0C,IACxD,IAaF,QAAQ,GAAG,UAAW,GACtB,QAAQ,GAAG,SAAU,GAEd,UACT","file":"/npm/maildev-tls-fork@2.0.9/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/maildev-tls-fork@2.0.9/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/**\n * MailDev - index.js\n *\n * Author: Dan Farrelly <daniel.j.farrelly@gmail.com>\n * Licensed under the MIT License.\n */\n\nconst program = require('commander')\nconst async = require('async')\nconst pkg = require('./package.json')\nconst web = require('./lib/web')\nconst mailserver = require('./lib/mailserver')\nconst { createLogger } = require('./lib/logger')\nconst { options, appendOptions } = require('./lib/options')\n\nmodule.exports = function (config) {\n  const version = pkg.version\n  const logger = createLogger(config.loggerProvider);\n\n  if (!config) {\n    // CLI\n    config = appendOptions(program.version(version).allowUnknownOption(true), options)\n      .parse(process.argv)\n      .opts()\n  }\n\n  // Start the Mailserver\n  mailserver.create(\n    config.smtp,\n    config.ip,\n    config.mailDirectory,\n    config.incomingUser,\n    config.incomingPass,\n    config.hideExtensions\n  )\n\n  if (\n    config.outgoingHost ||\n    config.outgoingPort ||\n    config.outgoingUser ||\n    config.outgoingPass ||\n    config.outgoingSecure ||\n    config.outgoingIgnoreTLS ||\n    config.outgoingRequireTLS\n  ) {\n    mailserver.setupOutgoing(\n      config.outgoingHost,\n      parseInt(config.outgoingPort),\n      config.outgoingUser,\n      config.outgoingPass,\n      config.outgoingSecure,\n      config.outgoingIgnoreTLS,\n      config.outgoingRequireTLS\n    )\n  }\n\n  if (config.autoRelay) {\n    const emailAddress = typeof config.autoRelay === 'string' ? config.autoRelay : null\n    mailserver.setAutoRelayMode(true, config.autoRelayRules, emailAddress)\n  }\n\n  if (config.mailDirectory) {\n    mailserver.loadMailsFromDirectory()\n  }\n\n  // Start the web server\n  if (!config.disableWeb) {\n    const secure = {\n      https: config.https,\n      cert: config.httpsCert,\n      key: config.httpsKey\n    }\n\n    // Default to run on same IP as smtp\n    const webIp = config.webIp ? config.webIp : config.ip\n\n    web.start(\n      config.web,\n      webIp,\n      mailserver,\n      config.webUser,\n      config.webPass,\n      config.basePathname,\n      secure\n    )\n\n    // Close the web server when the mailserver closes\n    mailserver.on('close', web.close)\n  }\n\n  if (config.logMailContents) {\n    mailserver.on('new', function (mail) {\n      const mailContents = JSON.stringify(mail, null, 2)\n      logger.info(`Received the following mail contents:\\n${mailContents}`)\n    })\n  }\n\n  function shutdown () {\n    logger.info('Received shutdown signal, shutting down now...')\n    async.parallel([\n      mailserver.close,\n      web.close\n    ], function () {\n      process.exit(0)\n    })\n  }\n\n  process.on('SIGTERM', shutdown)\n  process.on('SIGINT', shutdown)\n\n  return mailserver\n}\n"]}