I installed a postfix question about how to configure DKIM. I understand that you need a pair of keys. In the description of mail for the Yandex domain, you can easily enter a specific section - https://yandex.ru/support/pdd/set-mail/dkim.xml its in txt-domain record in DNS. And if I am my own mail server: 1) where can I get a key-value pair? 2) Where to insert it into postfix then?
2 answers
First you need to install opendkim. Its configuration file is /etc/opendkim.conf .
To create keys, use the opendkim-genkey -t -s mail -d <ваш_домен> command. After completing it, you will receive two files - * .private (with a private key) and * .txt (with a public record, which will need to be added to the domain settings). In the KeyFile parameter of the configuration file you need to specify the full path to the * .private file, and in the Selector parameter what you specified in the -s parameter of the opendkim-genkey command.
To tell Postfix that you are now using DKIM, you need to specify in its configuration file (probably /etc/postfix/main.cf ) a line like smtpd_milters = inet:127.0.0.1:8891 . The value of this parameter should correspond to the Socket parameter from the opendkim configuration. For this example, this should be the Socket inet:8891@localhost entry Socket inet:8891@localhost .
Do not forget to add opendkim to autoload and update Postfix configuration via postfix reload .
You can install OpenDKIM and create the keys yourself.
I do not know whether to paint in detail here, because and in Debian Wiki and Habré there are already articles on postfix and opendkim.