我使用PHPmailer發送電子郵件。如何使用DKIM簽名向Phpmailer發送電子郵件?
我安裝了postfix服務和DKIM-Milter來生成密鑰。
它工作正常,如果我用它來發送的郵件的命令行和郵件與DKIM簽名顯示「簽署者:mydomain.com」
Authentication-Results: mx.google.com; spf=pass (google.com: domain of [email protected] designates 182.50.xxx.xxx as permitted sender) [email protected]; dkim=pass [email protected]
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mydomain.com; s=default;
t=1325531456; bh=+gZFhu4Id2AXb8UVbFLzDVVlChWGhvxvJUIdjdMLQsk=;
h=To:Subject:Message-Id:Date:From;
b=mH4GV8ayicc6UMn1uopCc9VJb5v2MiOKQpEtwJjckzoJ8ePhRKQIZI5KnzSdSoSP3
BtmehOQhMn9kIR/TlL2dlSog2EkRNeAaWcmO1K3khtCZ7rkXHGJsDn9C6l49K0tJa2
rplPOSI7wS8+3NCEiuc5sjZimPo4v9WuTECVqxkg=
但我想使用的PHPMailer(5.1),以與DKIM簽名發送的郵件支持,但返回此:
Authentication-Results: mx.google.com; spf=pass (google.com: domain of [email protected] designates 182.50.xxx.xxx as permitted sender) [email protected]; dkim=neutral (bad format) [email protected]
DKIM-Signature: v=1; a=rsa-sha1; q=dns/txt; l=70; s=default;
t=1325533594; c=relaxed/simple;
h=From:To:Subject;
d=mydomain.com; [email protected];
z=
|
|Subject:=20Testing=20email=20from=20phpmailer;
bh=lC+16EvauA2HuJG03ArE6CtgLuY=;
b=
我檢查了class.phpmailer.php文件,它具有一定的DKIM選項:
public $DKIM_selector = 'default';
/**
* Used with DKIM DNS Resource Record
* optional, in format of email address '[email protected]'
* @var string
*/
public $DKIM_identity = '';
/**
* Used with DKIM DNS Resource Record
* optional, in format of email address '[email protected]'
* @var string
*/
public $DKIM_domain = '';
/**
* Used with DKIM DNS Resource Record
* optional, in format of email address '[email protected]'
* @var string
*/
public $DKIM_private = '';
如何配置此選項?我知道公鑰和私鑰,但是什麼是$ DKIM_private和$ DKIM_identity?
由於它們是可選的,你可能不需要它們? – Corubba 2012-01-03 01:11:57
@BloodyWorld如果你想發送帶有DKIM簽名的郵件,它們是必備的。 – Angolao 2012-01-03 13:43:20