From d38f3f7cd391cdebfe0d38efc3998b935e951c4f Mon Sep 17 00:00:00 2001 From: Fritz Elfert Date: Wed, 18 Mar 2026 16:11:48 +0100 Subject: [PATCH] Relax from check (#277) * Relax from check - Print a warning instead of an error, if envelope_from is set. - In case of an error, provide a hint about envelope_from. * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- main.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/main.js b/main.js index 1c59778d..d4470fdc 100644 --- a/main.js +++ b/main.js @@ -147,7 +147,14 @@ async function main() { // Either: "Plain Simple Name " or just "user@doma.in" (without the <>) let parsed = addressparser(from); if (parsed.length != 1 || parsed[0].address == '') { - throw new Error("'from' address is invalid"); + // Report an error only if the user did not set envelope_from. Otherwise, envelope_from + // overrides from anyway and from is used as is (but Nodemailer will remove + // the From: header completely). + if (envelopeFrom) { + core.warning("'from' address is invalid. Nodemailer will not create a 'From:' header."); + } else { + throw new Error("'from' address is invalid. Maybe you want to set 'envelope_from' to a valid sender address?"); + } } // if neither to, cc or bcc is provided, throw error