15 Commits

Author SHA1 Message Date
d1b07d9ed7 node_modules: update 2020-11-12 16:31:20 +01:00
345c86e5c4 package: update nodemailer 2020-11-12 16:31:13 +01:00
6fd4a30225 node_modules: update 2020-11-12 16:30:46 +01:00
2b66ab09bf Merge pull request #24 from dawidd6/dependabot-npm_and_yarn-nodemailer-6.4.15
build(deps): bump nodemailer from 6.4.14 to 6.4.15
2020-11-12 16:29:13 +01:00
2faeb721e3 build(deps): bump nodemailer from 6.4.14 to 6.4.15
Bumps [nodemailer](https://github.com/nodemailer/nodemailer) from 6.4.14 to 6.4.15.
- [Release notes](https://github.com/nodemailer/nodemailer/releases)
- [Changelog](https://github.com/nodemailer/nodemailer/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodemailer/nodemailer/compare/v6.4.14...v6.4.15)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-11-09 05:05:58 +00:00
9f0c00957b Merge pull request #22 from dawidd6/dependabot-npm_and_yarn-nodemailer-6.4.14
build(deps): bump nodemailer from 6.4.13 to 6.4.14
2020-10-15 09:31:03 +02:00
1a06e16e55 build(deps): bump nodemailer from 6.4.13 to 6.4.14
Bumps [nodemailer](https://github.com/nodemailer/nodemailer) from 6.4.13 to 6.4.14.
- [Release notes](https://github.com/nodemailer/nodemailer/releases)
- [Changelog](https://github.com/nodemailer/nodemailer/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodemailer/nodemailer/compare/v6.4.13...v6.4.14)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-15 02:39:14 +00:00
3a0e152e9d Merge pull request #21 from dawidd6/dependabot-npm_and_yarn-nodemailer-6.4.13
build(deps): bump nodemailer from 6.4.12 to 6.4.13
2020-10-03 10:46:45 +02:00
c63d34f5ad build(deps): bump nodemailer from 6.4.12 to 6.4.13
Bumps [nodemailer](https://github.com/nodemailer/nodemailer) from 6.4.12 to 6.4.13.
- [Release notes](https://github.com/nodemailer/nodemailer/releases)
- [Changelog](https://github.com/nodemailer/nodemailer/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodemailer/nodemailer/compare/v6.4.12...v6.4.13)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-03 00:12:32 +00:00
a80d851dc9 Merge pull request #19 from dawidd6/dependabot-npm_and_yarn-nodemailer-6.4.12
build(deps): bump nodemailer from 6.4.11 to 6.4.12
2020-10-01 10:23:59 +02:00
37c6a4d431 build(deps): bump nodemailer from 6.4.11 to 6.4.12
Bumps [nodemailer](https://github.com/nodemailer/nodemailer) from 6.4.11 to 6.4.12.
- [Release notes](https://github.com/nodemailer/nodemailer/releases)
- [Changelog](https://github.com/nodemailer/nodemailer/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodemailer/nodemailer/compare/v6.4.11...v6.4.12)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-01 00:26:37 +00:00
edca34ffa5 main: log only transport options 2020-09-24 10:27:30 +02:00
4effcb0f30 main: log transport 2020-09-24 10:24:29 +02:00
72d529bf7f Merge pull request #18 from dawidd6/dependabot-npm_and_yarn-actions-core-1.2.6
build(deps): bump @actions/core from 1.2.5 to 1.2.6
2020-09-24 10:13:01 +02:00
bd1a6a6dc3 build(deps): bump @actions/core from 1.2.5 to 1.2.6
Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/actions/toolkit/releases)
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-09-23 23:54:17 +00:00
34 changed files with 211 additions and 161 deletions

12
main.js
View File

@ -2,7 +2,7 @@ const nodemailer = require("nodemailer")
const core = require("@actions/core") const core = require("@actions/core")
const fs = require("fs") const fs = require("fs")
function get_body(body) { function getBody(body) {
if (body.startsWith("file://")) { if (body.startsWith("file://")) {
const file = body.replace("file://", "") const file = body.replace("file://", "")
return fs.readFileSync(file, "utf8") return fs.readFileSync(file, "utf8")
@ -11,7 +11,7 @@ function get_body(body) {
return body return body
} }
function get_from(from, username) { function getFrom(from, username) {
if (from.match(/.+<.+@.+>/)) { if (from.match(/.+<.+@.+>/)) {
return from return from
} }
@ -42,12 +42,14 @@ async function main() {
} }
}) })
console.log(transport.options)
const info = await transport.sendMail({ const info = await transport.sendMail({
from: get_from(from, username), from: getFrom(from, username),
to: to, to: to,
subject: subject, subject: subject,
text: content_type != "text/html" ? get_body(body) : undefined, text: content_type != "text/html" ? getBody(body) : undefined,
html: content_type == "text/html" ? get_body(body) : undefined, html: content_type == "text/html" ? getBody(body) : undefined,
attachments: attachments ? attachments.split(',').map(f => ({ path: f.trim() })) : undefined attachments: attachments ? attachments.split(',').map(f => ({ path: f.trim() })) : undefined
}) })

View File

@ -13,9 +13,4 @@ interface CommandProperties {
*/ */
export declare function issueCommand(command: string, properties: CommandProperties, message: any): void; export declare function issueCommand(command: string, properties: CommandProperties, message: any): void;
export declare function issue(name: string, message?: string): void; export declare function issue(name: string, message?: string): void;
/**
* Sanitizes an input into a string so it can be passed into issueCommand safely
* @param input input to sanitize into a string
*/
export declare function toCommandValue(input: any): string;
export {}; export {};

View File

@ -8,6 +8,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
}; };
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
const os = __importStar(require("os")); const os = __importStar(require("os"));
const utils_1 = require("./utils");
/** /**
* Commands * Commands
* *
@ -61,28 +62,14 @@ class Command {
return cmdStr; return cmdStr;
} }
} }
/**
* Sanitizes an input into a string so it can be passed into issueCommand safely
* @param input input to sanitize into a string
*/
function toCommandValue(input) {
if (input === null || input === undefined) {
return '';
}
else if (typeof input === 'string' || input instanceof String) {
return input;
}
return JSON.stringify(input);
}
exports.toCommandValue = toCommandValue;
function escapeData(s) { function escapeData(s) {
return toCommandValue(s) return utils_1.toCommandValue(s)
.replace(/%/g, '%25') .replace(/%/g, '%25')
.replace(/\r/g, '%0D') .replace(/\r/g, '%0D')
.replace(/\n/g, '%0A'); .replace(/\n/g, '%0A');
} }
function escapeProperty(s) { function escapeProperty(s) {
return toCommandValue(s) return utils_1.toCommandValue(s)
.replace(/%/g, '%25') .replace(/%/g, '%25')
.replace(/\r/g, '%0D') .replace(/\r/g, '%0D')
.replace(/\n/g, '%0A') .replace(/\n/g, '%0A')

View File

@ -1 +1 @@
{"version":3,"file":"command.js","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":";;;;;;;;;AAAA,uCAAwB;AAWxB;;;;;;;;;GASG;AACH,SAAgB,YAAY,CAC1B,OAAe,EACf,UAA6B,EAC7B,OAAY;IAEZ,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA;IACrD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAA;AAC/C,CAAC;AAPD,oCAOC;AAED,SAAgB,KAAK,CAAC,IAAY,EAAE,UAAkB,EAAE;IACtD,YAAY,CAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;AACjC,CAAC;AAFD,sBAEC;AAED,MAAM,UAAU,GAAG,IAAI,CAAA;AAEvB,MAAM,OAAO;IAKX,YAAY,OAAe,EAAE,UAA6B,EAAE,OAAe;QACzE,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO,GAAG,iBAAiB,CAAA;SAC5B;QAED,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;IAED,QAAQ;QACN,IAAI,MAAM,GAAG,UAAU,GAAG,IAAI,CAAC,OAAO,CAAA;QAEtC,IAAI,IAAI,CAAC,UAAU,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,UAA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AC,EAAE;YAC9D,MAAM,IAAI,GAAG,CAAA;YACb,IAAI,KAAK,GAAG,IAAI,CAAA;YAChB,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,UAAU,EAAE;gBACjC,IAAI,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE;oBACvC,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;oBAChC,IAAI,GAAG,EAAE;wBACP,IAAI,KAAK,EAAE;4BACT,KAAK,GAAG,KAAK,CAAA;yBACd;6BAAM;4BACL,MAAM,IAAI,GAAG,CAAA;yBACd;wBAED,MAAM,IAAI,GAAG,GAAG,IAAI,cAAc,CAAC,GAAG,CAAC,EAAE,CAAA;qBAC1C;iBACF;aACF;SACF;QAED,MAAM,IAAI,GAAG,UAAU,GAAG,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAA;QACpD,OAAO,MAAM,CAAA;IACf,CAAC;CACF;AAED,SAAS,UAAU,CAAC,CAAM;IACxB,OAAO,sBAAc,CAAC,CAAC,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;AAC1B,CAAC;AAED,SAAS,cAAc,CAAC,CAAM;IAC5B,OAAO,sBAAc,CAAC,CAAC,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;AACzB,CAAC"}

View File

@ -17,6 +17,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
}; };
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
const command_1 = require("./command"); const command_1 = require("./command");
const file_command_1 = require("./file-command");
const utils_1 = require("./utils");
const os = __importStar(require("os")); const os = __importStar(require("os"));
const path = __importStar(require("path")); const path = __importStar(require("path"));
/** /**
@ -43,9 +45,17 @@ var ExitCode;
*/ */
// eslint-disable-next-line @typescript-eslint/no-explicit-any // eslint-disable-next-line @typescript-eslint/no-explicit-any
function exportVariable(name, val) { function exportVariable(name, val) {
const convertedVal = command_1.toCommandValue(val); const convertedVal = utils_1.toCommandValue(val);
process.env[name] = convertedVal; process.env[name] = convertedVal;
const filePath = process.env['GITHUB_ENV'] || '';
if (filePath) {
const delimiter = '_GitHubActionsFileCommandDelimeter_';
const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;
file_command_1.issueCommand('ENV', commandValue);
}
else {
command_1.issueCommand('set-env', { name }, convertedVal); command_1.issueCommand('set-env', { name }, convertedVal);
}
} }
exports.exportVariable = exportVariable; exports.exportVariable = exportVariable;
/** /**
@ -61,7 +71,13 @@ exports.setSecret = setSecret;
* @param inputPath * @param inputPath
*/ */
function addPath(inputPath) { function addPath(inputPath) {
const filePath = process.env['GITHUB_PATH'] || '';
if (filePath) {
file_command_1.issueCommand('PATH', inputPath);
}
else {
command_1.issueCommand('add-path', {}, inputPath); command_1.issueCommand('add-path', {}, inputPath);
}
process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`; process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
} }
exports.addPath = addPath; exports.addPath = addPath;

View File

@ -1 +1 @@
{"version":3,"file":"core.js","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,uCAA6D;AAE7D,uCAAwB;AACxB,2CAA4B;AAU5B;;GAEG;AACH,IAAY,QAUX;AAVD,WAAY,QAAQ;IAClB;;OAEG;IACH,6CAAW,CAAA;IAEX;;OAEG;IACH,6CAAW,CAAA;AACb,CAAC,EAVW,QAAQ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SAAS,CAAC,IAAY,EAAE,KAAU;IAChD,sBAAY,CAAC,YAAY,EAAE,EAAC,IAAI,EAAC,EAAE,KAAK,CAAC,CAAA;AAC3C,CAAC;AAFD,8BAEC;AAED;;;;;GAKG;AACH,SAAgB,QAAQ,CAAC,IAAY;IACnC,OAAO,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC,IAAI,EAAE,CAAA;AAC3C,CAAC;AAFD,4BAEC"}

1
node_modules/@actions/core/lib/file-command.d.ts generated vendored Normal file
View File

@ -0,0 +1 @@
export declare function issueCommand(command: string, message: any): void;

29
node_modules/@actions/core/lib/file-command.js generated vendored Normal file
View File

@ -0,0 +1,29 @@
"use strict";
// For internal use, subject to change.
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
// We use any as a valid input type
/* eslint-disable @typescript-eslint/no-explicit-any */
const fs = __importStar(require("fs"));
const os = __importStar(require("os"));
const utils_1 = require("./utils");
function issueCommand(command, message) {
const filePath = process.env[`GITHUB_${command}`];
if (!filePath) {
throw new Error(`Unable to find environment variable for file command ${command}`);
}
if (!fs.existsSync(filePath)) {
throw new Error(`Missing file at path: ${filePath}`);
}
fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {
encoding: 'utf8'
});
}
exports.issueCommand = issueCommand;
//# sourceMappingURL=file-command.js.map

1
node_modules/@actions/core/lib/file-command.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"file-command.js","sourceRoot":"","sources":["../src/file-command.ts"],"names":[],"mappings":";AAAA,uCAAuC;;;;;;;;;AAEvC,mCAAmC;AACnC,uDAAuD;AAEvD,uCAAwB;AACxB,uCAAwB;AACxB,mCAAsC;AAEtC,SAAgB,YAAY,CAAC,OAAe,EAAE,OAAY;IACxD,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,OAAO,EAAE,CAAC,CAAA;IACjD,IAAI,CAAC,QAAQ,EAAE;QACb,MAAM,IAAI,KAAK,CACb,wDAAwD,OAAO,EAAE,CAClE,CAAA;KACF;IACD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE;QAC5B,MAAM,IAAI,KAAK,CAAC,yBAAyB,QAAQ,EAAE,CAAC,CAAA;KACrD;IAED,EAAE,CAAC,cAAc,CAAC,QAAQ,EAAE,GAAG,sBAAc,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,EAAE;QACjE,QAAQ,EAAE,MAAM;KACjB,CAAC,CAAA;AACJ,CAAC;AAdD,oCAcC"}

5
node_modules/@actions/core/lib/utils.d.ts generated vendored Normal file
View File

@ -0,0 +1,5 @@
/**
* Sanitizes an input into a string so it can be passed into issueCommand safely
* @param input input to sanitize into a string
*/
export declare function toCommandValue(input: any): string;

19
node_modules/@actions/core/lib/utils.js generated vendored Normal file
View File

@ -0,0 +1,19 @@
"use strict";
// We use any as a valid input type
/* eslint-disable @typescript-eslint/no-explicit-any */
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Sanitizes an input into a string so it can be passed into issueCommand safely
* @param input input to sanitize into a string
*/
function toCommandValue(input) {
if (input === null || input === undefined) {
return '';
}
else if (typeof input === 'string' || input instanceof String) {
return input;
}
return JSON.stringify(input);
}
exports.toCommandValue = toCommandValue;
//# sourceMappingURL=utils.js.map

1
node_modules/@actions/core/lib/utils.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";AAAA,mCAAmC;AACnC,uDAAuD;;AAEvD;;;GAGG;AACH,SAAgB,cAAc,CAAC,KAAU;IACvC,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE;QACzC,OAAO,EAAE,CAAA;KACV;SAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,YAAY,MAAM,EAAE;QAC/D,OAAO,KAAe,CAAA;KACvB;IACD,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;AAC9B,CAAC;AAPD,wCAOC"}

View File

@ -1,34 +1,36 @@
{ {
"_from": "@actions/core@1.2.5", "_args": [
"_id": "@actions/core@1.2.5", [
"@actions/core@1.2.6",
"/home/dawidd6/github/dawidd6/action-send-mail"
]
],
"_from": "@actions/core@1.2.6",
"_id": "@actions/core@1.2.6",
"_inBundle": false, "_inBundle": false,
"_integrity": "sha512-mwpoNjHSWWh0IiALdDEQi3tru124JKn0yVNziIBzTME8QRv7thwoghVuT1jBRjFvdtoHsqD58IRHy1nf86paRg==", "_integrity": "sha512-ZQYitnqiyBc3D+k7LsgSBmMDVkOVidaagDG7j3fOym77jNunWRuYx7VSHa9GNfFZh+zh61xsCjRj4JxMZlDqTA==",
"_location": "/@actions/core", "_location": "/@actions/core",
"_phantomChildren": {}, "_phantomChildren": {},
"_requested": { "_requested": {
"type": "version", "type": "version",
"registry": true, "registry": true,
"raw": "@actions/core@1.2.5", "raw": "@actions/core@1.2.6",
"name": "@actions/core", "name": "@actions/core",
"escapedName": "@actions%2fcore", "escapedName": "@actions%2fcore",
"scope": "@actions", "scope": "@actions",
"rawSpec": "1.2.5", "rawSpec": "1.2.6",
"saveSpec": null, "saveSpec": null,
"fetchSpec": "1.2.5" "fetchSpec": "1.2.6"
}, },
"_requiredBy": [ "_requiredBy": [
"#USER",
"/" "/"
], ],
"_resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.5.tgz", "_resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.6.tgz",
"_shasum": "fa57bf8c07a38191e243beb9ea9d8368c1cb02c8", "_spec": "1.2.6",
"_spec": "@actions/core@1.2.5",
"_where": "/home/dawidd6/github/dawidd6/action-send-mail", "_where": "/home/dawidd6/github/dawidd6/action-send-mail",
"bugs": { "bugs": {
"url": "https://github.com/actions/toolkit/issues" "url": "https://github.com/actions/toolkit/issues"
}, },
"bundleDependencies": false,
"deprecated": false,
"description": "Actions core lib", "description": "Actions core lib",
"devDependencies": { "devDependencies": {
"@types/node": "^12.0.2" "@types/node": "^12.0.2"
@ -64,5 +66,5 @@
"tsc": "tsc" "tsc": "tsc"
}, },
"types": "lib/core.d.ts", "types": "lib/core.d.ts",
"version": "1.2.5" "version": "1.2.6"
} }

21
node_modules/nodemailer/CHANGELOG.md generated vendored
View File

@ -1,5 +1,26 @@
# CHANGELOG # CHANGELOG
## 6.4.16 2020-11-12
- Applied updated prettier formating rules
## 6.4.15 2020-11-06
- Minor changes in header key casing
## 6.4.14 2020-10-14
- Disabled postinstall script
## 6.4.13 2020-10-02
- Fix normalizeHeaderKey method for single node messages
## 6.4.12 2020-09-30
- Better handling of attachment filenames that include quote symbols
- Includes all information from the oath2 error response in the error message (Normal Gaussian) [1787f227]
## 6.4.11 2020-07-29 ## 6.4.11 2020-07-29
- Fixed escape sequence handling in address parsing - Fixed escape sequence handling in address parsing

View File

@ -146,10 +146,7 @@ class MessageParser extends Transform {
return lines return lines
.filter(line => line.trim()) .filter(line => line.trim())
.map(line => ({ .map(line => ({
key: line key: line.substr(0, line.indexOf(':')).trim().toLowerCase(),
.substr(0, line.indexOf(':'))
.trim()
.toLowerCase(),
line line
})); }));
} }

View File

@ -110,10 +110,7 @@ class Cookies {
.split(';') .split(';')
.forEach(cookiePart => { .forEach(cookiePart => {
let valueParts = cookiePart.split('='); let valueParts = cookiePart.split('=');
let key = valueParts let key = valueParts.shift().trim().toLowerCase();
.shift()
.trim()
.toLowerCase();
let value = valueParts.join('=').trim(); let value = valueParts.join('=').trim();
let domain; let domain;

View File

@ -10,7 +10,7 @@ const packageData = require('../../package.json');
const MAX_REDIRECTS = 5; const MAX_REDIRECTS = 5;
module.exports = function(url, options) { module.exports = function (url, options) {
return fetch(url, options); return fetch(url, options);
}; };
@ -33,11 +33,7 @@ function fetch(url, options) {
let fetchRes = options.fetchRes; let fetchRes = options.fetchRes;
let parsed = urllib.parse(url); let parsed = urllib.parse(url);
let method = let method = (options.method || '').toString().trim().toUpperCase() || 'GET';
(options.method || '')
.toString()
.trim()
.toUpperCase() || 'GET';
let finished = false; let finished = false;
let cookies; let cookies;
let body; let body;
@ -115,11 +111,7 @@ function fetch(url, options) {
headers['Content-Length'] = body.length; headers['Content-Length'] = body.length;
} }
// if method is not provided, use POST instead of GET // if method is not provided, use POST instead of GET
method = method = (options.method || '').toString().trim().toUpperCase() || 'POST';
(options.method || '')
.toString()
.trim()
.toUpperCase() || 'POST';
} }
let req; let req;

View File

@ -470,7 +470,8 @@ class MailComposer {
textEncoding: this.mail.textEncoding, textEncoding: this.mail.textEncoding,
boundaryPrefix: this.mail.boundaryPrefix, boundaryPrefix: this.mail.boundaryPrefix,
disableUrlAccess: this.mail.disableUrlAccess, disableUrlAccess: this.mail.disableUrlAccess,
disableFileAccess: this.mail.disableFileAccess disableFileAccess: this.mail.disableFileAccess,
normalizeHeaderKey: this.mail.normalizeHeaderKey
}); });
} else { } else {
node = parentNode.createChild(element.contentType, { node = parentNode.createChild(element.contentType, {

View File

@ -64,12 +64,7 @@ class MailMessage {
if (this.data.attachments && this.data.attachments.length) { if (this.data.attachments && this.data.attachments.length) {
this.data.attachments.forEach((attachment, i) => { this.data.attachments.forEach((attachment, i) => {
if (!attachment.filename) { if (!attachment.filename) {
attachment.filename = attachment.filename = (attachment.path || attachment.href || '').split('/').pop().split('?').shift() || 'attachment-' + (i + 1);
(attachment.path || attachment.href || '')
.split('/')
.pop()
.split('?')
.shift() || 'attachment-' + (i + 1);
if (attachment.filename.indexOf('.') < 0) { if (attachment.filename.indexOf('.') < 0) {
attachment.filename += '.' + mimeFuncs.detectExtension(attachment.contentType); attachment.filename += '.' + mimeFuncs.detectExtension(attachment.contentType);
} }

View File

@ -13,8 +13,9 @@ module.exports = {
* @param {String} value String to be tested * @param {String} value String to be tested
* @returns {Boolean} true if it is a plaintext string * @returns {Boolean} true if it is a plaintext string
*/ */
isPlainText(value) { isPlainText(value, isParam) {
if (typeof value !== 'string' || /[\x00-\x08\x0b\x0c\x0e-\x1f\u0080-\uFFFF]/.test(value)) { const re = isParam ? /[\x00-\x08\x0b\x0c\x0e-\x1f"\u0080-\uFFFF]/ : /[\x00-\x08\x0b\x0c\x0e-\x1f\u0080-\uFFFF]/;
if (typeof value !== 'string' || re.test(value)) {
return false; return false;
} else { } else {
return true; return true;
@ -49,11 +50,7 @@ module.exports = {
* @return {String} Single or several mime words joined together * @return {String} Single or several mime words joined together
*/ */
encodeWord(data, mimeWordEncoding, maxLength) { encodeWord(data, mimeWordEncoding, maxLength) {
mimeWordEncoding = (mimeWordEncoding || 'Q') mimeWordEncoding = (mimeWordEncoding || 'Q').toString().toUpperCase().trim().charAt(0);
.toString()
.toUpperCase()
.trim()
.charAt(0);
maxLength = maxLength || 0; maxLength = maxLength || 0;
let encodedStr; let encodedStr;
@ -66,10 +63,7 @@ module.exports = {
if (mimeWordEncoding === 'Q') { if (mimeWordEncoding === 'Q') {
// https://tools.ietf.org/html/rfc2047#section-5 rule (3) // https://tools.ietf.org/html/rfc2047#section-5 rule (3)
encodedStr = qp.encode(data).replace(/[^a-z0-9!*+\-/=]/gi, chr => { encodedStr = qp.encode(data).replace(/[^a-z0-9!*+\-/=]/gi, chr => {
let ord = chr let ord = chr.charCodeAt(0).toString(16).toUpperCase();
.charCodeAt(0)
.toString(16)
.toUpperCase();
if (chr === ' ') { if (chr === ' ') {
return '_'; return '_';
} else { } else {
@ -131,8 +125,8 @@ module.exports = {
let encodedValue; let encodedValue;
// find first word with a non-printable ascii in it // find first word with a non-printable ascii or special symbol in it
let firstMatch = value.match(/(?:^|\s)([^\s]*[\u0080-\uFFFF])/); let firstMatch = value.match(/(?:^|\s)([^\s]*["\u0080-\uFFFF])/);
if (!firstMatch) { if (!firstMatch) {
return value; return value;
} }
@ -144,7 +138,7 @@ module.exports = {
} }
// find the last word with a non-printable ascii in it // find the last word with a non-printable ascii in it
let lastMatch = value.match(/([\u0080-\uFFFF][^\s]*)[^\u0080-\uFFFF]*$/); let lastMatch = value.match(/(["\u0080-\uFFFF][^\s]*)[^"\u0080-\uFFFF]*$/);
if (!lastMatch) { if (!lastMatch) {
// should not happen // should not happen
return value; return value;
@ -181,7 +175,7 @@ module.exports = {
// filename might include unicode characters so it is a special case // filename might include unicode characters so it is a special case
// other values probably do not // other values probably do not
let value = structured.params[param]; let value = structured.params[param];
if (!this.isPlainText(value) || value.length >= 75) { if (!this.isPlainText(value, true) || value.length >= 75) {
this.buildHeaderParam(param, value, 50).forEach(encodedParam => { this.buildHeaderParam(param, value, 50).forEach(encodedParam => {
if (!/[\s"\\;:/=(),<>@[\]?]|^[-']|'$/.test(encodedParam.value) || encodedParam.key.substr(-1) === '*') { if (!/[\s"\\;:/=(),<>@[\]?]|^[-']|'$/.test(encodedParam.value) || encodedParam.key.substr(-1) === '*') {
paramsArray.push(encodedParam.key + '=' + encodedParam.value); paramsArray.push(encodedParam.key + '=' + encodedParam.value);
@ -226,7 +220,7 @@ module.exports = {
maxLength = maxLength || 50; maxLength = maxLength || 50;
// process ascii only text // process ascii only text
if (this.isPlainText(data)) { if (this.isPlainText(data, true)) {
// check if conversion is even needed // check if conversion is even needed
if (encodedStr.length <= maxLength) { if (encodedStr.length <= maxLength) {
return [ return [
@ -591,10 +585,7 @@ module.exports = {
encodeURICharComponent: chr => { encodeURICharComponent: chr => {
let res = ''; let res = '';
let ord = chr let ord = chr.charCodeAt(0).toString(16).toUpperCase();
.charCodeAt(0)
.toString(16)
.toUpperCase();
if (ord.length % 2) { if (ord.length % 2) {
ord = '0' + ord; ord = '0' + ord;

View File

@ -2063,11 +2063,7 @@ module.exports = {
} }
let parsed = path.parse(filename); let parsed = path.parse(filename);
let extension = (parsed.ext.substr(1) || parsed.name || '') let extension = (parsed.ext.substr(1) || parsed.name || '').split('?').shift().trim().toLowerCase();
.split('?')
.shift()
.trim()
.toLowerCase();
let value = defaultMimeType; let value = defaultMimeType;
if (extensions.has(extension)) { if (extensions.has(extension)) {
@ -2084,10 +2080,7 @@ module.exports = {
if (!mimeType) { if (!mimeType) {
return defaultExtension; return defaultExtension;
} }
let parts = (mimeType || '') let parts = (mimeType || '').toLowerCase().trim().split('/');
.toLowerCase()
.trim()
.split('/');
let rootType = parts.shift().trim(); let rootType = parts.shift().trim();
let subType = parts.join('/').trim(); let subType = parts.join('/').trim();

View File

@ -530,6 +530,7 @@ class MimeNode {
} }
value = mimeFuncs.buildHeaderValue(structured); value = mimeFuncs.buildHeaderValue(structured);
break; break;
case 'Content-Type': case 'Content-Type':
structured = mimeFuncs.parseHeaderValue(value); structured = mimeFuncs.parseHeaderValue(value);
@ -554,6 +555,7 @@ class MimeNode {
value += '; name=' + param; value += '; name=' + param;
} }
break; break;
case 'Bcc': case 'Bcc':
if (!this.keepBcc) { if (!this.keepBcc) {
// skip BCC values // skip BCC values
@ -997,7 +999,7 @@ class MimeNode {
.trim() .trim()
.toLowerCase() .toLowerCase()
// use uppercase words, except MIME // use uppercase words, except MIME
.replace(/^X-SMTPAPI$|^(MIME|DKIM)\b|^[a-z]|-(SPF|FBL|ID|MD5)$|-[a-z]/gi, c => c.toUpperCase()) .replace(/^X-SMTPAPI$|^(MIME|DKIM|ARC|BIMI)\b|^[a-z]|-(SPF|FBL|ID|MD5)$|-[a-z]/gi, c => c.toUpperCase())
// special case // special case
.replace(/^Content-Features$/i, 'Content-features'); .replace(/^Content-Features$/i, 'Content-features');
@ -1099,6 +1101,11 @@ class MimeNode {
value = (value || '').toString().replace(/\r?\n|\r/g, ' '); value = (value || '').toString().replace(/\r?\n|\r/g, ' ');
return this._encodeWords(value); return this._encodeWords(value);
case 'Content-Type':
case 'Content-Disposition':
// if it includes a filename then it is already encoded
return (value || '').toString().replace(/\r?\n|\r/g, ' ');
default: default:
value = (value || '').toString().replace(/\r?\n|\r/g, ' '); value = (value || '').toString().replace(/\r?\n|\r/g, ' ');
// encodeWords only encodes if needed, otherwise the original string is returned // encodeWords only encodes if needed, otherwise the original string is returned

View File

@ -13,16 +13,11 @@ const packageData = require('../package.json');
const ETHEREAL_API = (process.env.ETHEREAL_API || 'https://api.nodemailer.com').replace(/\/+$/, ''); const ETHEREAL_API = (process.env.ETHEREAL_API || 'https://api.nodemailer.com').replace(/\/+$/, '');
const ETHEREAL_WEB = (process.env.ETHEREAL_WEB || 'https://ethereal.email').replace(/\/+$/, ''); const ETHEREAL_WEB = (process.env.ETHEREAL_WEB || 'https://ethereal.email').replace(/\/+$/, '');
const ETHEREAL_CACHE = ['true', 'yes', 'y', '1'].includes( const ETHEREAL_CACHE = ['true', 'yes', 'y', '1'].includes((process.env.ETHEREAL_CACHE || 'yes').toString().trim().toLowerCase());
(process.env.ETHEREAL_CACHE || 'yes')
.toString()
.trim()
.toLowerCase()
);
let testAccount = false; let testAccount = false;
module.exports.createTransport = function(transporter, defaults) { module.exports.createTransport = function (transporter, defaults) {
let urlConfig; let urlConfig;
let options; let options;
let mailer; let mailer;
@ -60,7 +55,7 @@ module.exports.createTransport = function(transporter, defaults) {
return mailer; return mailer;
}; };
module.exports.createTestAccount = function(apiUrl, callback) { module.exports.createTestAccount = function (apiUrl, callback) {
let promise; let promise;
if (!callback && typeof apiUrl === 'function') { if (!callback && typeof apiUrl === 'function') {
@ -128,7 +123,7 @@ module.exports.createTestAccount = function(apiUrl, callback) {
return promise; return promise;
}; };
module.exports.getTestMessageUrl = function(info) { module.exports.getTestMessageUrl = function (info) {
if (!info || !info.response) { if (!info || !info.response) {
return false; return false;
} }

View File

@ -70,6 +70,14 @@ class SendmailTransport {
let returned; let returned;
let transform; let transform;
const hasInvalidAddresses = []
.concat(envelope.from || [])
.concat(envelope.to || [])
.some(addr => /^-/.test(addr));
if (hasInvalidAddresses) {
return done(new Error('Can not send mail. Invalid envelope addresses.'));
}
if (this.args) { if (this.args) {
// force -i to keep single dots // force -i to keep single dots
args = ['-i'].concat(this.args).concat(envelope.to); args = ['-i'].concat(this.args).concat(envelope.to);

View File

@ -38,7 +38,7 @@ class SESTransport extends EventEmitter {
// max messages per second // max messages per second
this.sendingRate = Number(this.options.sendingRate) || Infinity; this.sendingRate = Number(this.options.sendingRate) || Infinity;
this.sendingRateTTL = null; this.sendingRateTTL = null;
this.rateInterval = 1000; this.rateInterval = 1000; // milliseconds
this.rateMessages = []; this.rateMessages = [];
this.pending = []; this.pending = [];

View File

@ -276,7 +276,7 @@ module.exports.getLogger = (options, defaults) => {
* @param {Function} reject Function to run if callback ends with an error * @param {Function} reject Function to run if callback ends with an error
*/ */
module.exports.callbackPromise = (resolve, reject) => module.exports.callbackPromise = (resolve, reject) =>
function() { function () {
let args = Array.from(arguments); let args = Array.from(arguments);
let err = args.shift(); let err = args.shift();
if (err) { if (err) {
@ -357,7 +357,7 @@ module.exports.resolveContent = (data, key, callback) => {
/** /**
* Copies properties from source objects to target objects * Copies properties from source objects to target objects
*/ */
module.exports.assign = function(/* target, ... sources */) { module.exports.assign = function (/* target, ... sources */) {
let args = Array.from(arguments); let args = Array.from(arguments);
let target = args.shift() || {}; let target = args.shift() || {};
@ -489,15 +489,7 @@ function createDefaultLogger(levels) {
message = util.format(message, ...args); message = util.format(message, ...args);
message.split(/\r?\n/).forEach(line => { message.split(/\r?\n/).forEach(line => {
console.log( console.log('[%s] %s %s', new Date().toISOString().substr(0, 19).replace(/T/, ' '), levelNames.get(level), prefix + line);
'[%s] %s %s',
new Date()
.toISOString()
.substr(0, 19)
.replace(/T/, ' '),
levelNames.get(level),
prefix + line
);
}); });
}; };

View File

@ -44,7 +44,7 @@ function httpProxyClient(proxyUrl, destinationPort, destinationHost, callback) {
// Error harness for initial connection. Once connection is established, the responsibility // Error harness for initial connection. Once connection is established, the responsibility
// to handle errors is passed to whoever uses this socket // to handle errors is passed to whoever uses this socket
let finished = false; let finished = false;
let tempSocketErr = function(err) { let tempSocketErr = function (err) {
if (finished) { if (finished) {
return; return;
} }

View File

@ -45,10 +45,7 @@ class SMTPConnection extends EventEmitter {
constructor(options) { constructor(options) {
super(options); super(options);
this.id = crypto this.id = crypto.randomBytes(8).toString('base64').replace(/\W/g, '');
.randomBytes(8)
.toString('base64')
.replace(/\W/g, '');
this.stage = 'init'; this.stage = 'init';
this.options = options || {}; this.options = options || {};
@ -73,10 +70,7 @@ class SMTPConnection extends EventEmitter {
this.customAuth = new Map(); this.customAuth = new Map();
Object.keys(this.options.customAuth || {}).forEach(key => { Object.keys(this.options.customAuth || {}).forEach(key => {
let mapKey = (key || '') let mapKey = (key || '').toString().trim().toUpperCase();
.toString()
.trim()
.toUpperCase();
if (!mapKey) { if (!mapKey) {
return; return;
} }
@ -424,11 +418,7 @@ class SMTPConnection extends EventEmitter {
this._auth = authData || {}; this._auth = authData || {};
// Select SASL authentication method // Select SASL authentication method
this._authMethod = this._authMethod = (this._auth.method || '').toString().trim().toUpperCase() || false;
(this._auth.method || '')
.toString()
.trim()
.toUpperCase() || false;
if (!this._authMethod && this._auth.oauth2 && !this._auth.credentials) { if (!this._authMethod && this._auth.oauth2 && !this._auth.credentials) {
this._authMethod = 'XOAUTH2'; this._authMethod = 'XOAUTH2';
@ -598,7 +588,7 @@ class SMTPConnection extends EventEmitter {
// ensure that callback is only called once // ensure that callback is only called once
let returned = false; let returned = false;
let callback = function() { let callback = function () {
if (returned) { if (returned) {
return; return;
} }

View File

@ -41,7 +41,7 @@ function normalizeService(service) {
* @param {String} key [description] * @param {String} key [description]
* @returns {Object} SMTP config or false if not found * @returns {Object} SMTP config or false if not found
*/ */
module.exports = function(key) { module.exports = function (key) {
key = normalizeKey(key.split('@').pop()); key = normalizeKey(key.split('@').pop());
return normalized[key] || false; return normalized[key] || false;
}; };

View File

@ -23,6 +23,12 @@
"port": 25 "port": 25
}, },
"Ethereal": {
"aliases": ["ethereal.email"],
"host": "smtp.ethereal.email",
"port": 587
},
"FastMail": { "FastMail": {
"domains": ["fastmail.fm"], "domains": ["fastmail.fm"],
"host": "smtp.fastmail.com", "host": "smtp.fastmail.com",

View File

@ -261,7 +261,15 @@ class XOAuth2 extends Stream {
); );
if (data.error) { if (data.error) {
return callback(new Error(data.error)); // Error Response : https://tools.ietf.org/html/rfc6749#section-5.2
let errorMessage = data.error;
if (data.error_description) {
errorMessage += ': ' + data.error_description;
}
if (data.error_uri) {
errorMessage += ' (' + data.error_uri + ')';
}
return callback(new Error(errorMessage));
} }
if (data.access_token) { if (data.access_token) {

29
node_modules/nodemailer/package.json generated vendored
View File

@ -1,27 +1,27 @@
{ {
"_from": "nodemailer@6.4.11", "_from": "nodemailer@6.4.16",
"_id": "nodemailer@6.4.11", "_id": "nodemailer@6.4.16",
"_inBundle": false, "_inBundle": false,
"_integrity": "sha512-BVZBDi+aJV4O38rxsUh164Dk1NCqgh6Cm0rQSb9SK/DHGll/DrCMnycVDD7msJgZCnmVa8ASo8EZzR7jsgTukQ==", "_integrity": "sha512-68K0LgZ6hmZ7PVmwL78gzNdjpj5viqBdFqKrTtr9bZbJYj6BRj5W6WGkxXrEnUl3Co3CBXi3CZBUlpV/foGnOQ==",
"_location": "/nodemailer", "_location": "/nodemailer",
"_phantomChildren": {}, "_phantomChildren": {},
"_requested": { "_requested": {
"type": "version", "type": "version",
"registry": true, "registry": true,
"raw": "nodemailer@6.4.11", "raw": "nodemailer@6.4.16",
"name": "nodemailer", "name": "nodemailer",
"escapedName": "nodemailer", "escapedName": "nodemailer",
"rawSpec": "6.4.11", "rawSpec": "6.4.16",
"saveSpec": null, "saveSpec": null,
"fetchSpec": "6.4.11" "fetchSpec": "6.4.16"
}, },
"_requiredBy": [ "_requiredBy": [
"#USER", "#USER",
"/" "/"
], ],
"_resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.4.11.tgz", "_resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.4.16.tgz",
"_shasum": "1f00b4ffd106403f17c03f3d43d5945b2677046c", "_shasum": "5cb6391b1d79ab7eff32d6f9f48366b5a7117293",
"_spec": "nodemailer@6.4.11", "_spec": "nodemailer@6.4.16",
"_where": "/home/dawidd6/github/dawidd6/action-send-mail", "_where": "/home/dawidd6/github/dawidd6/action-send-mail",
"author": { "author": {
"name": "Andris Reinman" "name": "Andris Reinman"
@ -37,19 +37,19 @@
"bunyan": "1.8.14", "bunyan": "1.8.14",
"chai": "4.2.0", "chai": "4.2.0",
"eslint-config-nodemailer": "1.2.0", "eslint-config-nodemailer": "1.2.0",
"eslint-config-prettier": "6.11.0", "eslint-config-prettier": "6.15.0",
"grunt": "1.2.1", "grunt": "1.3.0",
"grunt-cli": "1.3.2", "grunt-cli": "1.3.2",
"grunt-eslint": "23.0.0", "grunt-eslint": "23.0.0",
"grunt-mocha-test": "0.13.3", "grunt-mocha-test": "0.13.3",
"libbase64": "1.2.1", "libbase64": "1.2.1",
"libmime": "5.0.0", "libmime": "5.0.0",
"libqp": "1.1.0", "libqp": "1.1.0",
"mocha": "8.0.1", "mocha": "8.2.1",
"nodemailer-ntlm-auth": "1.0.1", "nodemailer-ntlm-auth": "1.0.1",
"proxy": "1.0.2", "proxy": "1.0.2",
"proxy-test-server": "1.0.0", "proxy-test-server": "1.0.0",
"sinon": "9.0.2", "sinon": "9.2.1",
"smtp-server": "3.7.0" "smtp-server": "3.7.0"
}, },
"engines": { "engines": {
@ -67,8 +67,7 @@
"url": "git+https://github.com/nodemailer/nodemailer.git" "url": "git+https://github.com/nodemailer/nodemailer.git"
}, },
"scripts": { "scripts": {
"postinstall": "node -e \"try{require('./postinstall')}catch(e){}\"",
"test": "grunt" "test": "grunt"
}, },
"version": "6.4.11" "version": "6.4.16"
} }

12
package-lock.json generated
View File

@ -5,14 +5,14 @@
"requires": true, "requires": true,
"dependencies": { "dependencies": {
"@actions/core": { "@actions/core": {
"version": "1.2.5", "version": "1.2.6",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.5.tgz", "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.6.tgz",
"integrity": "sha512-mwpoNjHSWWh0IiALdDEQi3tru124JKn0yVNziIBzTME8QRv7thwoghVuT1jBRjFvdtoHsqD58IRHy1nf86paRg==" "integrity": "sha512-ZQYitnqiyBc3D+k7LsgSBmMDVkOVidaagDG7j3fOym77jNunWRuYx7VSHa9GNfFZh+zh61xsCjRj4JxMZlDqTA=="
}, },
"nodemailer": { "nodemailer": {
"version": "6.4.11", "version": "6.4.16",
"resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.4.11.tgz", "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.4.16.tgz",
"integrity": "sha512-BVZBDi+aJV4O38rxsUh164Dk1NCqgh6Cm0rQSb9SK/DHGll/DrCMnycVDD7msJgZCnmVa8ASo8EZzR7jsgTukQ==" "integrity": "sha512-68K0LgZ6hmZ7PVmwL78gzNdjpj5viqBdFqKrTtr9bZbJYj6BRj5W6WGkxXrEnUl3Co3CBXi3CZBUlpV/foGnOQ=="
} }
} }
} }

View File

@ -17,7 +17,7 @@
}, },
"homepage": "https://github.com/dawidd6/action-send-mail#readme", "homepage": "https://github.com/dawidd6/action-send-mail#readme",
"dependencies": { "dependencies": {
"@actions/core": "^1.2.5", "@actions/core": "^1.2.6",
"nodemailer": "^6.4.11" "nodemailer": "^6.4.16"
} }
} }