mirror of
https://github.com/dawidd6/action-send-mail.git
synced 2024-11-10 05:51:07 +07:00
✨ Adding support to SSLv3 to TLS
This commit is contained in:
parent
fa73d6accd
commit
bf043338b6
@ -54,6 +54,8 @@ Some features:
|
|||||||
in_reply_to: <random-luke@example.com>
|
in_reply_to: <random-luke@example.com>
|
||||||
# Optional unsigned/invalid certificates allowance:
|
# Optional unsigned/invalid certificates allowance:
|
||||||
ignore_cert: true
|
ignore_cert: true
|
||||||
|
# Optional Sets the secure SSL version v3
|
||||||
|
ciphers_sslv3: true
|
||||||
# Optional converting Markdown to HTML (set content_type to text/html too):
|
# Optional converting Markdown to HTML (set content_type to text/html too):
|
||||||
convert_markdown: true
|
convert_markdown: true
|
||||||
# Optional attachments:
|
# Optional attachments:
|
||||||
|
@ -48,6 +48,9 @@ inputs:
|
|||||||
ignore_cert:
|
ignore_cert:
|
||||||
description: Allow unsigned/invalid certificates
|
description: Allow unsigned/invalid certificates
|
||||||
required: false
|
required: false
|
||||||
|
ciphers_sslv3:
|
||||||
|
description: Sets the secure SSL version v3
|
||||||
|
required: true
|
||||||
convert_markdown:
|
convert_markdown:
|
||||||
description: Convert body from Markdown to HTML (set content_type input as text/html too)
|
description: Convert body from Markdown to HTML (set content_type input as text/html too)
|
||||||
required: false
|
required: false
|
||||||
|
11
main.js
11
main.js
@ -90,6 +90,7 @@ async function main() {
|
|||||||
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 ignoreCert = core.getInput("ignore_cert", { required: false })
|
||||||
|
const ciphersSSLv3 = core.getInput("ciphers_sslv3", { required: false })
|
||||||
const priority = core.getInput("priority", { required: false })
|
const priority = core.getInput("priority", { required: false })
|
||||||
|
|
||||||
if (!serverAddress) {
|
if (!serverAddress) {
|
||||||
@ -100,7 +101,7 @@ async function main() {
|
|||||||
core.warning("Username and password not specified. You should only do this if you are using a self-hosted runner to access an on-premise mail server.")
|
core.warning("Username and password not specified. You should only do this if you are using a self-hosted runner to access an on-premise mail server.")
|
||||||
}
|
}
|
||||||
|
|
||||||
const transport = nodemailer.createTransport({
|
const transportOptions = {
|
||||||
host: serverAddress,
|
host: serverAddress,
|
||||||
auth: username && password ? {
|
auth: username && password ? {
|
||||||
user: username,
|
user: username,
|
||||||
@ -111,7 +112,13 @@ async function main() {
|
|||||||
tls: ignoreCert == "true" ? {
|
tls: ignoreCert == "true" ? {
|
||||||
rejectUnauthorized: false
|
rejectUnauthorized: false
|
||||||
} : undefined,
|
} : undefined,
|
||||||
})
|
}
|
||||||
|
|
||||||
|
if (ignoreCert == "true" && ciphersSSLv3 == "true") {
|
||||||
|
transportOptions.tls.ciphers = 'SSLv3'
|
||||||
|
}
|
||||||
|
|
||||||
|
const transport = nodemailer.createTransport(transportOptions)
|
||||||
|
|
||||||
const info = await transport.sendMail({
|
const info = await transport.sendMail({
|
||||||
from: getFrom(from, username),
|
from: getFrom(from, username),
|
||||||
|
Loading…
Reference in New Issue
Block a user