10

PHPMailer クラスを使用して DKIM で電子メールに署名しようとしていますが、うまくいきません。

gmailでメールのヘッダーを見ると、クラスがメールヘッダーにDKIMを正常に挿入していることがわかりますが、gmailは気にしません。

問題は、linkedIn メールのヘッダーを表示したところ、2 つの DKIM ヘッダーDomainKey-Signature&を使用していることがわかりましたDKIM-Signature

違いは何ですか?Gmail が私のメールを確認しないのはそのためですか? &PHPでドメインキーを使用して電子メールに署名するための代替の堅牢なクラスをお勧めしますか?

ありがとう

4

2 に答える 2

12

Both use Public/Private keys to digitally sign emails. Both use a text file in the sender's DNS server that contain the public key that can be used by the recipient to verify the signature.

Domain Keys was the first version.

DKIM is the updated version.

The difference is how Domain Keys and DKIM sign the messages, and build the header.

Email recipients may implement either of them (or both). The only thing you can do, is sign with both classes, if you want to cover all bases.

Do you want the technical details on the differences between DomainKeys vs DKIM?

--Dave

于 2010-11-30T14:03:38.560 に答える
0

PHPMailer 5.1でのDKIMサポートは、そのままでは正しく機能しません。これが私がそれを機能させるためにしなければならなかったことです:

  1. 私はこのURLで修正を適用しました: http ://sourceforge.net/tracker/index.php?func = detail&aid = 2960165&group_id = 26031&atid = 385707

  2. 566行目で、これを変更する必要がありました。

    // digitally sign with DKIM if enabled
    if ($this->DKIM_domain && $this->DKIM_private) {
      $header_dkim = $this->DKIM_Add($header,$this->Subject,$body);
      $header = str_replace("\r\n","\n",$header_dkim) . $header;
    }
    

...これに:

  // digitally sign with DKIM if enabled
  if ($this->DKIM_domain && $this->DKIM_private) {

    // Hack to add To: header to the headers which are passed to DKIM_Add
            // Note that this only adds the first To: recipient, so it's going to break
            // if you try to send an email to more than one person simultaneously

    $header_temp = $header . $this->LE . 'To: ' . $this->to[0][0];
    $header_dkim = $this->DKIM_Add($header_temp,$this->EncodeHeader($this->SecureHeader($this->Subject)),$body);
    $header = str_replace("\r\n","\n",$header_dkim) . $header;
  }
于 2011-03-19T01:02:40.733 に答える