8 Commits

Author SHA1 Message Date
3ce6fdc63e Add replyTo field support (#41)
Co-authored-by: Dawid Dziurla <dawidd0811@gmail.com>
2021-04-07 19:34:58 +02:00
f1b626cfd4 main: fix 2021-04-02 09:11:00 +02:00
0037ae15ac Merge pull request #39 from dawidd6/ignore-cert
main: ignore cert if desired
2021-04-02 00:04:33 +02:00
5b924828c0 README: mention ignore_cert 2021-04-02 00:02:58 +02:00
a2f920a18b action: add ignore_cert input 2021-04-02 00:02:46 +02:00
3082f5221c main: ignore cert if desired 2021-04-02 00:00:57 +02:00
9210f61cf4 node_modules: update 2021-03-23 21:57:43 +01:00
a5a673e774 README: use example domain
Closes: #31
2021-02-22 22:16:12 +01:00
12 changed files with 110 additions and 48 deletions

View File

@ -17,12 +17,16 @@ An action that simply sends a mail to multiple recipients.
body: Build job of ${{github.repository}} completed successfully! body: Build job of ${{github.repository}} completed successfully!
# Read file contents as body: # Read file contents as body:
body: file://README.md body: file://README.md
to: obiwan@tatooine.com,yoda@dagobah.com to: obiwan@example.com,yoda@example.com
from: Luke Skywalker # <user@example.com> from: Luke Skywalker # <user@example.com>
# Optional carbon copy recipients # Optional carbon copy recipients
cc: kyloren@starkiller.com,leia@alderaan.com cc: kyloren@example.com,leia@example.com
# Optional blind carbon copy recipients # Optional blind carbon copy recipients
bcc: r2d2@jakku.com,hansolo@milleniumfalcon.com bcc: r2d2@example.com,hansolo@example.com
# Optional recipient of the email response
reply_to: luke@example.com
# Optional unsigned/invalid certificates allowance:
ignore_cert: true
# Optional content type (defaults to text/plain): # Optional content type (defaults to text/plain):
content_type: text/html content_type: text/html
# Optional converting Markdown to HTML (set content_type to text/html too): # Optional converting Markdown to HTML (set content_type to text/html too):

View File

@ -35,6 +35,12 @@ inputs:
bcc: bcc:
description: Blind carbon copy recipients (separated with comma) description: Blind carbon copy recipients (separated with comma)
required: false required: false
reply_to:
description: An email address that will appear on the Reply-To field
required: false
ignore_cert:
description: Allow unsigned/invalid certificates
required: false
content_type: content_type:
description: Content-Type HTTP header (text/html or text/plain) description: Content-Type HTTP header (text/html or text/plain)
required: false required: false

View File

@ -41,9 +41,11 @@ async function main() {
const to = core.getInput("to", { required: true }) const to = core.getInput("to", { required: true })
const cc = core.getInput("cc", { required: false }) const cc = core.getInput("cc", { required: false })
const bcc = core.getInput("bcc", { required: false }) const bcc = core.getInput("bcc", { required: false })
const replyTo = core.getInput("reply_to", { required: false })
const contentType = core.getInput("content_type", { required: true }) const contentType = core.getInput("content_type", { required: true })
const attachments = core.getInput("attachments", { required: false }) const attachments = core.getInput("attachments", { required: false })
const convertMarkdown = core.getInput("convert_markdown", { required: false }) const convertMarkdown = core.getInput("convert_markdown", { required: false })
const ignoreCert = core.getInput("ignore_cert", { required: false })
const transport = nodemailer.createTransport({ const transport = nodemailer.createTransport({
host: serverAddress, host: serverAddress,
@ -52,7 +54,10 @@ async function main() {
auth: { auth: {
user: username, user: username,
pass: password, pass: password,
} },
tls: ignoreCert ? {
rejectUnauthorized: false
} : undefined
}) })
const info = await transport.sendMail({ const info = await transport.sendMail({
@ -60,6 +65,7 @@ async function main() {
to: to, to: to,
cc: cc ? cc : undefined, cc: cc ? cc : undefined,
bcc: bcc ? bcc : undefined, bcc: bcc ? bcc : undefined,
replyTo: replyTo ? replyTo : undefined,
subject: subject, subject: subject,
text: contentType != "text/html" ? getBody(body, convertMarkdown) : undefined, text: contentType != "text/html" ? getBody(body, convertMarkdown) : undefined,
html: contentType == "text/html" ? getBody(body, convertMarkdown) : undefined, html: contentType == "text/html" ? getBody(body, convertMarkdown) : undefined,

6
node_modules/.package-lock.json generated vendored
View File

@ -112,9 +112,9 @@
} }
}, },
"node_modules/nodemailer": { "node_modules/nodemailer": {
"version": "6.4.17", "version": "6.5.0",
"resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.4.17.tgz", "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.5.0.tgz",
"integrity": "sha512-89ps+SBGpo0D4Bi5ZrxcrCiRFaMmkCt+gItMXQGzEtZVR3uAD3QAQIDoxTWnx3ky0Dwwy/dhFrQ+6NNGXpw/qQ==", "integrity": "sha512-Tm4RPrrIZbnqDKAvX+/4M+zovEReiKlEXWDzG4iwtpL9X34MJY+D5LnQPH/+eghe8DLlAVshHAJZAZWBGhkguw==",
"engines": { "engines": {
"node": ">=6.0.0" "node": ">=6.0.0"
} }

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

@ -1,5 +1,15 @@
# CHANGELOG # CHANGELOG
## 6.5.0 2021-02-26
- Pass through textEncoding to subnodes
- Added support for AWS SES v3 SDK
- Fixed tests
## 6.4.18 2021-02-11
- Updated README
## 6.4.17 2020-12-11 ## 6.4.17 2020-12-11
- Allow mixing attachments with caendar alternatives - Allow mixing attachments with caendar alternatives

2
node_modules/nodemailer/README.md generated vendored
View File

@ -2,6 +2,8 @@
[![Nodemailer](https://raw.githubusercontent.com/nodemailer/nodemailer/master/assets/nm_logo_200x136.png)](https://nodemailer.com/about/) [![Nodemailer](https://raw.githubusercontent.com/nodemailer/nodemailer/master/assets/nm_logo_200x136.png)](https://nodemailer.com/about/)
> Sponsored by [Forward Email](https://forwardemail.net/?ref=nodemailer) &ndash; free email forwarding + custom domains + 100% open-source!
Send e-mails from Node.js easy as cake! 🍰✉️ Send e-mails from Node.js easy as cake! 🍰✉️
[![NPM](https://nodei.co/npm/nodemailer.png?downloads=true&downloadRank=true&stars=true)](https://nodemailer.com/about/) [![NPM](https://nodei.co/npm/nodemailer.png?downloads=true&downloadRank=true&stars=true)](https://nodemailer.com/about/)

View File

@ -475,6 +475,7 @@ class MailComposer {
} else { } else {
node = parentNode.createChild(element.contentType, { node = parentNode.createChild(element.contentType, {
filename: element.filename, filename: element.filename,
textEncoding: this.mail.textEncoding,
disableUrlAccess: this.mail.disableUrlAccess, disableUrlAccess: this.mail.disableUrlAccess,
disableFileAccess: this.mail.disableFileAccess, disableFileAccess: this.mail.disableFileAccess,
normalizeHeaderKey: this.mail.normalizeHeaderKey normalizeHeaderKey: this.mail.normalizeHeaderKey

View File

@ -451,7 +451,7 @@ class MimeNode {
transferEncoding = this._getTextEncoding(this.content) === 'Q' ? 'quoted-printable' : 'base64'; transferEncoding = this._getTextEncoding(this.content) === 'Q' ? 'quoted-printable' : 'base64';
} else { } else {
// we can not check content for a stream, so either use preferred encoding or fallback to QP // we can not check content for a stream, so either use preferred encoding or fallback to QP
transferEncoding = this.transferEncoding === 'B' ? 'base64' : 'quoted-printable'; transferEncoding = this.textEncoding === 'B' ? 'base64' : 'quoted-printable';
} }
} else if (!/^(multipart|message)\//i.test(contentType)) { } else if (!/^(multipart|message)\//i.test(contentType)) {
transferEncoding = transferEncoding || 'base64'; transferEncoding = transferEncoding || 'base64';

View File

@ -239,22 +239,36 @@ class SESTransport extends EventEmitter {
sesMessage[key] = mail.data.ses[key]; sesMessage[key] = mail.data.ses[key];
}); });
this.ses.sendRawEmail(sesMessage, (err, data) => { let ses = (this.ses.aws ? this.ses.ses : this.ses) || {};
if (err) { let aws = this.ses.aws || {};
this.logger.error(
{ let getRegion = cb => {
err, if (ses.config && typeof ses.config.region === 'function') {
tnx: 'send' // promise
}, return ses.config
'Send error for %s: %s', .region()
messageId, .then(region => cb(null, region))
err.message .catch(err => cb(err));
); }
statObject.pending = false; return cb(null, (ses.config && ses.config.region) || 'us-east-1');
return callback(err); };
getRegion((err, region) => {
if (err || !region) {
region = 'us-east-1';
} }
let region = (this.ses.config && this.ses.config.region) || 'us-east-1'; let sendPromise;
if (typeof ses.send === 'function' && aws.SendRawEmailCommand) {
// v3 API
sendPromise = ses.send(new aws.SendRawEmailCommand(sesMessage));
} else {
// v2 API
sendPromise = ses.sendRawEmail(sesMessage).promise();
}
sendPromise
.then(data => {
if (region === 'us-east-1') { if (region === 'us-east-1') {
region = 'email'; region = 'email';
} }
@ -269,6 +283,20 @@ class SESTransport extends EventEmitter {
response: data.MessageId, response: data.MessageId,
raw raw
}); });
})
.catch(err => {
this.logger.error(
{
err,
tnx: 'send'
},
'Send error for %s: %s',
messageId,
err.message
);
statObject.pending = false;
callback(err);
});
}); });
}) })
); );

View File

@ -148,6 +148,12 @@
"secure": false "secure": false
}, },
"OhMySMTP": {
"host": "smtp.ohmysmtp.com",
"port": 587,
"secure": false
},
"Postmark": { "Postmark": {
"aliases": ["PostmarkApp"], "aliases": ["PostmarkApp"],
"host": "smtp.postmarkapp.com", "host": "smtp.postmarkapp.com",

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

@ -1,6 +1,6 @@
{ {
"name": "nodemailer", "name": "nodemailer",
"version": "6.4.17", "version": "6.5.0",
"description": "Easy as cake e-mail sending from your Node.js applications", "description": "Easy as cake e-mail sending from your Node.js applications",
"main": "lib/nodemailer.js", "main": "lib/nodemailer.js",
"scripts": { "scripts": {
@ -20,10 +20,10 @@
}, },
"homepage": "https://nodemailer.com/", "homepage": "https://nodemailer.com/",
"devDependencies": { "devDependencies": {
"bunyan": "1.8.14", "bunyan": "1.8.15",
"chai": "4.2.0", "chai": "4.3.0",
"eslint-config-nodemailer": "1.2.0", "eslint-config-nodemailer": "1.2.0",
"eslint-config-prettier": "7.0.0", "eslint-config-prettier": "8.1.0",
"grunt": "1.3.0", "grunt": "1.3.0",
"grunt-cli": "1.3.2", "grunt-cli": "1.3.2",
"grunt-eslint": "23.0.0", "grunt-eslint": "23.0.0",
@ -31,15 +31,14 @@
"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.2.1", "mocha": "8.3.0",
"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.2.1", "sinon": "9.2.4",
"smtp-server": "3.8.0" "smtp-server": "3.8.0"
}, },
"engines": { "engines": {
"node": ">=6.0.0" "node": ">=6.0.0"
}, }
"dependencies": {}
} }

12
package-lock.json generated
View File

@ -121,9 +121,9 @@
} }
}, },
"node_modules/nodemailer": { "node_modules/nodemailer": {
"version": "6.4.17", "version": "6.5.0",
"resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.4.17.tgz", "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.5.0.tgz",
"integrity": "sha512-89ps+SBGpo0D4Bi5ZrxcrCiRFaMmkCt+gItMXQGzEtZVR3uAD3QAQIDoxTWnx3ky0Dwwy/dhFrQ+6NNGXpw/qQ==", "integrity": "sha512-Tm4RPrrIZbnqDKAvX+/4M+zovEReiKlEXWDzG4iwtpL9X34MJY+D5LnQPH/+eghe8DLlAVshHAJZAZWBGhkguw==",
"engines": { "engines": {
"node": ">=6.0.0" "node": ">=6.0.0"
} }
@ -358,9 +358,9 @@
} }
}, },
"nodemailer": { "nodemailer": {
"version": "6.4.17", "version": "6.5.0",
"resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.4.17.tgz", "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.5.0.tgz",
"integrity": "sha512-89ps+SBGpo0D4Bi5ZrxcrCiRFaMmkCt+gItMXQGzEtZVR3uAD3QAQIDoxTWnx3ky0Dwwy/dhFrQ+6NNGXpw/qQ==" "integrity": "sha512-Tm4RPrrIZbnqDKAvX+/4M+zovEReiKlEXWDzG4iwtpL9X34MJY+D5LnQPH/+eghe8DLlAVshHAJZAZWBGhkguw=="
}, },
"p-limit": { "p-limit": {
"version": "2.3.0", "version": "2.3.0",