Gmail垃圾邮件问题 - 如何正确设置DKIM& DMARC
我创建了一个自动脚本,该脚本在PHP中使用phpmailer
生成自定义HTML电子邮件,并将其从我的自定义域电子邮件帐户发送给任何收件人。
这些电子邮件都经过了试金石的测试和完美渲染,没有任何评论,似乎没有垃圾的字符串,都不错。我的域名也没有在任何黑名单等上
。
那时我回到了托管服务,他们建议我在电子邮件域的DNS区域中创建一个SPF记录。
这大大提高了我的电子邮件的非垃圾邮件交付率。
尽管如此,一些客户仍在垃圾文件夹中收到我们公司的电子邮件。我使用酸上的电子邮件进行了垃圾邮件测试,并通过了所有测试,包括SPF-记录验证等。 猜猜唯一出现的警告是,对于Outlook.com和gmail.com,这些电子邮件最终落入了垃圾邮件文件夹(不知道为什么),这显然是一个大问题。
的确,仍然唯一仍然抱怨垃圾邮件问题的客户确实是Gmail用户。
然后,我遇到这篇非常有趣的文章,并了解到Google建议将所有内容设置为SPF,DKIM和DMARC。
我首先包括包括:_spf.google.com
我的SPF记录中的一部分,但是当涉及到DKIM时,我被困了。
如果要有一个工作的DKIM - 在您的域DNS中注册,我实际上需要一个Google Workspace帐户,我感到困惑吗?因为显然您只能在该工作空间帐户中创建一个DKIM密钥,我担心这可能会在我的14个审判工作空间帐户后期到期,并进一步损害我的电子邮件域名声誉,而不是实际改善它。
还是我误解了事情,还有一个不同的解决方案可以为像Gmail这样的给定邮件客户端设置DKIM(然后是DMARC)?我之所以问,是因为我在设置DKIM方面没有任何经验。
I've created an automated script that generates a custom HTML email using PHPMailer
within PHP and sends it, from my custom domain email account, to whatever recipient.
The emails are all litmus tested and render perfectly in all clients, hold no comments whatsoever, no strings that seem to be spammy, all good. My domain is also not on any blacklist, etc.
The e-mails first pretty much dropped into the spam for every recipient.
I went back to my hosting service then, and they recommended me to create an SPF - record in the DNS zone of the domain of my e-mail.
This drastically improved the non-spam delivery rate of my emails.
Still, some clients still receive the emails of our company in their junk folder. I ran a spam-test using email on ACID, and all tests were passed, including SPF - record verifications, etc.
The only warnings that showed up were, guess what, that for outlook.com and gmail.com, the emails eventually drop into the spam folder (without telling why) which is obviously a big problem.
And indeed, the only clients still complaining about the spam troubles are indeed gmail users, mainly.
I then came across this very interesting post, and learned that google recommends the setup of all, SPF, DKIM and DMARC.
I first of all included the include:_spf.google.com
part in my SPF record, but when it comes to DKIM, I'm stuck.
I'm confused if, to have a working DKIM - register within the DNS of your domain, you actually need to have a Google Workspace account? Because apparently you can only create a DKIM Key within that Workspace account, and I'm worried that this will may expire after my 14-trial period of the Workspace account, and rather further damage my email domain reputation instead of actually improving it.
Or am I misunderstanding things, and there's a different solution to setup a DKIM (and then also DMARC) for a given mail client like gmail for a domain? I'm asking because I have no experience whatsoever in setting up DKIM.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
要通过管理控制台设置 DKIM,您肯定需要拥有 Google Workspace帐户。使用Cloud Identity 免费订阅将不起作用,因为您将无权访问Gmail 等服务。
要简单地从管理控制台生成密钥,您需要具有 Gmail 访问权限的正确订阅,该订阅仅在 Google Workspace 订阅中可用。
它很可能会在您的订阅到期后停止工作,因为它是从生成它的 Google Workspace 帐号链接到管理控制台的,一旦订阅暂停,一切都会停止工作。
In order to set up DKIM from the Admin console you definitely need to have a Google Workspace account. Using a Cloud Identity free subscription would not work as you are not going to have access to services like Gmail.
To simply generate the key from the Admin console you need the right subscription with access to Gmail, which is only available in Google Workspace subscriptions.
It will most likely stop working after your subscription expires since it is linked to the Admin console from the Google Workspace account where it was generated and once the subscription gets suspended everything stops working.
DKIM的原则是您(通过DNS)发布了一个Cryptograpjic密钥的一半,然后使用另一个(秘密,私人)半部来创建并在您发送的邮件的标题中提供签名。这不是静态字符串;它是该消息的其他一些标题的哈希。
接收邮件服务器进行密码检查,以查看这两个部分是否匹配。 (注意:这是该过程的极大简化视图)。
使用Google Workspace设置DKIM意味着您将DNS和Workspace中的特定密钥放置在知道如何创建相应的签名中。
因此,即使拥有工作空间帐户并设置DKIM也无法解决您的问题,因为您的phpmailer脚本也不会生成DKIM签名,即使它确实如此,也不会使用秘密的私钥。
您应该拥有 phpmailer do dkim 位。
Google和Microsoft在合规性上变得更加严格;首先是SPF,现在是DKIM从合法邮件中对垃圾邮件进行分类。
另一种路线可能是设置邮件服务器(而不是Google),实现DKIM并将其用作SMTP网关。
SPF上的注释:如果您已正确设置了邮件,并且您的脚本从另一个域和/或IP地址发送电子邮件,您仍然会出现故障。您需要包含(作为IP地址或域名)所有邮件的所有来源。因此,SPF记录可以持有多个来源。
最后指针:设置dmarc 要有邮件服务器向您发送成功的报告和在他们家门口的交货失败。
The principle of DKIM is that you publish (via DNS) one half of a cryptograpjic key and you use another (secret, private) half to create and provide a signature in the headers of the mail you send out. This is not a static string; it is a hash of some of the other headers of that message.
Receiving mail servers do a cryptographic check to see if the two halves match. (note: this is a greatly simplified view of the process).
Setting up DKIM with Google Workspace means that you place a specific key in your DNS and Workspace knows how to create the corresponding signatures.
Therefore, even having a Workspace account and setting up DKIM will not solve your problem, because your PHPMailer script will not generate DKIM signatures and even if it did, it would not use the secret private key.
You should have PHPMailer do the DKIM bit.
Google and Microsoft have been getting a lot more strict on compliance; first SPF and now DKIM to sort the spam from the legitimate mail.
An alternative route might be to set up a mail server (not Google's), implement DKIM and use that as an SMTP gateway.
A note on SPF: if you have mail properly set up and you have scripts send email from another domain and/or IP address, you will still get failures. You need to include (either as IP address or domain name) all the sources of your outgoing mail. SPF records can hold multiple sources for this reason.
Last pointer: set up DMARC to have mail servers send you reports of succes and failure of delivery at their doorstep.