如何解决 spamassassin DKIM 超时请求?
How can I solve spamassassin DKIM timeout request?
我有一个邮件服务器 运行s CentOS 7,带有 Exim + Dovecot + Spamassassin v3.4.0 和 VestaCP。
一切正常,除了 spamassassin 检查时间过长。需要 10-11 秒。
在 spamassassin 调试日志中,我看到 DKIM 记录的 DNS 查询问题(第 1 条日志行),它以 10 秒超时(第 3 条日志行)终止。它没有通过 DKIM 测试。
Sun Jul 14 14:47:12 2019 [94687] dbg: dkim: performing public key lookup and signature verification
Sun Jul 14 14:47:22 2019 [94687] dbg: dkim: DKIM, i=@yandex.ru, d=yandex.ru, s=mail, a=rsa-sha256, c=relaxed/relaxed, invalid, matches author domain
Sun Jul 14 14:47:22 2019 [94687] dbg: dkim: signature verification result: INVALID (PUBLIC KEY: DNS QUERY TIMEOUT FOR MAIL._DOMAINKEY.YANDEX.RU)
Sun Jul 14 14:47:22 2019 [94687] dbg: dkim: adsp: performing lookup on _adsp._domainkey.yandex.ru
Sun Jul 14 14:47:22 2019 [94687] dbg: dkim: adsp result: U/unknown (dns: unknown), author domain 'yandex.ru'
Sun Jul 14 14:47:22 2019 [94687] dbg: spf: checking to see if the message has a Received-SPF header that we can use
Sun Jul 14 14:47:22 2019 [94687] dbg: spf: checking HELO (helo=forward400j.mail.yandex.net, ip=5.45.198.245)
Sun Jul 14 14:47:22 2019 [94687] dbg: dns: bgsend, DNS servers: [8.8.8.8]:53, [8.8.4.4]:53
Sun Jul 14 14:47:22 2019 [94687] dbg: dns: attempt 1/2, trying connect/sendto to [8.8.8.8]:53
Sun Jul 14 14:47:22 2019 [94687] dbg: dns: providing a callback for id: 49973/IN/SPF/forward400j.mail.yandex.net
Sun Jul 14 14:47:22 2019 [94687] dbg: dns: dns reply 690 is OK, 4 answer records
Sun Jul 14 14:47:22 2019 [94687] dbg: async: calling callback on key dns:A:yandex.ru
Sun Jul 14 14:47:22 2019 [94687] dbg: dns: hit <dns:yandex.ru> 5.255.255.5
Sun Jul 14 14:47:22 2019 [94687] dbg: dns: hit <dns:yandex.ru> 77.88.55.50
Sun Jul 14 14:47:22 2019 [94687] dbg: dns: hit <dns:yandex.ru> 77.88.55.88
Sun Jul 14 14:47:22 2019 [94687] dbg: dns: hit <dns:yandex.ru> 5.255.255.88
如果我 运行 通过 spamassassin -t -D dkim
在同一封电子邮件 进行特殊检查,那么一切都很快,并且 DKIM 通过了测试。
# spamassassin -t -D dkim < /home/admin/mail/domain/user/cur/messageId
Jul 14 20:46:49.922 [24398] dbg: dkim: using Mail::DKIM version 0.39
Jul 14 20:46:49.923 [24398] dbg: dkim: performing public key lookup and signature verification
Jul 14 20:46:49.962 [24398] dbg: dkim: DKIM, i=@yandex.ru, d=yandex.ru, s=mail, a=rsa-sha256, c=relaxed/relaxed, pass, matches author domain
Jul 14 20:46:49.962 [24398] dbg: dkim: signature verification result: PASS
我该如何解决这个问题?
通过安装本地 DNS 解析器而不是使用 Google DNS 解决了这个问题。
我有一个邮件服务器 运行s CentOS 7,带有 Exim + Dovecot + Spamassassin v3.4.0 和 VestaCP。 一切正常,除了 spamassassin 检查时间过长。需要 10-11 秒。
在 spamassassin 调试日志中,我看到 DKIM 记录的 DNS 查询问题(第 1 条日志行),它以 10 秒超时(第 3 条日志行)终止。它没有通过 DKIM 测试。
Sun Jul 14 14:47:12 2019 [94687] dbg: dkim: performing public key lookup and signature verification
Sun Jul 14 14:47:22 2019 [94687] dbg: dkim: DKIM, i=@yandex.ru, d=yandex.ru, s=mail, a=rsa-sha256, c=relaxed/relaxed, invalid, matches author domain
Sun Jul 14 14:47:22 2019 [94687] dbg: dkim: signature verification result: INVALID (PUBLIC KEY: DNS QUERY TIMEOUT FOR MAIL._DOMAINKEY.YANDEX.RU)
Sun Jul 14 14:47:22 2019 [94687] dbg: dkim: adsp: performing lookup on _adsp._domainkey.yandex.ru
Sun Jul 14 14:47:22 2019 [94687] dbg: dkim: adsp result: U/unknown (dns: unknown), author domain 'yandex.ru'
Sun Jul 14 14:47:22 2019 [94687] dbg: spf: checking to see if the message has a Received-SPF header that we can use
Sun Jul 14 14:47:22 2019 [94687] dbg: spf: checking HELO (helo=forward400j.mail.yandex.net, ip=5.45.198.245)
Sun Jul 14 14:47:22 2019 [94687] dbg: dns: bgsend, DNS servers: [8.8.8.8]:53, [8.8.4.4]:53
Sun Jul 14 14:47:22 2019 [94687] dbg: dns: attempt 1/2, trying connect/sendto to [8.8.8.8]:53
Sun Jul 14 14:47:22 2019 [94687] dbg: dns: providing a callback for id: 49973/IN/SPF/forward400j.mail.yandex.net
Sun Jul 14 14:47:22 2019 [94687] dbg: dns: dns reply 690 is OK, 4 answer records
Sun Jul 14 14:47:22 2019 [94687] dbg: async: calling callback on key dns:A:yandex.ru
Sun Jul 14 14:47:22 2019 [94687] dbg: dns: hit <dns:yandex.ru> 5.255.255.5
Sun Jul 14 14:47:22 2019 [94687] dbg: dns: hit <dns:yandex.ru> 77.88.55.50
Sun Jul 14 14:47:22 2019 [94687] dbg: dns: hit <dns:yandex.ru> 77.88.55.88
Sun Jul 14 14:47:22 2019 [94687] dbg: dns: hit <dns:yandex.ru> 5.255.255.88
如果我 运行 通过 spamassassin -t -D dkim
在同一封电子邮件 进行特殊检查,那么一切都很快,并且 DKIM 通过了测试。
# spamassassin -t -D dkim < /home/admin/mail/domain/user/cur/messageId
Jul 14 20:46:49.922 [24398] dbg: dkim: using Mail::DKIM version 0.39
Jul 14 20:46:49.923 [24398] dbg: dkim: performing public key lookup and signature verification
Jul 14 20:46:49.962 [24398] dbg: dkim: DKIM, i=@yandex.ru, d=yandex.ru, s=mail, a=rsa-sha256, c=relaxed/relaxed, pass, matches author domain
Jul 14 20:46:49.962 [24398] dbg: dkim: signature verification result: PASS
我该如何解决这个问题?
通过安装本地 DNS 解析器而不是使用 Google DNS 解决了这个问题。