我已遵循所有指令,并添加了4 CNAME, 1 TXT Record, 1 Custom MX
。之后,我安装了aws workmail,并且可以在激活帐户后将电子邮件发送给任何人,它不在沙盒中。当其他人将电子邮件发送到工作邮件(答复我们发送的电子邮件)时,该电子邮件将永远不会到达,并且在gmail中,我们没有收到未收到的错误电子邮件。
这些是您将要采取的一般步骤:
1)您必须在SES中验证您的域
2)在NameCheap上创建一个mx记录(要使用的值在上面的链接中):
3)创建一个s3存储桶以存储具有上面链接中列出的策略的电子邮件
4)在SES中创建规则集以将电子邮件保存到存储桶(在左侧菜单中的Email Receiving
下)
5)创建lambda函数来转发电子邮件。与上面的文章不同,我在这里使用了Node。我的解决方案基于此:https://github.com/arithmetric/aws-lambda-ses-forwarder。这是我的package.json:
{
"name": "aws-lambda-ses-forwarder-example",
"version": "1.0.0",
"description": "Example implementation of aws-lambda-ses-forwarder.",
"main": "index.js",
"dependencies": {
"aws-lambda-ses-forwarder": "^3.0.0"
}
}
这在我的index.js中:
var LambdaForwarder = require("aws-lambda-ses-forwarder");
exports.handler = function(event, context) {
// Configure the S3 bucket and key prefix for stored raw emails, and the
// mapping of email addresses to forward from and to.
//
// Expected keys/values:
// - fromEmail: Forwarded emails will come from this verified address
// - emailBucket: S3 bucket name where SES stores emails.
// - emailKeyPrefix: S3 key name prefix where SES stores email. Include the
// trailing slash.
// - forwardMapping: Object where the key is the email address from which to
// forward and the value is an array of email addresses to which to send the
// message.
var overrides = {
config: {
fromEmail: "", // Email address using your domain
subjectPrefix: "",
emailBucket: "", // S3 email bucket name
emailKeyPrefix: "emails/", // Replace with "Object key prefix" set in SES and add a forward slash
forwardMapping: {
"@domain.com": [ // Use your domain here
"[email protected]" // email to forward to
],
"@domain2.com": [ // you can add more domains to forward from (explained below *)
"[email protected]"
],
}
}
};
LambdaForwarder.handler(event, context, overrides);
};
您可以使用它转发来自多个域的电子邮件。假设您有2个名称便宜的域。对每个域执行步骤1和2。然后,只要您同时拥有两个域作为“ forwardMapping”的属性,它们都将被转发给您。所有电子邮件都将从“ fromEmail”中列出的电子邮件发送,而不管其域是什么。
index.handler