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

OpenDKIM generates 2 keys

· 52CE 我爱测

I've followed instructions to set up spf and DKIM on my mailing server. SPF is working fine so far, however I am having problem with DKIM. In every single instruction website, they show the output after generating the key would b…

问题原文

原帖链接 · b0xed · CC BY-SA 4.0

I've followed instructions to set up spf and DKIM on my mailing server. SPF is working fine so far, however I am having problem with DKIM. In every single instruction website, they show the output after generating the key would be a single key. However, it generates 2 keys for me - not exactly 2, I would say one and a half(!). Here is the output on mail.txt -

mail._domainkey IN TXT ( "v=DKIM1; h=sha256; k=rsa; " "p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAt+aTMFobW7/VoT+36RJZOQ0cLtr4PxsWT0DHhRreE6a2IuXIOktviQkkXtLb2NXn5gjAZfPscss11Vr+kLFWM2OWF+B1qFpBB8J9zg6L8vjdkzIt5mt1oPOkFg7CcCEhU8dnbRpps00xsu4aVNuda7yr0+4sCwcTsObuESSQ3hYFWl33+OVTqiYAPqykX/mADvLYVxQF9UUJlO" "M+Vx8siFcENppNrqrbkSkhPfaNWYSqoXT9ZvFzHYOzcLqfx5HeJn3E7tAP6VDKKpoQjvUifQDp+oE0x9BgFdP63e7mxIZH1e78c4p8NTnZ8RAO4DQOFgCSn61Anm4OHspYJNpA0wIDAQAB" ) ; ----- DKIM key mail for mydomainname.com

I've copied the first part to my dns -

v=DKIM1; h=sha256; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAt+aTMFobW7/VoT+36RJZOQ0cLtr4PxsWT0DHhRreE6a2IuXIOktviQkkXtLb2NXn5gjAZfPscss11Vr+kLFWM2OWF+B1qFpBB8J9zg6L8vjdkzIt5mt1oPOkFg7CcCEhU8dnbRpps00xsu4aVNuda7yr0+4sCwcTsObuESSQ3hYFWl33+OVTqiYAPqykX/mADvLYVxQF9UUJlO

which seems not to be working. Gmail shows(gmail received an email sent from this server, sent to spam)

dkim=neutral (invalid public key) header.i=@mydomain.com header.s=mail header.b=chWKWyaM;

How do I deal with this 2 (one and a half) output and add it to DNS? I tried merging them - same result. Tried regenerating, get 2 everytime.

Thanks in advance

已采纳解答

原帖链接 · Mikael H · CC BY-SA 4.0

You've built a 2048 bit key which won't fit in a standard TXT record. Have the DNS concatenate the two strings for you by entering them as follows:
TXT ( "first part" "second part" )
or
TXT "first part" \ "second part"

If your DNS provider doesn't support long keys (a problem I encountered about a year ago with one provider), you can create a shorter key by adding the parameter -b 1024 to your opendkim-genkey command.

Do not create shorter keys than 1024 bits.

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

资料来源与适用范围

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

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

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