git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Krzysztof Mazur <krzysiek@podlesie.net>
Cc: Alexey Shumkin <Alex.Crezoff@gmail.com>,
	git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH] send-email: Honor multi-part email messages
Date: Fri, 25 Jan 2013 17:24:11 -0500	[thread overview]
Message-ID: <20130125222411.GD23626@sigill.intra.peff.net> (raw)
In-Reply-To: <20130125174700.GA3700@shrek.podlesie.net>

On Fri, Jan 25, 2013 at 06:47:00PM +0100, Krzysztof Mazur wrote:

> On Fri, Jan 25, 2013 at 07:28:54PM +0400, Alexey Shumkin wrote:
> > "git format-patch --attach/--inline" generates multi-part messages.
> > Every part of such messages can contain non-ASCII characters with its own
> > "Content-Type" and "Content-Transfer-Encoding" headers.
> > But git-send-mail script interprets a patch-file as one-part message
> > and does not recognize multi-part messages.
> > So already quoted printable email subject may be encoded as quoted printable
> > again. Due to this bug email subject looks corrupted in email clients.
> 
> I don't think that the problem with the Subject is multi-part message
> specific. The real problem with the Subject is probably that
> is_rfc2047_quoted() does not detect that the Subject is already quoted.

I have not even looked at this problem at all, but seeing this function
name:

> >  sub body_or_subject_has_nonascii {

Makes me think something is very wrong. The subject line should not have
anything to do whatsoever with a content-type or
content-transfer-encoding header. It should either be rfc2047 encoded or
not, and the encoding used does not have to correspond to what is used
elsewhere in the message. rfc2047 is very clear that other MIME headers
are not necessary to interpret encoded words in headers.

So this loop:

	foreach my $f (@files) {
	        next unless (body_or_subject_has_nonascii($f)
	                     && !file_declares_8bit_cte($f));
	        $broken_encoding{$f} = 1;
	}

does not seem right at all. Only the body depends on the 8bit CTE.

-Peff

  reply	other threads:[~2013-01-25 22:24 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-25 15:28 [PATCH resent] send-email: Honor multi-part email messages Alexey Shumkin
2013-01-25 15:28 ` [PATCH] " Alexey Shumkin
2013-01-25 17:47   ` Krzysztof Mazur
2013-01-25 22:24     ` Jeff King [this message]
2013-01-25 18:14 ` [PATCH resent] " Junio C Hamano
  -- strict thread matches above, loose matches on Subject: below --
2011-09-20  8:29 [PATCH] " Alexey Shumkin
2011-09-20 19:26 ` Junio C Hamano
2011-09-20 20:19   ` Alexey Shumkin
2013-01-24 10:38     ` Alexey Shumkin
2013-01-24 18:11       ` Junio C Hamano
2013-01-24 18:31         ` Shumkin Alexey
2013-01-24 19:11           ` Junio C Hamano
2011-09-16 22:32 Alexey Shumkin

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=20130125222411.GD23626@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=Alex.Crezoff@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=krzysiek@podlesie.net \
    /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 NNTP newsgroup(s).