[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
GNATS and MIME
From: |
Yngve Svendsen |
Subject: |
GNATS and MIME |
Date: |
Tue, 20 Feb 2001 15:19:33 +0100 |
This went to bug-gnats yesterday, but I'm sending this to gnats-devel as
well, since it contains a request for volunteers to look into a problem
(see the end of the message).
Anyone out there with a little bit of coding experience and a tiny bit of
spare time?
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 routine 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 looked 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
address@hidden
- GNATS and MIME,
Yngve Svendsen <=