Email getting rejected with 550 Messages should have one or no Content-Type headers, not 2

Hi,

Over the last week or so I have been getting an error for some emails sent with the email node to an outlook server. I am getting a bounce on the email with

The response from the remote server was:

550 Messages should have one or no Content-Type headers, not 2.

It is quite strange as it seems to work if I trigger the email manually and it worked for over year.

I set up the email by

let batch_id = msg.batch
let payload = msg.payload   //was msh.payload thanks Steve
msg.to = "redacted@redacted.com.au"
msg.bcc = "chrisn@work.com.au,"
msg.topic = "Order Data for Batch ID "+msg.batch
msg.attachments = [{ filename: batch+".csv",
                     content: payload
                  }];

msg.payload = "Attached is the order Data for batch id "+batch

return msg;

Before I go an spend to much tiime on this has anyone seen anything like this ?

Maybe due to the typo?

unfortunately not, that typo was me sanitising before posting I will tidy up the typo

What happens if you put quotes around the email addresses and/or remove the comma?

msg.to = `"redacted@redacted.com.au"`
msg.bcc = `"chrisn@work.com.au"`

Steve,

Umm, I may have found the issue, (and not sure why it has started to occur now). The upstream flow makes a HTTP call, so msg.headers is set. In my resend flow msg.headers is not set .

I assume that the email node may be using the msg.headers field. I have justed nuked msg and only explicitly set what I need. will find out tomorrow at 7 am but it makes sense

let batch_id = msg.batch
let payload = msg.payload   //was msh.payload thanks Steve
msg.payload = {}
msg.to = "redacted@redacted.com.au"
msg.bcc = "chrisn@work.com.au,"
msg.topic = "Order Data for Batch ID "+msg.batch
msg.attachments = [{ filename: batch+".csv",
                     content: payload
                  }];

msg.payload = "Attached is the order Data for batch id "+batch
``

So yep the email node does use msg.headers

                    if (node.name === "") {
                        sendopts.cc = msg.cc;
                        sendopts.bcc = msg.bcc;
                        sendopts.inReplyTo = msg.inReplyTo;
                        sendopts.replyTo = msg.replyTo;
                        sendopts.references = msg.references;
                        sendopts.headers = msg.headers;
                        sendopts.priority = msg.priority;
                    }

So I guess that the receiving sides email server has been upgraded and it justifiably rejects a header like

msg.headers =
{
        "API-TOKEN": msg.accessToken,
        "Content-Type": "application/json" 
}

Thanks for the help

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.