我目前有一个工作邮件服务器,带有 Postfix 和 Dovecot,在 mySQL 中有虚拟邮箱。但是,我在将 Sendgrid 设置为中继主机时遇到问题。
如前所述,身份验证按如下方式完成:
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
我也使用 TLS 并且证书被正确指向。
现在,当我按照 Sendgrid 的指南进行操作时:
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = static:yourSendGridUsername:yourSendGridPassword
smtp_sasl_security_options = noanonymous
smtp_tls_security_level = encrypt
header_size_limit = 4096000
relayhost = [smtp.sendgrid.net]:587
(用户名和密码已更改),我不太确定身份验证是如何完成的。它根本不起作用,因为我从 Sendgrid 收到一条错误消息:
“550 无法从指定地址接收:不允许未经身份验证的发件人(回复 MAIL FROM 命令)”
如果我删除 Dovecot 部分,显然电子邮件一开始就无法发送,因为它不允许连接到邮件服务器。
有什么想法吗?