bug-gnats
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Gnats & MIME


From: Yngve Svendsen
Subject: Re: Gnats & MIME
Date: Mon, 19 Feb 2001 18:17:01 +0100

At 17:01 19.02.2001 +0100, Palle Girgensohn wrote:
Hi!

Has anyone tried to get gnats to behave more politely with
MIMEified mails. Now, it will not work at all if the subject is
mimified (by for example, correctly embedding Swedish åäö
characters with ?ISO?8859... stuff). Also, messages can look
pretty ugly, with lots of '=E5' for every ä etc...

I'm running 3.113. Will this behave better in version 4? Has
anyone patched gnats?

/Palle

Use a script to translate quoted printables. The following little Perl script does this (yes, it might be tad unelegant, but it works):

#########################
#!/usr/bin/perl

use MIME::QuotedPrint ();
while (<>) {
  $line = $_;
  $line =~ s/=\?iso-8859-1\?Q\?//i;
  $line =~ s/\?=//g;

  if ($line =~ /^Subject/ ) {
      $line =~ tr/_/ /;
  };

  if ($line =~ /^From/ ) {
      $line =~ tr/_/ /;
  };

  $line = MIME::QuotedPrint::decode($line);

  print $line;
};

########################

Then set up the mail alias which receives bug reports to pipe messages through this script before it is piped into queue-pr. Like this:

| /path-to-script/script.pl | /usr/local/libexec/gnats/queue-pr -q

Warning: this seems to break recognition of PR numbers when people reply by mail to PRs. I believe this to be because the regexp in file-pr that handles mail subject recognition breaks down when it encounters anything beyond 7-bit ASCII. The consequence is that if a PR that has such characters in the Subject is replied to by mail, file-pr will create a new problem report with a new number. A workaround is to remove the qp translation of the Subject line in the script above.

I haven't had time to look at the Subject recognition problem, so if someone else would care to take a peek at file-pr.c and see if they can find a solution, I'd be thankful.

Yngve Svendsen
IS Engineer
Clustra AS, Trondheim, Norway
yngve.svendsen@clustra.com




reply via email to

[Prev in Thread] Current Thread [Next in Thread]