public inbox for gnats-devel@sourceware.org
 help / color / mirror / Atom feed
* GNATS and MIME
@ 2001-02-20  6:23 Yngve Svendsen
       [not found] ` <87wvalgohn.fsf@zamazal.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Yngve Svendsen @ 2001-02-20  6:23 UTC (permalink / raw)
  To: gnats-devel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2187 bytes --]

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
yngve.svendsen@clustra.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: GNATS and MIME
       [not found] ` <87wvalgohn.fsf@zamazal.org>
@ 2001-02-20 13:06   ` Yngve Svendsen
  0 siblings, 0 replies; 2+ messages in thread
From: Yngve Svendsen @ 2001-02-20 13:06 UTC (permalink / raw)
  To: Milan Zamazal; +Cc: gnats-devel

At 20:09 20.02.2001 +0100, Milan Zamazal wrote:
>Though the presented Perl script can serve as an acceptably good
>workaround for some sites, it's necessary to find a real solution
>sometimes.  I think GNATS should handle non-ASCII e-mails, in both
>directions, itself.  However the issue is non-trivial, when solving it
>we should probably not limit GNATS to 8-bit encodings and should work on
>it together with overall GNATS internationalization.
>
>I'm personally not going to solve the problem until GNATS 4 is released.

I agree. This needs to find a better solution, and the Perl script is no 
more than acceptable. It might not be too much work, since fairly good 
library functions shouldexist for this kind of thing. I really wish I was a 
stronger programmer.

But let this serve as an invitation to everyone with a bit of free time on 
their hands to join us.

- Yngve

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-02-20 13:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-02-20  6:23 GNATS and MIME Yngve Svendsen
     [not found] ` <87wvalgohn.fsf@zamazal.org>
2001-02-20 13:06   ` Yngve Svendsen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).