git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: imap-send badly handles commit bodies beginning with "From <"

From
MBMagnus Bäck <magnus.back@sonyericsson.com>
Date
Oct 30, 2011, 09:01 UTC
Message-ID
<20111030090111.GA1624@jpl.local>
In-Reply-To
<20111028203256.GA15082@sigill.intra.peff.net>
On Friday, October 28, 2011 at 22:32 CEST,
     Jeff King <peff@peff.net> wrote:
Show 12 quoted lines
> On Fri, Oct 28, 2011 at 01:00:44PM -0500, Andrew Eikum wrote:
> 
> > On the server side, it was split into two mails on either side
> > of that commit message's From line with neither mail actually
> > containing the From line. To fix it, I just changed it to "Copied
> > from <url>:" :-P
> > 
> > Ain't mbox grand?
> 
> Mbox does have this problem, but I think in this case it is a
> particularly crappy implementation of mbox in imap-send. Look at
> imap-send.c:split_msg; it just looks for "From ".

While there seems to be about a million different implementations of mbox creation and parsing, the relevant RFC[0] points to [1] as an authoritative source. The latter claims that lines matching "^From " denote a message boundary and that lines within a message that match the same pattern should be quoted with ">". That would suggest that the problem isn't imap-send.c but whatever code produces the mbox file in the first place. Of course, if that software isn't part of Git I guess we'll have to deal with the situation anyway. And whatever the RFCs say, we still need to be as compatible is possible with whatever software is out there.

> It should at least check for something that looks like a timestamp,
> like git-mailsplit does. Maybe mailsplit's is_from_line should be
> factored out so that it can be reused in imap-send.
I guess that's a reasonable "liberal in what you accept" mitigation.

(As a sidenote, I'm getting the ">From" quoting in my maildir message files where no such quoting is expected, so "From" lines are shown as ">From" in my MUA. I don't know if it's Procmail screwing things up or what's going on.)

[0] http://tools.ietf.org/html/rfc4155 [1] http://qmail.org./man/man5/mbox.html

-- 
Magnus Bäck                   Opinions are my own and do not necessarily
SW Configuration Manager      represent the ones of my employer, etc.
Sony Ericsson
Previous: Jeff KingNext: Jeff King
Message 5 of 8 in “imap-send badly handles commit bodies beginning with "From <"”
  1. Andrew EikumOct 28, 2011
  2. Jeff KingOct 28, 2011
  3. Andrew EikumOct 28, 2011
  4. Jeff KingOct 28, 2011
  5. Magnus BäckOct 30, 2011
  6. Jeff KingNov 1, 2011
  7. Michael HaggertyNov 1, 2011
  8. Jeff KingNov 1, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.