You are here

public function PHPMailer::DKIM_HeaderC in SMTP Authentication Support 7

Same name and namespace in other branches
  1. 7.2 smtp.phpmailer.inc \PHPMailer::DKIM_HeaderC()

Generate DKIM Canonicalization Header

@access public

Parameters

string $s Header:

1 call to PHPMailer::DKIM_HeaderC()
PHPMailer::DKIM_Add in ./smtp.phpmailer.inc
Create the DKIM header, body, as new header

File

./smtp.phpmailer.inc, line 2243
The mail handler class in smtp module, based on code of the phpmailer library, customized and relicensed to GPLv2.

Class

PHPMailer
PHPMailer - PHP email transport class NOTE: Requires PHP version 5 or later @package PHPMailer @author Andy Prevost @author Marcus Bointon @copyright 2004 - 2009 Andy Prevost

Code

public function DKIM_HeaderC($s) {
  $s = preg_replace("/\r\n\\s+/", " ", $s);
  $lines = explode("\r\n", $s);
  foreach ($lines as $key => $line) {
    list($heading, $value) = explode(":", $line, 2);
    $heading = strtolower($heading);
    $value = preg_replace("/\\s+/", " ", $value);

    // Compress useless spaces
    $lines[$key] = $heading . ":" . trim($value);

    // Don't forget to remove WSP around the value
  }
  $s = implode("\r\n", $lines);
  return $s;
}