postfix / opendkim 不签署电子邮件 php 在第二个域名

我有两个域名,我打电话给他们

example1.com



example2.com



example1.com

所有电子邮件都与标志发送 dkim.



example2.com

电子邮件信件s。 php 发布

没有

dkim 签名,但如果您从控制台发送信件,则会签署。

例如 控制台团队:

php -r 'mail("myemail@yandex.ru", "TEST", "TEST TEXT", "MIME-Version:
1.0\r\nContent-type: text/html; charset=\"utf-8\"\r\nFrom: no-reply <admin@example2.com>\r\n");'

服务器

Centos 7

php-fpm + nginx

opendkim.conf

# grep "^[^#;]" /etc/opendkim.conf
AutoRestart Yes
AutoRestartRate 10/1h
LogWhy Yes
Syslog Yes
SyslogSuccess Yes
Mode sv
Canonicalization relaxed/simple
ExternalIgnoreList refile:/etc/opendkim/TrustedHosts
InternalHosts refile:/etc/opendkim/TrustedHosts
KeyTable refile:/etc/opendkim/KeyTable
SigningTable refile:/etc/opendkim/SigningTable
SignatureAlgorithm rsa-sha256
Socket inet:8891@localhost
PidFile /var/run/opendkim/opendkim.pid
UMask 022
UserID opendkim:opendkim
TemporaryDirectory /var/tmp

main.cf

# grep "^[^#;]" /etc/postfix/main.cf 
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
mail_owner = postfix
myhostname = example1.com
inet_interfaces = localhost
inet_protocols = all
mydestination = $myhostname, localhost.$mydomain, localhost
unknown_local_recipient_reject_code = 550
relay_domains = example1.com,example2.com
relayhost =
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases


debug_peer_level = 2
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
ddd $daemon_directory/$process_name $process_id &amp; sleep 5
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.10.1/samples
readme_directory = /usr/share/doc/postfix-2.10.1/README_FILES
smtpd_milters = inet:localhost:8891
non_smtpd_milters = inet:localhost:8891
milter_default_action = accept
milter_protocol = 2

TrustedHosts

# grep "^[^#;]" /etc/opendkim/TrustedHosts
localhost
127.0.0.1
::1
example1.com
example2.com

KeyTable

grep "^[^#;]" /etc/opendkim/KeyTable
default._domainkey.example1.com example1.com:default:/etc/opendkim/keys/example1.com/default
default._domainkey.example2.com example2.com:default:/etc/opendkim/keys/example2.com/default

SigningTable

# grep "^[^#;]" /etc/opendkim/SigningTable
*@example1.com default._domainkey.example1.com
*@example2.com default._domainkey.example2.com

运输

# grep "^[^#;]" /etc/postfix/transport 
example1.com smtp:mx.yandex.ru
example2.com smtp:mx.yandex.ru

php.ini

# grep sendmail_path /etc/php.ini
sendmail_path = /usr/sbin/sendmail.postfix -t -i

test.php

<?php
$headers= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=\"utf-8\"\r\n";
$headers .= "From: no-reply <admin@example2.com>\r\n";
if (mail('myemail@yandex.ru', 'TEST', 'TEST', $headers)){
echo 'OK';
}
else {
echo 'FAIL';
}

只有需要发送字母,我使用字母来接收字母。 pdd.yandex.ru

问题在哪里。

example2.com

?
</admin@example2.com>
已邀请:

董宝中

赞同来自:

您可能需要在团队中指定标题“来自:” sendmail. Opendkim 仅使用对齐的标题“来自:”签名字母。

要回复问题请先登录注册