简体   繁体   English

多条线路上的 DKIM

[英]DKIM on multiple lines

I have now used 4(!) days trying to get this DKIM TXT record to get recognized, so I really hope that someone is able to help me out now..我现在已经用了 4(!) 天试图让这个 DKIM TXT 记录获得认可,所以我真的希望现在有人能够帮助我..

The DKIM I have from my server is output on three lines like this:我从服务器获得的 DKIM 在三行中输出,如下所示:

default._domainkey IN TXT "v=DKIM1; k=rsa;

p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ7AMIIBCgKCAQEAvbBZcUcajRf+nP+BSvhsa8roEcor2rf9oLs98u8HrqjZgpHQJ4frbA2C8OuRlPGN9JzZOpTmeeJg2eITeJXlQsc88xX0hqZCogDUeUcTLghDhw2Vd7q5AWG6mDcc3F2HJ0q5GwkYTS7d6D9nXCGcCE/M/F2pgwBe5MI5S9h60cr+XhHrK3uDCW3QNMj6jRDIW"

    3o5WquA5/MmQJJ38BwMzn/7HJwcL5aJ5EnA3KlLi413kK820f4h2E+u4dAT5Kmua7x8Lx1ny7oEZH/MBQoEMq0s7XuDD+d0gR/0VCHvQ6PhZf4wOwzGIO6jn/Fb/pywAgQqZRglRGZLbcoHHQCIgQIDAQAB\;

I have tried to add it in numerous different ways, but every time I get some kind of error.我尝试以多种不同的方式添加它,但每次都会出现某种错误。 Also, it seems like my DNS is changing the order of the entries I make.此外,似乎我的 DNS 正在更改我所做的条目的顺序。 Could this be the error?这可能是错误吗?

错误的顺序

Any kind of help is really, really appreciated.. Please.任何形式的帮助都非常非常感谢..请。 Thanks!谢谢!

I wanted to comment on Ryan Young answer but I don't have enough reputation for that.我想对 Ryan Young 的回答发表评论,但我对此没有足够的声誉。

This answer is correct except that the second line of the DKIM key needs to also be in the p value in the DNS TXT entry like that:这个答案是正确的,除了 DKIM 密钥的第二行也需要在 DNS TXT 条目中的 p 值中,如下所示:

v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ7AMIIBCgKCAQEAvbBZcUcajRf+nP+BSvhsa8roEcor2rf9oLs98u8HrqjZgpHQJ4frbA2C8OuRlPGN9JzZOpTmeeJg2eITeJXlQsc88xX0hqZCogDUeUcTLghDhw2Vd7q5AWG6mDcc3F2HJ0q5GwkYTS7d6D9nXCGcCE/M/F2pgwBe5MI5S9h60cr+XhHrK3uDCW3QNMj6jRDIW3o5WquA5/MmQJJ38BwMzn/7HJwcL5aJ5EnA3KlLi413kK820f4h2E+u4dAT5Kmua7x8Lx1ny7oEZH/MBQoEMq0s7XuDD+d0gR/0VCHvQ6PhZf4wOwzGIO6jn/Fb/pywAgQqZRglRGZLbcoHHQCIgQIDAQAB

All the DKIM p entries for my domains typically start with "MI" and end with "IDAQAB".我的域的所有 DKIM p 条目通常以“MI”开头并以“IDAQAB”结尾。 You may need to remove from them the spaces/tabs, line feeds/returns and double/single quotes if they are on several lines.如果空格/制表符、换行符/回车符和双引号/单引号位于多行上,则您可能需要从中删除它们。

Edit: I found out that using the long 2048 DKIM key lead to the following in the original email on gmail:编辑:我发现使用长 2048 DKIM 密钥会导致 gmail 原始电子邮件中的以下内容:

dkim=neutral (invalid public key) header.i=...

This was probably because the key was being truncated anyway.这可能是因为无论如何密钥都被截断了。 What I had to do to get a normal situation was to reduce the size of the DKIM key when generating the key:为了得到正常情况,我必须做的是在生成密钥时减小 DKIM 密钥的大小:

opendkim-genkey -b 1024 -s mail -d example.com

My emails then viewed as original in gmail contain this instead of the invalid key mention:然后我的电子邮件在 gmail 中被视为原始邮件包含这个而不是无效的关键提及:

dkim=pass header.i=...

I just dealt with similar issues trying to set up DKIM authentication for a domain registered with Register.com that uses Google email servers.我刚刚处理了类似的问题,试图为使用 Google 电子邮件服务器的 Register.com 注册的域设置 DKIM 身份验证。 According to Google help docs , DNS TXT records can contain no more than 255 characters in a single string, but the DKIM TXT record value that Google generated for us was over 400 characters.根据Google 帮助文档,DNS TXT 记录在单个字符串中最多可包含 255 个字符,但 Google 为我们生成的 DKIM TXT 记录值超过 400 个字符。 In our case, the solution was to split that DKIM TXT record into two parts where each part is under 255 characters, surrounding each part with double quotes and entering both into the same TXT record separated by a space.在我们的例子中,解决方案是将该 DKIM TXT 记录分成两部分,每部分都在 255 个字符以下,用双引号将每个部分括起来,并将两者输入到由空格分隔的相同 TXT 记录中。 I did not need to include any parentheses or slashes but that may vary by email provider.我不需要包含任何括号或斜杠,但这可能因电子邮件提供商而异。 So for my email provider and domain host the solution looked like this:因此,对于我的电子邮件提供商和域名托管服务商,解决方案如下所示:

Host Name: google._domainkey
TXT Record: "v=DKIM1; k=rsa; p=blahblahblahblahblahetc" "blahblahblahblahblahetc"

G Suite warned me that it might take up to 48 hours for my DNS record updates to propagate but once I landed on the right solution it was less than an hour before Gmail was able to start authenticating. G Suite 警告我,我的 DNS 记录更新可能需要长达 48 小时才能传播,但是一旦我找到了正确的解决方案,Gmail 就可以开始进行身份验证了不到一个小时。

I had issues getting my domain key to pass verification.我在获取域密钥以通过验证时遇到问题。 In the end I changed my selector to "dkim" in opendkim on my Linux server.最后,我在 Linux 服务器上的 opendkim 中将选择器更改为“dkim”。 As for your Text portion, make it:至于你的文本部分,让它:

v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ7AMIIBCgKCAQEAvbBZcUcajRf+nP+BSvhsa8roEcor2rf9oLs98u8HrqjZgpHQJ4frbA2C8OuRlPGN9JzZOpTmeeJg2eITeJXlQsc88xX0hqZCogDUeUcTLghDhw2Vd7q5AWG6mDcc3F2HJ0q5GwkYTS7d6D9nXCGcCE/M/F2pgwBe5MI5S9h60cr+XhHrK3uDCW3QNMj6jRDIW

So it should be all on one line and in the same record.所以它应该都在一行上并在同一个记录中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM