Skip to content

massej/ses-email-forwarder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 

Repository files navigation

ses-email-forwarder

Amazon Simple Email Service Forwarder

Serverless Lambda Python Function

To setup the lambda function / AWS SES please read the following guide :
https://aws.amazon.com/fr/blogs/messaging-and-targeting/forward-incoming-email-to-an-external-destination/

*** IMPORTANT : (Only for email file attachment) on your AWS Lambda function you must set a memory configuration of at least 512 MB, otherwise due to file attachment the AWS Lambda function can fail to execute due to "out of memory".

Lambda environment variables configuration

Name Description
AddHeader If we need to add the received header into the email message.

Value must be "True" or "False"

Example :
--------------------------------
From : Tester testemail@domain.com
Date : Tue, 20 Jul 2021 18:10:39 +0000
To : Firstname Lastname email@domain.com
Subject : email subject

Type : boolean.
EmailList JSON email rules list.

The first column is the rules and the second column is where to forward the email.

If there are no rules that matched with the received email then it will use the catch-all address.

Example (JSON string) :

{
"test@": "test@domain.com"
"multiple-recipients@": ["test1@domain.com", "test2@domain.com"]
"catch-all": "example@domain.com"
}

Type : string.
MailFromEmailAddress Email to use when forwarding email.

This parameter is used only when "UseResentHeader" is set to "False"

Type : string.
Region Current lambda function Amazon Region to use.

Type : string.
S3Bucket S3 Bucket where to store the received email.

Type : string.
S3Prefix S3 Prefix (folder) where to store the received email.

Type : string.
UseEMLAttachment If we need to put the forwarded email as an attachment (EML file).
Value must be "True" or "False"
Type : boolean.
UseEMLBase64Format If the email attachment (EML file) needs to be under base64 format.

This parameter is used only when "UseEMLAttachment" is set to "True"

Value must be "True" or "False"

* Take note that the iPhone cannot open EML file is the attachment is under base64 format.

Type : boolean.
UseResentHeader If we need to use Resent headers / parameters in the email.

* Take note that some email software will block email when using this option. (The From field will be a copy of the received email and can cause SPF or DKIM to fail.)

Value must be "True" or "False"

* Recommended value is "False"

Type : boolean.
UseSubjectEMLFilename If we need to use the email subject as the EML file attachment filename.

If false the EML file attachment will be the message id / filename on the S3 bucket.

Value must be "True" or "False"

Type : boolean.

About

Amazon Simple Email Service Forwarder - ses-email-forwarder

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages