我试图设置我们的networking服务器,以便它可以发送来自各种networking应用程序的电子邮件重置密码等。我们的邮件由Gmail与自定义域,例如。 mydomain.com 。
现在,电子邮件到各个域只是坐在邮件队列。 发送到[email protected]任何内容都不会进入队列。
如何通过Gmail路由SMTP服务器?
This is what I've added to `/etc/postfix/main.cf` relayhost = smtp.mydomain.com:587 smtp_tls_security_level = verified smtp_tls_mandatory_protocols = TLSv1 smtp_tls_mandatory_ciphers = high smtp_tls_secure_cert_match = nexthop smtp_tls_CAfile = /etc/pki/tls/certs/ca-bundle.crt smtp_sasl_auth_enable = yes smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd smtp_sasl_security_options = noanonymous
如果relayhost设置为smpt.gmail.com ? 我需要更改DNS吗?
如果你想让所有的电子邮件都通过Gmail发送,你必须设置relayhost为smtp.gmail.com:587。
虽然这还不够。
您需要创build和编辑文件/ etc / postfix / sasl_passwd在其中写入如下所示的行:
smtp.gmail.com:587 [email protected]:password
哪里:
是您的Gmail托pipe域中的有效用户名,以及通过您的邮件服务器路由的所有电子邮件的发件人。
完成后,创build散列版本。 跑:
postmap /etc/postfix/sasl_passwd
并重新启动后缀。