arithmetric / aws-lambda-ses-forwarder

Serverless email forwarding using AWS Lambda and SES
MIT License
1.7k stars 450 forks source link

InvalidParameterValue: Duplicate header 'Delivered-To' #111

Open BuffMcBigHuge opened 5 years ago

BuffMcBigHuge commented 5 years ago

I'm seeing this error on several emails. Any insight?

cregkly commented 4 years ago

Is that an error from SendRawEmail?

Download the message from S3 and look for that header. Maybe compare to some messages that are working?

There is a bunch of code that removes headers from the messages. You might just need to add a line for this one too.

Examples:

  // Remove the Return-Path header.
  header = header.replace(/^Return-Path: (.*(?:\r?\n\s+.*)*)\r?\n/mg, '');

  // Remove Sender header.
  header = header.replace(/^Sender: (.*(?:\r?\n\s+.*)*)\r?\n/mg, '');

  // Remove Message-ID header.
  header = header.replace(/^Message-ID: (.*)\r?\n/mig, '');
sashkeer commented 1 year ago

Are there any update on this issue? I found some old docs which highlights that Delivered-To header used to prevent loops in some mailing systems. Not sure how AWS handles this headers but if I filter them will it trigger repeated email sending?