From 231412071142f1ca5a20d86fb5e090b795400996 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 13 Dec 2006 08:47:39 +0000 Subject: [PATCH] MIME-Quoting der Betreff-Zeile: Leerzeichen als "_" ausgaben; "_" in Hex quoten (siehe RFC 2047 4.2); Hex-Zahlen mit Grossbuchstaben. --- SL/Mailer.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/SL/Mailer.pm b/SL/Mailer.pm index 1a377f367..453603ff1 100644 --- a/SL/Mailer.pm +++ b/SL/Mailer.pm @@ -55,17 +55,18 @@ sub mime_quote_text { for (my $i = 0; $i < length($text); $i++) { my $char = ord(substr($text, $i, 1)); - if (($char < 33) || ($char > 127) || - ($char == ord('?')) || ($char == ord(' '))) { + if (($char < 32) || ($char > 127) || + ($char == ord('?')) || ($char == ord('_'))) { if ($chars_left < 5) { $new_text .= "?=\n $q_start"; $chars_left = 75 - $l_start; } - $new_text .= sprintf("=%02x", $char); + $new_text .= sprintf("=%02X", $char); $chars_left -= 3; } else { + $char = ord('_') if ($char == ord(' ')); if ($chars_left < 5) { $new_text .= "?=\n $q_start"; $chars_left = 75 - $l_start; -- 2.20.1