public inbox for gnats-devel@sourceware.org
 help / color / mirror / Atom feed
From: Yngve Svendsen <yngve.svendsen@clustra.com>
To: gnats-devel@sources.redhat.com
Subject: GNATS and MIME
Date: Tue, 20 Feb 2001 06:23:00 -0000	[thread overview]
Message-ID: <5.1.0.7.2.20010220151323.0563fc88@mail.trd.clustra.com> (raw)

[-- 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

             reply	other threads:[~2001-02-20  6:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-02-20  6:23 Yngve Svendsen [this message]
     [not found] ` <87wvalgohn.fsf@zamazal.org>
2001-02-20 13:06   ` Yngve Svendsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5.1.0.7.2.20010220151323.0563fc88@mail.trd.clustra.com \
    --to=yngve.svendsen@clustra.com \
    --cc=gnats-devel@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).