fix email inreplyto to do the sensible thing

This commit is contained in:
Dave Conway-Jones
2022-03-19 10:31:40 +00:00
parent 637890309a
commit fb9c90f68c
2 changed files with 5 additions and 1 deletions

View File

@@ -96,6 +96,10 @@ module.exports = function(RED) {
sendopts.priority = msg.priority;
}
sendopts.subject = msg.topic || msg.title || "Message from Node-RED"; // subject line
if (msg.hasOwnProperty("header") && msg.header.hasOwnProperty("message-id")) {
sendopts.inReplyTo = msg.header["message-id"];
sendopts.subject = "Re: " + sendopts.subject;
}
if (msg.hasOwnProperty("envelope")) { sendopts.envelope = msg.envelope; }
if (Buffer.isBuffer(msg.payload)) { // if it's a buffer in the payload then auto create an attachment instead
if (!msg.filename) {