[rt-users] [netaktiv.com #100] RT email and the ISO-8859-1 characters

Stephane Bortzmeyer bortzmeyer at netaktiv.com
Thu Apr 4 08:23:28 EST 2002


On Mon, Mar 25, 2002 at 12:11:06PM +0100,
 Stephane Bortzmeyer <bortzmeyer at netaktiv.com> wrote 
 a message of 19 lines which said:

> When RT mails us, it does not add headers such as:
> 
> Content-Type: text/plain; charset=iso-8859-1
> Content-Transfer-Encoding: 8bit
> 
> and therefore, composed characters (Latin-1 charset) are garbled.
> 
> What is the proper way to add such headers:

I finally tried the following quick, not perfect, but acceptable,
patch, which I suggest to you.

If it has no nasty side-effects (with multipart messages?), I vote :-)
for its inclusion in RT.

--- lib/RT/Template.pm.orig     Thu Apr  4 15:10:17 2002
+++ lib/RT/Template.pm  Thu Apr  4 15:11:47 2002
@@ -286,7 +286,12 @@
      $body = $content;
   }
 
-  $self->{'MIMEObj'}->attach(Data => $body);
+  my ($type) = "text/plain";
+  if ($RT::MailCharset) {
+      $type .= "; charset=$RT::MailCharset";
+  }
+  $self->{'MIMEObj'}->attach(Type => $type,
+                            Data => $body);
   
   if ($headers) {
     foreach $header (split(/\n/,$headers)) {

--- etc/config.pm.orig      Wed Mar  6 13:50:14 2002
+++ etc/config.pm       Thu Apr  4 15:09:03 2002
@@ -255,6 +255,9 @@
 
 $UseFriendlyToLine = 1;
 
+# Add a charset which you want to be included in *all* outgoing mail messages.
+# Keep it undefined if you want the default.
+#$MailCharset = "iso-8859-15";
 
 # }}}









More information about the rt-users mailing list