Postfix / OpenDKIM不签署PHP发送的电子邮件

我们安装了SPF,DKIM和DMARClogging,用于电子邮件安全性/可validation性。

通过控制台或Outlook或Mac邮件等邮件客户端发送邮件时,邮件会完全处理并全部通过。

通过Zend Framework 1.12的SendMail函数发送失败(php)。

我们有没有错过configuration有一些PHP电子邮件签名? 我们看什么文件? 还是必须有不同的安装/附加?

我们在Cent OS 6上使用OpenDKIM和Postfix

后缀-n结果:

alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases command_directory = /usr/sbin config_directory = /etc/postfix daemon_directory = /usr/libexec/postfix data_directory = /var/lib/postfix debug_peer_level = 2 html_directory = no inet_interfaces = all inet_protocols = all mail_owner = postfix mailq_path = /usr/bin/mailq.postfix manpage_directory = /usr/share/man milter_default_action = accept milter_protocol = 2 mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain, mail.$mydomain, www.$mydomain, ftp.$mydomain mydomain = example.com myhostname = server1.example.com mynetworks = 127.0.0.0/32 myorigin = $mydomain newaliases_path = /usr/bin/newaliases.postfix non_smtpd_milters = queue_directory = /var/spool/postfix readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES sample_directory = /usr/share/doc/postfix-2.6.6/samples sendmail_path = /usr/sbin/sendmail.postfix setgid_group = postdrop smtpd_milters = inet:localhost:8891 smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination smtpd_sasl_auth_enable = yes smtpd_sasl_path = private/auth smtpd_sasl_type = dovecot smtpd_tls_auth_only = yes smtpd_tls_cert_file = /etc/pki/tls/certs/mail.example.com.crt smtpd_tls_key_file = /etc/pki/tls/private/mail.example.com.key smtpd_tls_loglevel = 1 smtpd_tls_security_level = may smtpd_tls_session_cache_timeout = 3600s tls_random_source = dev:/dev/urandom unknown_local_recipient_reject_code = 550 virtual_transport = dovecot 

这是我从Port25电子邮件检查器得到的结果。 所有的都是一样的,除了DKIM在zend时丢失了。

非Zend常规标题: DKIM签名

 Return-Path: <[email protected]> Received: from server1.example.com (123.123.123.123 (my server ip)) by verifier.port25.com id hrh7ri20i3gm for <[email protected]>; Thu, 12 Feb 2015 02:01:13 -0500 (envelope-from <[email protected]>) Authentication-Results: verifier.port25.com; spf=pass [email protected] Authentication-Results: verifier.port25.com; domainkeys=neutral (message not signed) [email protected] Authentication-Results: verifier.port25.com; dkim=pass (matches From: [email protected]) header.d=example.com Authentication-Results: verifier.port25.com; sender-id=pass [email protected] Received: from [111.111.1.111] (cpe-11-11-111-111.socal.res.rr.com [76.94.200.240]) by server1.example.com (Postfix) with ESMTPSA id 33F233800A9 for <[email protected].>; Wed, 11 Feb 2015 23:01:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=example.com; s=default; t=1423724471; bh=qMnrIAg7afoneBTtI0hU9OrDkqChYZOD1f4AUvZtdGw=; h=From:Subject:Date:To; b=g4lXm/vQ54wq/B0fCAf/U3Hj3hi2N2jojst+5lURCfykwhvzjqCm/Z5VGz3rcu MoZCfxEkCI4OyQqW2kch93h93h93j3kbuCg3Pehl2WlgoLJy2S8CMR68ygNU52+P88 IG/vq2YShK6ctLUxRq4O79IYzKcInRiXuWOtuV3A= From: Darius <[email protected]> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Give me a test result. Thank you. Message-Id: <[email protected]> Date: Wed, 11 Feb 2015 23:01:00 -0800 To: [email protected]. Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) X-Mailer: Apple Mail (2.2070.6) 

这是Zend的Zend版本结果: 不是 DKIM签名

 Return-Path: <[email protected]> Received: from server1.example.com (xxx.xxx.xxx.xxx (my server ip)) by verifier.port25.com id hr9du620i3gl for <[email protected]>; Tue, 10 Feb 2015 14:28:35 -0500 (envelope-from <[email protected]>) Authentication-Results: verifier.port25.com; spf=pass [email protected] Authentication-Results: verifier.port25.com; domainkeys=neutral (message not signed) [email protected] Authentication-Results: verifier.port25.com; dkim=neutral (message not signed) Authentication-Results: verifier.port25.com; sender-id=pass [email protected] Received: by server1.example.com (Postfix, from userid 500) id 08E073800AA; Tue, 10 Feb 2015 11:28:25 -0800 (PST) To: [email protected] Subject: mydomain Test X-PHP-Originating-Script: 5004:Sendmail.php From: mydomain Test <[email protected]> Date: Tue, 10 Feb 2015 11:28:24 -0800 Content-Type: multipart/alternative; boundary="=_af78e87ff18206603cb724d073777150" MIME-Version: 1.0 Message-Id: <[email protected]> 

通过控制台或Outlook或Mac邮件等邮件客户端发送邮件时,邮件会完全处理并全部通过。

由于您将此configuration放置在main.cf因此会出现此行为

 smtpd_milters = inet:localhost:8891 

通过Zend Framework 1.12的SendMail函数发送失败(php)。

由于您将此configuration放置在main.cf所以也期望这种行为

 non_smtpd_milters = 

说明

默认情况下,OpenDKIM通过milter与postfix相结合。 启用/禁用milter应用程序由smtpd_miltersnon_smtpd_milters参数控制。 对于通过smtpd发送电子邮件的应用程序,函数参数是smtpd_milters ,对于sendmail,参数是non_smtpd_milters

用。replacenon_smtpd_milters =

 non_smtpd_milters = inet:localhost:8891