{"id":889,"date":"2026-09-17T23:27:10","date_gmt":"2026-09-17T20:27:10","guid":{"rendered":"https:\/\/imaxis.ru\/?p=889"},"modified":"2026-09-18T00:05:37","modified_gmt":"2026-09-17T21:05:37","slug":"nastroyka-dkim-postfix-na-ubuntu-i-rocky-linux","status":"publish","type":"post","link":"https:\/\/imaxis.ru\/?p=889","title":{"rendered":"\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 DKIM + Postfix \u043d\u0430 Ubuntu \u0438 Rocky Linux"},"content":{"rendered":"<h1>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 DKIM + Postfix \u043d\u0430 Ubuntu \u0438 Rocky Linux<\/h1>\n<p>DKIM (DomainKeys Identified Mail) \u2014 \u0446\u0438\u0444\u0440\u043e\u0432\u0430\u044f \u043f\u043e\u0434\u043f\u0438\u0441\u044c \u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u043f\u0438\u0441\u0435\u043c. \u041f\u043e\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043f\u043e\u0434\u043f\u0438\u0441\u044c \u043f\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u043c\u0443 \u043a\u043b\u044e\u0447\u0443 \u0438\u0437 DNS \u0434\u043e\u043c\u0435\u043d\u0430, \u0447\u0442\u043e \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u0442 \u043f\u043e\u0434\u043b\u0438\u043d\u043d\u043e\u0441\u0442\u044c \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u0435\u043b\u044f \u0438 \u0443\u043b\u0443\u0447\u0448\u0430\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u043e\u0441\u0442\u044c. \u041d\u0430\u0441\u0442\u0440\u043e\u0438\u043c OpenDKIM + Postfix.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u0434\u043b\u044f Ubuntu\/Debian\/Astra Linux \u0438 Rocky Linux\/CentOS\/Red Hat.<\/p>\n<hr \/>\n<h2>1. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 OpenDKIM<\/h2>\n<p>OpenDKIM \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438 \u043f\u0438\u0441\u0435\u043c \u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0443\u0442\u0438\u043b\u0438\u0442\u044b \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043a\u043b\u044e\u0447\u0435\u0439.<\/p>\n<p><strong>Ubuntu \/ Debian \/ Astra Linux:<\/strong><\/p>\n<pre><code class=\"language-bash\">apt update\napt install opendkim opendkim-tools\n<\/code><\/pre>\n<p><strong>Rocky Linux \/ CentOS:<\/strong><\/p>\n<pre><code class=\"language-bash\">dnf install opendkim opendkim-tools\n<\/code><\/pre>\n<hr \/>\n<h2>2. \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 OpenDKIM \u0438 Postfix<\/h2>\n<h3>OpenDKIM<\/h3>\n<pre><code class=\"language-bash\">mv \/etc\/opendkim.conf \/etc\/backup.opendkim.conf\nvi \/etc\/opendkim.conf\n<\/code><\/pre>\n<pre><code>AutoRestart             Yes\nAutoRestartRate         10\/1h\nUmask                   002\nSyslog                  yes\nSyslogSuccess           Yes\nLogWhy                  Yes\nCanonicalization        relaxed\/simple\nExternalIgnoreList      refile:\/etc\/opendkim\/TrustedHosts\nInternalHosts           refile:\/etc\/opendkim\/TrustedHosts\nKeyTable                refile:\/etc\/opendkim\/KeyTable\nSigningTable            refile:\/etc\/opendkim\/SigningTable\nMode                    sv\nPidFile                 \/var\/run\/opendkim\/opendkim.pid\nSignatureAlgorithm      rsa-sha256\nUserID                  opendkim:opendkim\nSocket                  inet:12301@localhost\n<\/code><\/pre>\n<p><strong>\u0412\u0441\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043c\u043e\u0436\u043d\u043e \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043a\u0430\u043a \u0435\u0441\u0442\u044c; <code>Socket<\/code> \u2014 \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u043e\u0440\u0442 \u0432\u043c\u0435\u0441\u0442\u043e <code>12301<\/code>.<\/strong><\/p>\n<pre><code class=\"language-bash\">mkdir -p \/etc\/opendkim\nvi \/etc\/opendkim\/TrustedHosts\n<\/code><\/pre>\n<pre><code>127.0.0.1\nlocalhost\n<\/code><\/pre>\n<p><strong>\u0421\u044e\u0434\u0430 \u0432\u043d\u043e\u0441\u044f\u0442\u0441\u044f IP \u0438 \u0441\u0435\u0442\u0438 \u043f\u043e\u0447\u0442\u043e\u0432\u044b\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0448 \u0441\u0435\u0440\u0432\u0435\u0440 \u043a\u0430\u043a \u0440\u0435\u043b\u0435\u0439.<\/strong><\/p>\n<pre><code class=\"language-bash\">touch \/etc\/opendkim\/{KeyTable,SigningTable}\nvi \/etc\/default\/opendkim\n<\/code><\/pre>\n<pre><code>SOCKET=inet:12301@localhost\n<\/code><\/pre>\n<pre><code class=\"language-bash\">systemctl enable opendkim\nsystemctl restart opendkim\n<\/code><\/pre>\n<h3>Postfix<\/h3>\n<pre><code class=\"language-bash\">vi \/etc\/postfix\/main.cf\n<\/code><\/pre>\n<pre><code>milter_protocol = 2\nmilter_default_action = accept\nsmtpd_milters = inet:localhost:12301\nnon_smtpd_milters = inet:localhost:12301\n<\/code><\/pre>\n<p><strong>\u0415\u0441\u043b\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b <code>smtpd_milters<\/code>\/<code>non_smtpd_milters<\/code> \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u2014 \u0434\u043e\u043f\u0438\u0448\u0438\u0442\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043a \u0438\u043c\u0435\u044e\u0449\u0438\u043c\u0441\u044f. \u041f\u043e\u0440\u0442 <code>12301<\/code> \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0442\u044c \u0441 <code>opendkim.conf<\/code>.<\/strong><\/p>\n<pre><code class=\"language-bash\">systemctl restart postfix\n<\/code><\/pre>\n<hr \/>\n<h2>3. \u0421\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0434\u043e\u043c\u0435\u043d\u0430<\/h2>\n<p>\u041c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u043d\u043b\u0430\u0439\u043d-\u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u043c <a href=\"https:\/\/dkimcore.org\/tools\/keys.html\">dkimcore.org<\/a>, \u043d\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u043a\u043b\u044e\u0447 \u0441\u0430\u043c\u0438 \u0447\u0435\u0440\u0435\u0437 <code>opendkim-genkey<\/code>. \u0417\u0430\u043c\u0435\u043d\u0438\u0442\u0435 \u0434\u043e\u043c\u0435\u043d \u043d\u0430 \u0441\u0432\u043e\u0439.<\/p>\n<pre><code class=\"language-bash\">DKIM_DOMAIN=imaxis.ru\nmkdir -p \/etc\/opendkim\/${DKIM_DOMAIN}\nopendkim-genkey -D \/etc\/opendkim\/${DKIM_DOMAIN}\/ --domain ${DKIM_DOMAIN} --selector relay\n<\/code><\/pre>\n<p>\u0433\u0434\u0435 <code>${DKIM_DOMAIN}<\/code> \u2014 \u0434\u043e\u043c\u0435\u043d \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438, <code>relay<\/code> \u2014 \u0438\u043c\u044f \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u0430 (\u043b\u044e\u0431\u043e\u0435).<\/p>\n<p><strong>\u041f\u043e\u044f\u0432\u044f\u0442\u0441\u044f \u0434\u0432\u0430 \u0444\u0430\u0439\u043b\u0430: <code>.private<\/code> (\u0437\u0430\u043a\u0440\u044b\u0442\u044b\u0439 \u043a\u043b\u044e\u0447, \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435) \u0438 <code>.txt<\/code> (\u0433\u043e\u0442\u043e\u0432\u0430\u044f TXT-\u0437\u0430\u043f\u0438\u0441\u044c \u0434\u043b\u044f DNS).<\/strong><\/p>\n<pre><code class=\"language-bash\">chown :opendkim \/etc\/opendkim\/${DKIM_DOMAIN}\/*\nchmod g+rw \/etc\/opendkim\/${DKIM_DOMAIN}\/*\n<\/code><\/pre>\n<p><strong>\u0415\u0441\u043b\u0438 \u0433\u0440\u0443\u043f\u043f\u044b <code>opendkim<\/code> \u043d\u0435\u0442 \u2014 \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u0430\u043a\u0435\u0442\u043e\u043c (\u043e\u0431\u044b\u0447\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438).<\/strong><\/p>\n<pre><code class=\"language-bash\">echo &quot;*.${DKIM_DOMAIN}&quot; &gt;&gt; \/etc\/opendkim\/TrustedHosts\n<\/code><\/pre>\n<p><strong>KeyTable<\/strong> \u2014 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\/\u0434\u043e\u043c\u0435\u043d\/\u0444\u0430\u0439\u043b \u043a\u043b\u044e\u0447\u0430, \u0444\u043e\u0440\u043c\u0430\u0442:<\/p>\n<pre><code>&lt;\u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440&gt;._domainkey.&lt;\u0434\u043e\u043c\u0435\u043d&gt; &lt;\u0434\u043e\u043c\u0435\u043d&gt;:&lt;\u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440&gt;:&lt;\u043f\u0443\u0442\u044c \u043a \u043a\u043b\u044e\u0447\u0443&gt;\n<\/code><\/pre>\n<pre><code class=\"language-bash\">echo &quot;relay._domainkey.${DKIM_DOMAIN} ${DKIM_DOMAIN}:relay:\/etc\/opendkim\/${DKIM_DOMAIN}\/relay.private&quot; &gt;&gt; \/etc\/opendkim\/KeyTable\n<\/code><\/pre>\n<p><strong>SigningTable<\/strong> \u2014 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 email-\u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u0437\u0430\u043f\u0438\u0441\u044f\u043c KeyTable:<\/p>\n<pre><code class=\"language-bash\">echo &quot;*@${DKIM_DOMAIN} relay._domainkey.${DKIM_DOMAIN}&quot; &gt;&gt; \/etc\/opendkim\/SigningTable\n<\/code><\/pre>\n<p><strong>\u0412 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u0435 \u0441\u0442\u0440\u043e\u043a\u0430 \u0431\u044b\u043b\u0430 \u0431\u0435\u0437 <code>@<\/code> (<code>*${DKIM_DOMAIN}<\/code>) \u2014 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u0430\u0434\u0440\u0435\u0441\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 <code>*@domain<\/code>.<\/strong><\/p>\n<pre><code class=\"language-bash\">systemctl restart opendkim\n<\/code><\/pre>\n<hr \/>\n<h2>4. \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 DNS<\/h2>\n<pre><code class=\"language-bash\">cat \/etc\/opendkim\/${DKIM_DOMAIN}\/relay.txt\n<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0451\u043c TXT-\u0437\u0430\u043f\u0438\u0441\u044c:<\/p>\n<pre><code>relay._domainkey IN TXT &quot;v=DKIM1; k=rsa; p=MIGfMA0GCSqG...rhyaj8OcbwIDAQAB&quot;\n<\/code><\/pre>\n<p>\u0433\u0434\u0435 <code>relay<\/code> \u2014 \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440, <code>p=...<\/code> \u2014 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u043a\u043b\u044e\u0447 (\u0432 \u0444\u0430\u0439\u043b\u0435 \u043e\u043d \u043f\u043e\u043b\u043d\u044b\u0439).<\/p>\n<h3>\u041d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0437\u0430\u043f\u0438\u0441\u0438<\/h3>\n<pre><code>_domainkey IN TXT &quot;o=~; r=postmaster@imaxis.ru&quot;\n<\/code><\/pre>\n<p><strong><code>o=~<\/code> \u2014 \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043d\u0435 \u0432\u0441\u0435 \u043f\u0438\u0441\u044c\u043c\u0430; <code>o=-<\/code> \u2014 \u0432\u0441\u0435.<\/strong><\/p>\n<pre><code>_adsp._domainkey IN TXT &quot;dkim=all&quot;\n<\/code><\/pre>\n<p><strong><code>all<\/code> \u2014 \u0437\u0430\u043f\u0440\u0435\u0442\u0438\u0442\u044c \u043f\u0440\u0438\u0451\u043c \u043f\u0438\u0441\u0435\u043c \u043e\u0442 \u0434\u043e\u043c\u0435\u043d\u0430 \u0431\u0435\u0437 \u043f\u043e\u0434\u043f\u0438\u0441\u0438; <code>discardable<\/code> \u2014 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u044f; <code>unknown<\/code> \u2014 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/strong><\/p>\n<hr \/>\n<h2>5. \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430<\/h2>\n<p>DNS-\u0437\u0430\u043f\u0438\u0441\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043e\u0442 15 \u043c\u0438\u043d\u0443\u0442 \u0434\u043e 24 \u0447\u0430\u0441\u043e\u0432 \u2014 \u043f\u0440\u0438 \u043d\u0435\u0443\u0434\u0430\u0447\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u0435 \u0442\u0435\u0441\u0442 \u043f\u043e\u0437\u0436\u0435.<\/p>\n<h3>\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0438\u0441\u044c\u043c\u043e<\/h3>\n<p>\u041e\u0442\u043f\u0440\u0430\u0432\u044c\u0442\u0435 \u043f\u0438\u0441\u044c\u043c\u043e \u043d\u0430 mail.ru, gmail.com, yandex.ru.<\/p>\n<p><strong>Red Hat \/ CentOS:<\/strong><\/p>\n<pre><code class=\"language-bash\">dnf install s-nail    # mailx \u0437\u0430\u043c\u0435\u043d\u0451\u043d \u043d\u0430 s-nail \u0432 RPM 9+\necho &quot;Test DKIM&quot; | mail -s &quot;Testing DKIM&quot; -S smtp:\/\/localhost:25 -S from=&quot;DKIM Tester &lt;postmaster@${DKIM_DOMAIN}&gt;&quot; -S return-path=&quot;&lt;postmaster@${DKIM_DOMAIN}&gt;&quot; master@imaxis.ru\n<\/code><\/pre>\n<p><strong>Debian \/ Ubuntu:<\/strong><\/p>\n<pre><code class=\"language-bash\">apt install mailutils\necho &quot;Test DKIM&quot; | mail -s &quot;Testing DKIM&quot; -a &quot;Smtp: localhost:25&quot; -a &quot;From: DKIM Tester &lt;postmaster@${DKIM_DOMAIN}&gt;&quot; -a &quot;Return-path: &lt;postmaster@${DKIM_DOMAIN}&gt;&quot; master@imaxis.ru\n<\/code><\/pre>\n<p><strong>\u0412\u0442\u043e\u0440\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u2014 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u043e\u0447\u0442\u043e\u0432\u044b\u0439 \u043a\u043b\u0438\u0435\u043d\u0442, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0439 \u0447\u0435\u0440\u0435\u0437 \u043d\u0430\u0448 \u0441\u0435\u0440\u0432\u0435\u0440.<\/strong><\/p>\n<h3>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438<\/h3>\n<p>\u0412 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u043c \u043f\u0438\u0441\u044c\u043c\u0435 \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043b\u0443\u0436\u0435\u0431\u043d\u044b\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438 (\u0432 mail.ru: <strong>\u0415\u0449\u0435 \u2192 \u0421\u043b\u0443\u0436\u0435\u0431\u043d\u044b\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438<\/strong>):<\/p>\n<pre><code>dkim=pass header.d=imaxis.ru\n<\/code><\/pre>\n<p><strong>\u041f\u043e\u0434\u043f\u0438\u0441\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/strong><\/p>\n<hr \/>\n<h2>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u043e\u0432\u044b\u0445 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 DKIM<\/h2>\n<pre><code class=\"language-bash\">DKIM_DOMAIN=domain.zone\nmkdir -p \/etc\/opendkim\/$DKIM_DOMAIN\nopendkim-genkey -D \/etc\/opendkim\/$DKIM_DOMAIN\/ --domain $DKIM_DOMAIN --selector relay\nchown :opendkim \/etc\/opendkim\/$DKIM_DOMAIN\/*\nchmod g+rw \/etc\/opendkim\/$DKIM_DOMAIN\/*\ncat \/etc\/opendkim\/$DKIM_DOMAIN\/relay.txt\n<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0451\u043c TXT-\u0437\u0430\u043f\u0438\u0441\u044c \u043f\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u043c\u0443 \u0444\u0430\u0439\u043b\u0430, \u0437\u0430\u0442\u0435\u043c:<\/p>\n<pre><code class=\"language-bash\">echo &quot;*.$DKIM_DOMAIN&quot; &gt;&gt; \/etc\/opendkim\/TrustedHosts\necho &quot;relay._domainkey.$DKIM_DOMAIN $DKIM_DOMAIN:relay:\/etc\/opendkim\/$DKIM_DOMAIN\/relay.private&quot; &gt;&gt; \/etc\/opendkim\/KeyTable\necho &quot;*@$DKIM_DOMAIN relay._domainkey.$DKIM_DOMAIN&quot; &gt;&gt; \/etc\/opendkim\/SigningTable\nsystemctl reload opendkim\n<\/code><\/pre>\n<hr \/>\n<h2>\u0427\u0442\u043e \u0434\u0430\u043b\u044c\u0448\u0435<\/h2>\n<ol>\n<li>\u0423\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u0434\u043b\u044f \u0434\u043e\u043c\u0435\u043d\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c <strong>SPF<\/strong> (TXT) \u2014 \u043e\u043d\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442, \u0441 \u043a\u0430\u043a\u0438\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u043e\u0447\u0442\u0443 \u0434\u043e\u043c\u0435\u043d\u0430.<\/li>\n<li>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u0442\u0435 <strong>DMARC<\/strong> \u2014 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0443 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u0438\u0441\u0435\u043c; \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 SPF \u0438 DKIM.<\/li>\n<\/ol>\n<hr \/>\n<h2>\u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c<\/h2>\n<p>\u041b\u043e\u0433\u0438 OpenDKIM \u043f\u043e\u043f\u0430\u0434\u0430\u044e\u0442 \u0432 \u043e\u0431\u0449\u0438\u0439 \u043f\u043e\u0447\u0442\u043e\u0432\u044b\u0439 \u043b\u043e\u0433:<\/p>\n<p><strong>Red Hat \/ CentOS:<\/strong><\/p>\n<pre><code class=\"language-bash\">tail -f \/var\/log\/maillog\n<\/code><\/pre>\n<p><strong>Debian \/ Ubuntu:<\/strong><\/p>\n<pre><code class=\"language-bash\">tail -f \/var\/log\/mail.log\n<\/code><\/pre>\n<p>\u0427\u0430\u0441\u0442\u044b\u0435 \u043f\u0440\u0438\u0447\u0438\u043d\u044b \u043f\u0440\u043e\u0431\u043b\u0435\u043c:<\/p>\n<ul>\n<li><strong>\u041f\u0440\u0430\u0432\u0430 \u043d\u0430 \u043a\u043b\u044e\u0447\u0438<\/strong> \u2014 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0448\u0438\u0440\u043e\u043a\u0438\u0435 \u043f\u0440\u0430\u0432\u0430 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>644<\/code>) \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442 \u043e\u0448\u0438\u0431\u043a\u0443 <code>error loading key<\/code>. \u041a\u043b\u044e\u0447\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0430\u0442\u044c \u0433\u0440\u0443\u043f\u043f\u0435 <code>opendkim<\/code> \u0441 \u043f\u0440\u0430\u0432\u0430\u043c\u0438 <code>g+rw<\/code>.<\/li>\n<li><strong><code>opendkim: no signing table match for ...<\/code><\/strong> \u2014 \u0434\u043b\u044f \u0434\u043e\u043c\u0435\u043d\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u043d\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 <code>SigningTable<\/code> (\u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0430 \u0438\u043b\u0438 \u0434\u043e\u043c\u0435\u043d \u043d\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c\u0441\u044f).<\/li>\n<li><strong>\u041f\u043e\u0440\u0442 \u043c\u0438\u043b\u0442\u0435\u0440\u0430<\/strong> \u2014 <code>Socket<\/code> \u0432 <code>opendkim.conf<\/code>, <code>SOCKET<\/code> \u0432 <code>\/etc\/default\/opendkim<\/code> \u0438 <code>smtpd_milters<\/code> \u0432 Postfix \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0442\u044c.<\/li>\n<\/ul>\n<hr \/>\n<h2>\u0422\u043e\u043d\u043a\u043e\u0441\u0442\u0438 \u0438 \u043f\u043e\u0434\u0432\u043e\u0434\u043d\u044b\u0435 \u043a\u0430\u043c\u043d\u0438<\/h2>\n<ul>\n<li><strong>\u0421\u0435\u043b\u0435\u043a\u0442\u043e\u0440<\/strong> \u2014 \u0438\u043c\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0435, \u043d\u043e \u0432 DNS-\u0437\u0430\u043f\u0438\u0441\u0438 \u0438 KeyTable\/SigningTable \u0434\u043e\u043b\u0436\u043d\u043e \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0442\u044c.<\/li>\n<li><strong>\u041f\u0440\u0430\u0432\u0430 \u043a\u043b\u044e\u0447\u0435\u0439<\/strong> \u2014 OpenDKIM \u043e\u0442\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0438\u0437\u043b\u0438\u0448\u043d\u0435 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c\u0438 \u043f\u0440\u0430\u0432\u0430\u043c\u0438.<\/li>\n<li><strong>SigningTable<\/strong> \u2014 \u0448\u0430\u0431\u043b\u043e\u043d \u0430\u0434\u0440\u0435\u0441\u0430 \u043f\u0438\u0448\u0435\u0442\u0441\u044f \u043a\u0430\u043a <code>*@domain<\/code>, \u0430 \u043d\u0435 <code>*domain<\/code>.<\/li>\n<li><strong>\u041f\u043e\u0440\u0442 12301<\/strong> \u2014 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432 \u0432\u043e \u0432\u0441\u0435\u0445 \u0442\u0440\u0451\u0445 \u043a\u043e\u043d\u0444\u0438\u0433\u0430\u0445.<\/li>\n<li><strong>SPF \u0438 DMARC<\/strong> \u2014 \u0431\u0435\u0437 \u043d\u0438\u0445 DKIM \u0441\u0430\u043c \u043f\u043e \u0441\u0435\u0431\u0435 \u043d\u0435 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u043e\u0441\u0442\u044c.<\/li>\n<li><strong><code>dkim=all<\/code> (ADSP)<\/strong> \u2014 \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0430\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430; \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043f\u043e\u043b\u0430\u0433\u0430\u044e\u0442\u0441\u044f \u043d\u0430 DMARC.<\/li>\n<li><strong><code>milter_default_action = accept<\/code><\/strong> \u2014 \u043f\u0440\u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0438 OpenDKIM \u043f\u0438\u0441\u044c\u043c\u0430 \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u0443\u0439\u0434\u0443\u0442 (\u0431\u0435\u0437 \u043f\u043e\u0434\u043f\u0438\u0441\u0438). \u0414\u043b\u044f \u0441\u0442\u0440\u043e\u0433\u043e\u0433\u043e \u0440\u0435\u0436\u0438\u043c\u0430 \u2014 <code>tempfail<\/code>.<\/li>\n<\/ul>\n<hr \/>\n<h2>\u0428\u043f\u0430\u0440\u0433\u0430\u043b\u043a\u0430<\/h2>\n<pre><code class=\"language-bash\">apt install opendkim opendkim-tools    # Ubuntu\/Debian\ndnf install opendkim opendkim-tools    # Rocky\/CentOS\n\n# opendkim.conf: Socket inet:12301@localhost, KeyTable\/SigningTable\/TrustedHosts\n# postfix main.cf: smtpd_milters = inet:localhost:12301\n\nDKIM_DOMAIN=imaxis.ru\nopendkim-genkey -D \/etc\/opendkim\/$DKIM_DOMAIN\/ --domain $DKIM_DOMAIN --selector relay\nchown :opendkim \/etc\/opendkim\/$DKIM_DOMAIN\/* &amp;&amp; chmod g+rw \/etc\/opendkim\/$DKIM_DOMAIN\/*\ncat \/etc\/opendkim\/$DKIM_DOMAIN\/relay.txt   # -&gt; TXT \u0432 DNS\n\nsystemctl restart opendkim postfix\n# \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430: dkim=pass header.d=imaxis.ru\n<\/code><\/pre>\n<p><em>\u041f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u043e \u043d\u0430: Ubuntu 22.04\/24.04, Rocky Linux 9 + OpenDKIM, Postfix.<\/em><br \/>\n<em>\u0414\u0430\u0442\u0430: \u0421\u0435\u043d\u0442\u044f\u0431\u0440\u044c 2026.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 DKIM + Postfix \u043d\u0430 Ubuntu \u0438 Rocky Linux DKIM<\/p>\n","protected":false},"author":0,"featured_media":964,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"footnotes":""},"categories":[3],"tags":[],"class_list":["post-889","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux"],"aioseo_notices":[],"views":5,"_links":{"self":[{"href":"https:\/\/imaxis.ru\/index.php?rest_route=\/wp\/v2\/posts\/889","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/imaxis.ru\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/imaxis.ru\/index.php?rest_route=\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/imaxis.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=889"}],"version-history":[{"count":3,"href":"https:\/\/imaxis.ru\/index.php?rest_route=\/wp\/v2\/posts\/889\/revisions"}],"predecessor-version":[{"id":897,"href":"https:\/\/imaxis.ru\/index.php?rest_route=\/wp\/v2\/posts\/889\/revisions\/897"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/imaxis.ru\/index.php?rest_route=\/wp\/v2\/media\/964"}],"wp:attachment":[{"href":"https:\/\/imaxis.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=889"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/imaxis.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=889"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/imaxis.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=889"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}