大网数据广告活动
服务器运维问答

Add another email in GMail through SMTP server

· 52CE 我爱测

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 …

问题原文

原帖链接 · 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

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-03-29)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。