目标中的未知参数:"ReplyToAddresses",必须是以下之一:ToAddresses、CcAddresses、BccAddresses

Unknown parameter in Destination: "ReplyToAddresses", must be one of: ToAddresses, CcAddresses, BccAddresses

如果我尝试使用 Boto 3 发送带有 SES 的电子邮件,其中 Reply-To header 与电子邮件中的其他 header 不匹配,使用脚本这...

import boto3
client = boto3.client('ses')
client.send_email(
    Destination={
        'ToAddresses': [
            "someone@example.com"
        ],
        'ReplyToAddresses': [
            "someoneelse@example.com"
        ]
    },
    Message={
        'Body': {
            'Text': {
                'Charset': "UTF-8",
                'Data': 'Bla bla bla',
            },
        },
        'Subject': {
            'Charset': "UTF-8",
            'Data': 'Bla bla bla',
        },
    },
    Source="My Company <noreply@example.com>",
)

...然后我收到这样的错误:

Traceback (most recent call last):
  File "/Users/markamery/test.py", line 24, in <module>
    Source="My Company <noreply@shielddx.com>",
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/botocore/client.py", line 320, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/botocore/client.py", line 596, in _make_api_call
    api_params, operation_model, context=request_context)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/botocore/client.py", line 632, in _convert_to_request_dict
    api_params, operation_model)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/botocore/validate.py", line 291, in serialize_to_request
    raise ParamValidationError(report=report.generate_report())
botocore.exceptions.ParamValidationError: Parameter validation failed:
Unknown parameter in Destination: "ReplyToAddresses", must be one of: ToAddresses, CcAddresses, BccAddresses

这对我来说意义不大。我在这里尝试做的似乎是最佳实践(参见 ) and according to https://forums.aws.amazon.com/thread.jspa?threadID=60093&tstart=0,截至 2011 年,您可以在 "Reply-To" header.

导致此错误的原因是什么?自 2011 年那个论坛 post 以来,SES 的规则是否再次更改?我在上面看到的错误是对像我这样的 in the sandbox 帐户的无证限制吗?或者这是一个错误 - 是 Boto 3,在客户端,应用比 AWS API 本身更严格的 ReplyToAddresses 验证?

根据 boto3 docs,您需要将回复地址列表放在 Destinations 参数之外的参数中。我也觉得奇怪。

send_mail(
    ...,
    Destination={...},
    ReplyToAddresses=[
        'someoneelse@example.com',
])