我使用Amazon SES作为邮件传输来运行postfix。 邮件发送正常,但是当我收到邮件,并尝试使用虚拟别名转发它时,我在mailog中得到这个错误:
(Command died with status 1: "/ses/ses-send-email.pl". Command output: Illegal header 'Delivered-To'. )
我看到SES不支持“Delivered-To”标题,所以我怎样才能转发电子邮件? 如果这意味着什么,我已经软启动了,也许关掉它会起作用?
您可以指定prepend_delivered_header = file在转发时禁止插入“Delivered-To”标题。 详细信息请参阅文档 。
我知道这个问题已经有一年了,但是为什么在Postfix处理通过SES传递的时候为什么要使用这个脚本?
如果唯一发送的电子邮件来自已validation的发件人或已validation的域,或者您可以使用sender_dependent_relayhost_maps来仅中继已validation的域和发件人,则可以设置您的中继器。
无论哪种情况,您都需要先为SMTP AUTH设置SASL密码。 我使用/etc/postfix/sasl_password ,它应该遵循以下格式:
email-smtp.us-east-1.amazonaws.com SES-USER:SES-USER-PASSWORD
更新以使用AWS SES控制台中的SMTP主机和相应的SES SMTP用户凭证。 接下来,您需要通过添加以下内容来configuration/etc/postfix/main.cf的SMTP SASL客户端设置:
smtp_sasl_auth_enable = yes smtp_sasl_password_maps = hash:/etc/postfix/sasl_password smtp_sasl_security_options=noanonymous smtp_sasl_mechanism_filter = login
现在运行postmap /etc/postfix/sasl_password ,这是所有设置。 现在,您必须决定是否转发所有内容或只validation发件人/域名。 如果中继一切,那么只需将以下内容添加到main.cf :
relayhost = email-smtp.us-east-1.amazonaws.com
另一方面,如果您只想发送已validation的发件人/域,请将以下内容添加到main.cf :
sender_dependent_relayhost_maps = hash:/etc/postfix/relayhost_maps
然后在/etc/postfix/relayhost_maps添加已validation的发件人/域,格式为:
[email protected] email-smtp.us-east-1.amazonaws.com @example.net email-smtp.us-east-1.amazonaws.com
通过postmap /etc/postfix/relayhost_maps运行该文件,并执行postfix reload ,你应该通过SES发送电子邮件。
或者你可以预先处理转发的消息来重命名所有亚马逊不喜欢的头 。
您可以编辑ses-send-email.pl将非法标题转换为X标题。
在这里查看示例代码: http : //www.evanhoffman.com/evan/2011/08/02/amazon-ses-illegal-headers-with-ses-send-email-pl-followup/
我使用postfix中的header_checks和REPLACE动作如下所示:
/^(Delivered-To:.*)$/ REPLACE X-$1