public function DKIM_BodyC($body) { if (empty($body)) { return "\r\n"; } // Normalize line endings $body = str_replace("\r\n", "\n", $body); $body = str_replace("\n", "\r\n", $body); //Reduce multiple trailing line breaks to a single one return rtrim($body, "\r\n") . "\r\n"; }