git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / Atom feed
From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: Siddharth Chandrasekaran <siddharth@embedjournal.com>
Cc: gitster <gitster@pobox.com>, git <git@vger.kernel.org>
Subject: Re: git-am fails for emails with UTF8 characters in email header
Date: Fri, 13 Sep 2019 22:20:44 +0000
Message-ID: <20190913222044.GR11334@genre.crustytoothpaste.net> (raw)
In-Reply-To: <16d2c3ccc40.b3c71baf1200589.723645117669598677@embedjournal.com>

[-- Attachment #1: Type: text/plain, Size: 1854 bytes --]

On 2019-09-13 at 20:07:24, Siddharth Chandrasekaran wrote:
> Hi Junio,
> 
> My email server (zoho) puts leading UTF-8 non-breaking spaces ("\xC2\xA0")
> when folding long mail headers. Due to this, git-am is failing as it expects
> only '\t' or ' ' characters.
> 
> RFC2822 [1] on page 7 states:
> 
> > The general rule is that wherever this standard allows for folding white
> > space (not simply WSP characters), a CRLF may be inserted before any WSP.
> 
> It appears the RFC isn't too strict about ASCII only headers (correct me if I'm
> wrong here); ergo, if the mail file is in UTF-8, isn't logical to expect UTF-8
> whitespace characters also to be allowed in the fold/unfold of headers?

RFC 5322 (the email specification) doesn't allow non-ASCII characters
anywhere in the header of an email.  RFC 6532, which allows UTF-8 in
header fields if the message is transported via SMTP using the SMTPUTF8
extension, doesn't allow UTF-8 characters to appear in the WSP
production, and therefore doesn't allow them as folding whitespace.
Only space and tab are permitted in WSP.

It appears that your mail server is broken, and it would probably be
best to get it fixed instead of trying to get git-am to work with it.
There are servers which reject messages which are malformed, and even if
your mail gets delivered, there are a bunch of mail clients which will
mishandle it.

> I was able to get git-am to work with modifications to read_one_header_line()
> in mailinfo.c need your view on whether a patch is necessary for this. If so, I can
> send a patch for this.

I don't think such a patch would be a good idea.  I definitely think we
should support SMTPUTF8 and internationalized email, but this particular
issue isn't such a case.
-- 
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 868 bytes --]

      reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-13 20:07 Siddharth Chandrasekaran
2019-09-13 22:20 ` brian m. carlson [this message]

Reply instructions:

You may reply publically 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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=20190913222044.GR11334@genre.crustytoothpaste.net \
    --to=sandals@crustytoothpaste.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=siddharth@embedjournal.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

git@vger.kernel.org list mirror (unofficial, one of many)

Archives are clonable:
	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.org/gmane.comp.version-control.git

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox