{"thread":{"id":"5679","subject":"git send-email woes","startedAt":"2006-09-24T22:43:16Z","lastAt":"2006-09-26T04:11:30Z","messageCount":6,"participants":["Sam Ravnborg","Junio C Hamano","David Miller"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"27590","messageId":"20060924224316.GA28051@uranus.ravnborg.org","threadId":"5679","inReplyTo":null,"subject":"git send-email woes","fromName":"Sam Ravnborg","fromEmail":"sam@ravnborg.org","sentAt":"2006-09-24T22:43:16Z","receivedAt":"2006-09-24T22:43:16Z","isPatch":false,"sender":{"key":"sam@ravnborg.org","avatar":"https://gravatar.com/avatar/168a912606ed0742d840bb365e3cc21db390c36531a58341dc7a069cc1f15f62?d=mp&s=160"},"body":"I stumbled on two issues with git-send-email today.\nFirst of I forgot to tell where to find the patch files to send.\nBut git-send-email only complained _after_ I had given all\nthe information manually.\nIt would have been niver to check that all mandatory arguments\nwas present before being interactive.\n\nThe second issue are best explained quoting a mail from Matti Arnio:\n> > The GIT is at times producing emails that are not\n> > utterly strictly speaking kosher RFC-(2)822 format.\n> >\n> > It might be a surprise to you that unquoted dots in\n> > people's names cause syntax scanner indigestion,\n> > because said character has very special meaning in\n> > RFC-822 syntax.  All would be fine if\n> >     Example J.P. Example <example@example.net>\n> > had couple quotes:\n> >     \"Example J.P. Example\" <example@example.net>\n\nWhat I could see was that git-send-email takes mail address\nverbatim from \"Signed-off-by:\" lines and use it.\nWould it be possible to always quote it except when quoted\nor to do a more intelligent RFC2822 check?\n\nThat would keep suprises lower.\n\nI'm not good a perlish so I have not attempted fixing it myself...\n\n\tSam\n"},{"id":"27634","messageId":"20060925183221.GE2490@uranus.ravnborg.org","threadId":"5679","inReplyTo":"20060924224316.GA28051@uranus.ravnborg.org","subject":"Re: git send-email woes","fromName":"Sam Ravnborg","fromEmail":"sam@ravnborg.org","sentAt":"2006-09-25T18:32:21Z","receivedAt":"2006-09-25T18:32:21Z","isPatch":false,"sender":{"key":"sam@ravnborg.org","avatar":"https://gravatar.com/avatar/168a912606ed0742d840bb365e3cc21db390c36531a58341dc7a069cc1f15f62?d=mp&s=160"},"body":"On Mon, Sep 25, 2006 at 12:43:16AM +0200, Sam Ravnborg wrote:\n> I stumbled on two issues with git-send-email today.\n> First of I forgot to tell where to find the patch files to send.\n> But git-send-email only complained _after_ I had given all\n> the information manually.\n> It would have been niver to check that all mandatory arguments\n> was present before being interactive.\n> \n> The second issue are best explained quoting a mail from Matti Arnio:\n> > > The GIT is at times producing emails that are not\n> > > utterly strictly speaking kosher RFC-(2)822 format.\n> > >\n> > > It might be a surprise to you that unquoted dots in\n> > > people's names cause syntax scanner indigestion,\n> > > because said character has very special meaning in\n> > > RFC-822 syntax.  All would be fine if\n> > >     Example J.P. Example <example@example.net>\n> > > had couple quotes:\n> > >     \"Example J.P. Example\" <example@example.net>\n> \n> What I could see was that git-send-email takes mail address\n> verbatim from \"Signed-off-by:\" lines and use it.\nThe patches in quistion did not have a \"Signed-off-by: tag so\nthat mail address has been from the author instead.\nAnd this mail address was still invalid as per RFC2822.\n\n> Would it be possible to always quote it except when quoted\n> or to do a more intelligent RFC2822 check?\n> \n> That would keep suprises lower.\n> \n> I'm not good a perlish so I have not attempted fixing it myself...\n\n\tSam\n"},{"id":"27635","messageId":"7v7izrzpk2.fsf@assigned-by-dhcp.cox.net","threadId":"5679","inReplyTo":"20060925183221.GE2490@uranus.ravnborg.org","subject":"Re: git send-email woes","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-09-25T19:58:21Z","receivedAt":"2006-09-25T19:58:21Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sam Ravnborg <sam@ravnborg.org> writes:\n\n> The patches in quistion did not have a \"Signed-off-by: tag so\n> that mail address has been from the author instead.\n> And this mail address was still invalid as per RFC2822.\n\nI do not think it takes Signed-off-by: as author in any case\n(and I do not think it should -- if it did so it is a bug).\n\nMaybe something like this?\n\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex 746c525..b4a34f4 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -431,6 +431,11 @@ sub send_message\n \t    $gitversion =~ s/^.* //;\n \t}\n \n+\tmy ($author_name) = ($from =~ /^(.*?)\\s+</);\n+\tif ($author_name =~ /\\./ && $author_name !~ /^\".*\"$/) {\n+\t\tmy ($name, $addr) = ($from =~ /^(.*?)(\\s+<.*)/);\n+\t\t$from = \"\\\"$name\\\"$addr\";\n+\t}\n \tmy $header = \"From: $from\n To: $to\n Cc: $cc\n"},{"id":"27638","messageId":"20060925.141740.122618728.davem@davemloft.net","threadId":"5679","inReplyTo":"7v7izrzpk2.fsf@assigned-by-dhcp.cox.net","subject":"Re: git send-email woes","fromName":"David Miller","fromEmail":"davem@davemloft.net","sentAt":"2006-09-25T21:17:40Z","receivedAt":"2006-09-25T21:17:40Z","isPatch":false,"sender":{"key":"davem@davemloft.net","avatar":null},"body":"From: Junio C Hamano <junkio@cox.net>\nDate: Mon, 25 Sep 2006 12:58:21 -0700\n\n> Sam Ravnborg <sam@ravnborg.org> writes:\n> \n> > The patches in quistion did not have a \"Signed-off-by: tag so\n> > that mail address has been from the author instead.\n> > And this mail address was still invalid as per RFC2822.\n> \n> I do not think it takes Signed-off-by: as author in any case\n> (and I do not think it should -- if it did so it is a bug).\n> \n> Maybe something like this?\n\nThat looks like it would do the trick.\n"},{"id":"27640","messageId":"20060925215127.GA3965@uranus.ravnborg.org","threadId":"5679","inReplyTo":"7v7izrzpk2.fsf@assigned-by-dhcp.cox.net","subject":"Re: git send-email woes","fromName":"Sam Ravnborg","fromEmail":"sam@ravnborg.org","sentAt":"2006-09-25T21:51:27Z","receivedAt":"2006-09-25T21:51:27Z","isPatch":false,"sender":{"key":"sam@ravnborg.org","avatar":"https://gravatar.com/avatar/168a912606ed0742d840bb365e3cc21db390c36531a58341dc7a069cc1f15f62?d=mp&s=160"},"body":"On Mon, Sep 25, 2006 at 12:58:21PM -0700, Junio C Hamano wrote:\n> Sam Ravnborg <sam@ravnborg.org> writes:\n> \n> > The patches in quistion did not have a \"Signed-off-by: tag so\n> > that mail address has been from the author instead.\n> > And this mail address was still invalid as per RFC2822.\n> \n> I do not think it takes Signed-off-by: as author in any case\n> (and I do not think it should -- if it did so it is a bug).\n> \n> Maybe something like this?\n> \n> diff --git a/git-send-email.perl b/git-send-email.perl\n> index 746c525..b4a34f4 100755\n> --- a/git-send-email.perl\n> +++ b/git-send-email.perl\n> @@ -431,6 +431,11 @@ sub send_message\n>  \t    $gitversion =~ s/^.* //;\n>  \t}\n>  \n> +\tmy ($author_name) = ($from =~ /^(.*?)\\s+</);\n> +\tif ($author_name =~ /\\./ && $author_name !~ /^\".*\"$/) {\n> +\t\tmy ($name, $addr) = ($from =~ /^(.*?)(\\s+<.*)/);\n> +\t\t$from = \"\\\"$name\\\"$addr\";\n> +\t}\n>  \tmy $header = \"From: $from\n>  To: $to\n>  Cc: $cc\n> \nI would assume we had to do the same for all mail addresses?\nIn this case also for $to and $cc and $reply_to.\n\n\tSam\n"},{"id":"27648","messageId":"7vvenbuv0t.fsf@assigned-by-dhcp.cox.net","threadId":"5679","inReplyTo":"20060925215127.GA3965@uranus.ravnborg.org","subject":"Re: git send-email woes","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-09-26T04:11:30Z","receivedAt":"2006-09-26T04:11:30Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sam Ravnborg <sam@ravnborg.org> writes:\n\n>> @@ -431,6 +431,11 @@ sub send_message\n>>  \t    $gitversion =~ s/^.* //;\n>>  \t}\n>>  \n>> +\tmy ($author_name) = ($from =~ /^(.*?)\\s+</);\n>> +\tif ($author_name =~ /\\./ && $author_name !~ /^\".*\"$/) {\n>> +\t\tmy ($name, $addr) = ($from =~ /^(.*?)(\\s+<.*)/);\n>> +\t\t$from = \"\\\"$name\\\"$addr\";\n>> +\t}\n>>  \tmy $header = \"From: $from\n>>  To: $to\n>>  Cc: $cc\n>> \n> I would assume we had to do the same for all mail addresses?\n> In this case also for $to and $cc and $reply_to.\n\nI do not think so, although I admit I only had a cursory look at\nthe code.  In this part of the code, $to and $cc are coming from\nreturn value of unique_email_list sub, which cleanses each\naddress with extract_valid_address sub.  This sub does:\n\n\tA U Thor <foo@bar.baz> => foo@bar.baz\n\nIn other words, I think it is only \"$from\" that needs it.\n\nI think $to and $cc should not strip out the human-readable name,\nbut in this case it saved us extra trouble.   Sigh...\n"}]}