我有一个小程序,旨在检查这三个邮件记录的存在以防止欺骗。它似乎可以在特定的域上工作,但是它们似乎是根据具体情况进行设置的。
我的问题是检查这些记录的更可靠的方法是什么。
代码在这里:
https://gist.github.com/amlwwalker/f445932d2fdb0f9f9a5e457c1894bf7d
例子:
Ryanair.com:
result: v=spf1 a mx include:mail1.ryanair.com include:mail2.ryanair.com ~all
err: lookup _dmarc.ryanair.com on 172.16.4.1:53: no such host
err: lookup dkim._domainkey.ryanair.com on 172.16.4.1:53: no such host
Ryanair电子邮件 header :
Authentication-Results: mx.google.com;
dkim=pass [email protected];
spf=pass (google.com: domain of [email protected] designates 209.235.250.215 as permitted sender) [email protected]
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; s=15below; d=care.ryanair.com; h=MIME-Version:From:To:Date:Subject:Message-ID:Content-Type; [email protected]; bh=MCorT6FfWGOmISJQSzdv4YLmKfg=; b=eXcQvy0odmzIAYy11bfM8OsoiXziin5E1hbWHvxlY6Q+KSpZr6/5OiUZ4EiNoCpNwFrciKB9Yj8G
wmZOZwxQd3PW05+2bnu+8oKMPij/AyAEAi2tJ0TBEZxM7BOsno84L3eZ0BQFZvog6bW9UQE1fJCQ
aoQYXPgsHV6dzWjmHYo=
对我来说,它似乎具有DKIM和SPF。该代码虽然找不到DKIM记录。
marvelapp.com
result: v=spf1 include:mailgun.org include:spf.mandrillapp.com include:spf1 include:mail.zendesk.com include:spf.mail.intercom.io -all
err: lookup _dmarc.marvelapp.com on 172.16.4.1:53: no such host
err: lookup dkim._domainkey.marvelapp.com on 172.16.4.1:53: no such host
Marvelapp电子邮件标题:
Received-SPF: pass (google.com: domain of [email protected] designates 31.193.196.244 as permitted sender) client-ip=31.193.196.244;
Authentication-Results: mx.google.com;
dkim=pass [email protected];
spf=pass (google.com: domain of [email protected] designates 31.193.196.244 as permitted sender) [email protected]
所以我不明白的是,在某些情况下,为什么dkim._domainkey.domain.TLD是找到dkim key 的正确方法,有时却显然不是(谷歌似乎找到了它,但是怎么找到呢? dkim键了吗?
我基本上希望该代码段返回与在Gmail中转到“显示原始邮件”相同的结果
谢谢
最佳答案
DKIM选择器不一定称为dkim
。在Ryanair示例中,选择器是一个相当随机的15below
(来自DKIM签名 header 中的s=
项),因此您需要查找15below._domainkey.ryanair.com
。