问题原文
原帖链接 · Cenoc · CC BY-SA 3.0
I've had some luck using Postfix to relay emails sent to my server to multiple GMail accounts, but now I would like to go the other way around.
That is, use the gmail "Add another email as your own" SMTP configuration feature in order to allow me and another user to send emails under the domain associated with the server. I haven't really found a clear answer on how to do this or what the issues with this setup are. Would appreciate any pointers on this.
I am using Debian hosted on Digital Ocean.
已采纳解答
原帖链接 · grumpyoldtechie · CC BY-SA 3.0
If you want to use gmail as a relay for postfix with multiple users the basics are as follows:
Add the following lines to main.cf (all files in /etc/postfix)
relayhost = [smtp.gmail.com]:587
smtp_sasl_auth_enable = yes
smtp_sender_dependent_authentication = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_password_maps = hash:/etc/postfix/sender_relay
smtp_sasl_security_options = noanonymous
smtp_tls_CAfile = /etc/postfix/cacert.pem
smtp_use_tls = yes
Create a file sasl_passwd with the following contents:
[email omitted] [email omitted]:password1
[email omitted] [email omitted]:password2
Create a file sender_relay
[email omitted] [smtp.gmail.com]:587
[email omitted] [smtp.gmail.com]:587
Full details are at Postix SASL README There is a recipe to generate a self signed certificate for smtp_tls_CA_file at Postfix TLS README
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
