V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
Explorare
V2EX  ›  问与答

如何配置 Yandex 的 DKIM signature?

  •  
  •   Explorare · 2017-03-07 15:49:50 +08:00 · 5601 次点击
    这是一个创建于 2579 天前的主题,其中的信息可能已经有所发展或是发生改变。

    最近在 V2er 的推荐下把域名邮箱从 Mailgun 迁移到了 Yandex ,过程很顺利, Yandex Mail 的 Web 界面挺不错,支持 SMTP/IMAP 方式接入,我在 Outlook Web 中接入了 Yandex ,可以同步邮件并且通过 Yandex 发送邮件,很方便。

    这里贴上邮箱测试结果:

    https://www.mail-tester.com/web-uxxpq

    已添加 SPF/DKIM 记录,但不知道如何在发件时使用 DKIM 签名。

    测试邮件是用 Outlook 2016 发的,直接用 SMTP 方式登录 Yandex mail server 发的,不是通过 Outlook 中转。但似乎发出的邮件并没有附上 DKIM signature 。

    所以如何正确的部署 DKIM 呢?求教

    @ clanned

    感谢大家的帮助

    附上相关资料

    15 条回复    2017-03-09 00:49:35 +08:00
    sunorg
        1
    sunorg  
       2017-03-07 16:13:19 +08:00
    DKIM ,,,, 你自己安装了邮局吗?

    不让 dkim 信息应该是 yandex 提供给你的
    Explorare
        2
    Explorare  
    OP
       2017-03-07 16:24:50 +08:00
    @sunorg DKIM 私钥 应该在 Yandex 伺服器上,按照它给的教程,只要在 DNS record 上加上 DKIM 公钥信息就行了。然而实际上从 Yandex 服务器发出的邮件并没有被签名。
    clanned
        3
    clanned  
       2017-03-07 17:13:40 +08:00
    @Explorare 按我的理解, yandex 在邮件发送出去时会用它服务器上的私钥签名添加 "DKIM-Signature" 头信息的,这个与配置还是没配置 dns 无关,配置了 dns 是为了收件人校验签名的。但是你这个测试里没有看到 "DKIM-Signature"。我已經发送了一份邮件给你,你可以回复下我检查下 raw mail 。
    clanned
        4
    clanned  
       2017-03-07 17:32:57 +08:00
    @Explorare 另外如果你需要 imap.example.com smtp.example.com pop.example.com 这样的域名中转来方便客户端配置的话,可以用 stunnel 做一个类似 nginx 反向代理的配置

    https://gist.github.com/xdtianyu/df7cdd6dce957f03fec6a25ba7d48109

    其中 /etc/stunnel/certs/sni.pem 是 lets-encrypt 签名证书和密钥的合并,即类似 "cat domain.chained.cert domain.key > domain.pem"
    Explorare
        5
    Explorare  
    OP
       2017-03-07 18:41:55 +08:00
    @clanned 我的域名 root 直接 CNAME 到了 Github Page ,然后在
    https://hencolle.com/Autoconfig/Autoconfig.xml
    配置了 redirect 到 yandex.com 。然而似乎不好使。这里贴上测试结果
    https://gist.github.com/Explorare/f8d539b8ef9e9714fde86200b1df11cf
    https://testconnectivity.microsoft.com/ 生成。
    clanned
        6
    clanned  
       2017-03-07 18:50:11 +08:00 via Android
    @Explorare autodiscovery ?你可以在 outlook 试试输入我的邮箱看看好不好使 [email protected] 换成我的域名,密码随便输看会不会变成 imap.yandex 之类的。 https://gist.github.com/xdtianyu/5f24c1038d4dc3d731b7361389c8e183 , Android 这边不支持 autodiscovery ,所以我弃用了,替代用 stunnel 中转, outlook 要是可以用的话我一会把 php 脚本和 Nginx 配置贴给你
    Explorare
        7
    Explorare  
    OP
       2017-03-07 18:54:20 +08:00
    @clanned 会变成 imap.yandex.com 。我现在是希望不依托一个在线的 Web server 来实现跳转,通过静态配置文件来实现。不过还请发一份脚本吧,等闲下了再折腾 VPS 。谢谢了。
    clanned
        8
    clanned  
       2017-03-07 18:59:06 +08:00 via Android
    @Explorare 这个 autodiscover 好像需要动态返回邮箱地址的。不依托 web 服务的话,也有一种修改 dns srv 记录的方式,不知道 outlook 支持吗, Android 是不支持。可以参考这里 http://serverfault.com/questions/698674/email-autodiscovery-not-being-probed-by-android
    Explorare
        9
    Explorare  
    OP
       2017-03-07 19:02:41 +08:00
    @clanned 唔,搞不懂了。
    clanned
        10
    clanned  
       2017-03-07 19:49:04 +08:00   ❤️ 1
    GoldenPillow
        11
    GoldenPillow  
       2017-03-07 20:08:19 +08:00   ❤️ 1
    txt 记录设置好就可以了 不过所有的邮箱服务器收到你的 txt 记录可能需要一段时间,中间也会出现一会有 dkim 一会又没有 dkim 的情况

    我之前也问过这个问题
    https://www.v2ex.com/t/337996#reply8
    qiang2k
        12
    qiang2k  
       2017-03-08 16:20:19 +08:00
    @Explorare 请问一下你注册 yandex 域名邮箱是否一定要把 dns 转到 yandex 去吗?为啥我加一个域名第一步之前就要我转 DNS ,另外 DKIM 我在 zoho 搞了好久也是验证不了,域名挂在 namecheap.

    Delegate your domain to Yandex
    Change your DNS servers (this procedure is performed using the tools of the domain registrar or hosting provider from which you purchased the domain):
    Primary DNS server: dns1.yandex.net
    Secondary DNS server: dns2.yandex.net
    ----------------------------------
    Step 1. Verify domain ownership
    We have created these detailed instructions which will help you get this done.
    Upload a file with the name a8a6d92b1c92.html and text a9c42a117814 to your site's root directory

    or
    Explorare
        13
    Explorare  
    OP
       2017-03-08 16:28:58 +08:00
    @qiang2k 不需要转域名过去。我 NS 是 CloudFlare 的,第一步需要认证域名所有权,可以在 NS 上添加一条 TXT record 完成认证,很方便。
    qiang2k
        14
    qiang2k  
       2017-03-08 23:27:35 +08:00 via Android
    @Explorare 谢谢
    Explorare
        15
    Explorare  
    OP
       2017-03-09 00:49:35 +08:00
    @GoldenPillow
    @clanned
    刚才测试发现 DKIM 已经生效了,多谢大家的帮助。
    https://www.mail-tester.com/web-g2nnv
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2873 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 11:25 · PVG 19:25 · LAX 04:25 · JFK 07:25
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.