Re: [RFC 0/1] mailinfo: de-quote quoted-pair in header fields
- From
Jeff King <peff@peff.net>
- Date
- Sep 15, 2016, 07:18 UTC
- Message-ID
- <20160915071822.dpfgg7yldtzar4b2@sigill.intra.peff.net>
- In-Reply-To
- <20160915051533.GC26893@ikke.info>
On Thu, Sep 15, 2016 at 07:15:33AM +0200, Kevin Daudt wrote:
Show 20 quoted lines
> > > Another small thing I am not sure about is if the \ quoting can hide > > > an embedded newline in the author name. Would we end up turning > > > > > > From: "Jeff \ > > > King" <peff@peff.net> > > > > > > or somesuch into > > > > > > Author: Jeff > > > King > > > Email: peff@peff.net > > > > > > ;-) > > > > Heh, yeah. That is another reason to clean up and sanitize as much as > > possible before stuffing it into another text format that will be > > parsed. > > A quoted string cannot contain newlines according to the RFC, so I think > we don't need to care about that.
I wondered how we handled something like:
From: =?UTF-8?q?J=0Aff=20King?= <peff@peff.net>
which sticks a newline into the middle of the buffer. We do decode it that way, but eventually call cleanup_space() which converts a run of 1 or more isspace() characters into a single space (0x20). So you end up with:
Author: J ff King
which is probably reasonable.
> Makes sense, the current itteration of my patch already strips exterior > quotes, no matter where they happen. > > I will send a patch soon.
Great. Thanks for working on this.
-Peff