【问题标题】:AWS SES with namecheap domain receive mail具有 namecheap 域的 AWS SES 接收邮件
【发布时间】:2020-01-27 06:20:11
【问题描述】:

我已遵循所有说明,添加了4 CNAME, 1 TXT Record, 1 Custom MX。之后我安装了aws workmail,当帐户被激活时,我可以向任何人发送电子邮件,它不在沙箱中。当其他人向工作邮箱发送电子邮件(回复我们发送的电子邮件)时,该电子邮件从未到达并且在 gmail 中我们没有收到未收到的错误电子邮件。

【问题讨论】:

  • 你解决过这个问题吗?
  • 不,我切换到 namecheap 收件箱管理

标签: email amazon-ses amazon-workmail


【解决方案1】:

您可以让它与 S3、SES 和 Lambda 的混合使用。这很复杂。

这是一篇关于如何做到这一点的 AWS 文章:https://aws.amazon.com/blogs/messaging-and-targeting/forward-incoming-email-to-an-external-destination/

这些是您将采取的一般步骤:

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
          "you@example.com" // email to forward to
        ],
        "@domain2.com": [ // you can add more domains to forward from (explained below *)
          "you@example.com"
        ],
      }
    }
  };
  LambdaForwarder.handler(event, context, overrides);
};
  • 您可以使用它来转发来自多个域的电子邮件。假设您有 2 个 namecheap 域。对每个域执行步骤 1 和 2。然后,只要您将两个域都作为“forwardMapping”的属性,它们都会被转发给您。所有电子邮件都将从“fromEmail”中列出的电子邮件发送,无论域如何。

6) 在 lambda 中,将“Handler”值设置为index.handler

【讨论】:

    猜你喜欢
    • 2017-01-30
    • 1970-01-01
    • 1970-01-01
    • 2018-10-06
    • 1970-01-01
    • 2018-09-18
    • 1970-01-01
    • 2014-08-02
    • 2021-10-23
    相关资源
    最近更新 更多