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

SPF settings for a domain added to gmail

· 52CE 我爱测

I have a domain on my host which I've added to Gmail. It has the following SPF record, "v=spf1 a ~all" All emails that I send from Gmail are correctly verified and have the following header, spf=pass (google.com: domain of [email…

问题原文

原帖链接 · Vinith Almeida · CC BY-SA 3.0

I have a domain on my host which I've added to Gmail. It has the following SPF record,

"v=spf1 a ~all"

All emails that I send from Gmail are correctly verified and have the following header,

spf=pass (google.com: domain of [email omitted] designates 123.456.789.10 as permitted sender).

I'm wondering how did that happen since I haven't added any Gmail IP to the record? Is it not necessary?

EDIT: The IP 123.456.789.10 in the message source is of my host. I always thought that since I've added the domain to gmail, it is gmail that sends the email. How does this actually work?

Thanks!

已采纳解答

原帖链接 · Esa Jokinen · CC BY-SA 3.0

You are correct: this SPF wouldn't pass, if it was sent from Gmail. To allow Gmail you should have

"v=spf1 include:_spf.google.com +a ~all"

which includes all Google netblocks, i.e.

include:_netblocks.google.com include:_netblocks2.google.com include:_netblocks3.google.com

If you see your IP there, the mail was sent from that host. It's completely normal that your server by default uses local SMTP server for delivery; settings your incoming MX records to Gmail doesn't automatically reconfigure your outgoing mail settings. However it's fine to have several sources as long as you list them all in your SPF record. (You may also need different DKIM selectors.)

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

资料来源与适用范围

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

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

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