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

Setting up a DKIM DNS record and DKIM SMTP header for outgoing email on a generic SMTP server

· 52CE 我爱测

I would like to set up a DKIM record for outgoing emails from a forums server running on Ubuntu, but need to figure out how to do it. This is a non-standard server (e.g. not Postfix, not SendMail, not Exchange, not a cPanel setti…

问题原文

原帖链接 · Doug Lerner · CC BY-SA 3.0

I would like to set up a DKIM record for outgoing emails from a forums server running on Ubuntu, but need to figure out how to do it. This is a non-standard server (e.g. not Postfix, not SendMail, not Exchange, not a cPanel setting, no PHP is involved, not WordPress). In particular, I'm not using Ubuntu's email system. I'm using the SMTP server in my own forums software.

I am able to modify the server code to add extra email headers as needed, but have been unable to figure out all the pieces required in searching.

From what I've read here and there, I understand I need a public key and a private key, but there are details I don’t understand.

  1. I used a key generator I found in a Google search to generate DKIM public and private keys for the domain. Does it matter which key generator I use to obtain the public and private keys?
  2. I need to add a DKIM header to the outgoing mail headers. I can add headers to my outgoing mails, but I don’t know the format of this header.
  3. I need to add at least one TXT record to the DNS, but I don’t know the format for a DKIM record. In this case a sub-domain will be sending the email.
  4. I think, but am not sure, that I need to have the public or private key readable somewhere on my server for validation. Is that so? That part is completely vague to me.

Can someone answer these points. I believe if I understand what the generic pieces are I can put them together, unless specialized software is required to manage the DKIM record.

已采纳解答

原帖链接 · Grigory Sergeev · CC BY-SA 3.0

To get DKIM implemented you need the following components:

  1. The software that will sign you messages (specific to your particular Mail Transfer Agent)
  2. Private key configured in this software (can be generated in pair with Public Key with any tool available)
  3. Public key added to your public DNS following a DKIM syntax

Your MTA signs the message with the private key, which has to be protected from external access. Receiving clients check the signature validity with the Public Key you have published in DNS.

Please see this article. Even though it targets Exchange environment it explains the basics of DKIM and DMARC(you will probably want this as well!) in pretty detail.

TechNet: On-Premises Exchange: DKIM and DMARC setup

This is an example software that works with Exchange to do the signing

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

资料来源与适用范围

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

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

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