我是否需要安装SSL才能实施DKIM

时间:2013-03-08 14:23:26

标签: ssl openssl phpmailer dkim

我正在使用open-dkim和phpmailer来签署我的外发邮件,我已经安装了我的密钥,并显示为有效,并且邮件脚本正在运行,但是我收到一个openSSL错误,它阻止了这个过程:

Warning: openssl_sign() [function.openssl-sign]: supplied key param cannot be coerced into a private key in /usr/share/php/class.phpmailer.php on line 2221

我对openssl一无所知,但我首先想到的是这个域没有安装SSL,所以也许DKIM需要这个?如果是这样,它是否像往常一样简单地安装新SSL,或者我是否必须以某种方式将公钥/私钥与SSL相关联?

由于

如果需要,

完整脚本:

<?

require_once("class.phpmailer.php");
$mailer = new PHPMailer();


$mailer->IsSMTP();
$mailer->Host = 'mail.domain.com';
$mailer->SMTPAuth = true;

$mailer->Username = 'info@domain.com';
$mailer->Password = 'pass';
$mailer->FromName = 'info@domain.com';
$mailer->From = 'info@domain.com';
$mailer->AddAddress('test@gmail.com','first last');
$mailer->Subject = 'Testing DKIM';

$mailer->DKIM_domain = 'domain.com';
$mailer->DKIM_private = 'private.txt';
$mailer->DKIM_selector = 'default'; //this effects what you put in your DNS record
$mailer->DKIM_passphrase = '';


$mailer->Body = 'this is just an email test';

if(!$mailer->Send())
{
echo "Message was not sent";
echo "Mailer Error: " . $mailer->ErrorInfo;
exit;
} else {
echo "Message Sent!";   
}

?>

1 个答案:

答案 0 :(得分:1)

答案分为两部分:

1)不,您显然不需要安装传统的SSL来使用DKIM

2)我的错误是由于从添加了额外字符的RTF文档中复制我的私钥。我将它复制到Dreamweaver中,删除了多余的字符,我现在收到来自服务器的签名电子邮件