From dc13c734ff2b581c12c1b59958ba73d6fa95b371 Mon Sep 17 00:00:00 2001 From: Bernhard <48006183+furtber@users.noreply.github.com> Date: Fri, 5 Jan 2024 18:40:18 +0100 Subject: [PATCH] Enable logging and debug of nodemailer (#190) This should help A LOT to let people understand why things go wrong in this action when talking to the mailhost --- README.md | 4 ++++ action.yml | 6 ++++++ main.js | 4 ++++ 3 files changed, 14 insertions(+) diff --git a/README.md b/README.md index 8b2278c3..583b75db 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,10 @@ Some features: attachments: attachments.zip,git.diff,./dist/static/*.js # Optional priority: 'high', 'normal' (default) or 'low' priority: low + # Optional nodemailerlog: true/false + nodemailerlog: false + # Optional nodemailerdebug: true/false if true lognodem will also be set true + nodemailerdebug: false ``` ## Troubleshooting diff --git a/action.yml b/action.yml index 407d2c54..458cf6ef 100644 --- a/action.yml +++ b/action.yml @@ -57,6 +57,12 @@ inputs: priority: description: Set Priority level for the mail message to 'high', 'normal' (default) or 'low' required: false + nodemailerlog: + description: Log option for nodemailer + required: false + nodemailerdebug: + description: Debug option for nodemailer + required: false runs: using: node16 main: main.js diff --git a/main.js b/main.js index dd556eda..30fae2fc 100644 --- a/main.js +++ b/main.js @@ -91,6 +91,8 @@ async function main() { const convertMarkdown = core.getInput("convert_markdown", { required: false }) const ignoreCert = core.getInput("ignore_cert", { required: false }) const priority = core.getInput("priority", { required: false }) + const nodemailerlog = core.getInput("nodemailerlog", { required: false }) + const nodemailerdebug = core.getInput("nodemailerdebug", { required: false }) // if neither to, cc or bcc is provided, throw error if (!to && !cc && !bcc) { @@ -112,6 +114,8 @@ async function main() { tls: ignoreCert == "true" ? { rejectUnauthorized: false } : undefined, + logger: nodemailerdebug == "true" ? true : nodemailerlog, + debug: nodemailerdebug, }) const info = await transport.sendMail({