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