{"thread":{"id":"5810","subject":"git-send-email w/ headers","startedAt":"2006-10-04T16:50:50Z","lastAt":"2006-10-07T04:40:48Z","messageCount":6,"participants":["Len Brown","Junio C Hamano","David Woodhouse"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"28213","messageId":"200610041250.50272.len.brown@intel.com","threadId":"5810","inReplyTo":null,"subject":"git-send-email w/ headers","fromName":"Len Brown","fromEmail":"len.brown@intel.com","sentAt":"2006-10-04T16:50:50Z","receivedAt":"2006-10-04T16:50:50Z","isPatch":false,"sender":{"key":"len.brown@intel.com","avatar":"https://gravatar.com/avatar/a091f34f66caadb51d85a8a496800c6ccae73737e2f45762373e6b8c55fa5dd6?d=mp&s=160"},"body":"git-send-email seems to strip out my custom headers.\n\ngit-format-patch says it can do this:\n\nCONFIGURATION\nYou can specify extra mail header lines to be added to each message in the repository configuration as follows:\nheaders = \"Organization: git-foo\\n\"\n\nSo I have this:\n$ cat .git/config\n[format]\n        headers = Reply-To: Len Brown <lenb@kernel.org>\\nOrganization: Intel Open Source Technology Center\\n\n\n$ git-format-patch -o foo -n --thread master..lenb\nseems to correctly pick up the headers:\n\n$ cat foo/0001-test-create-junk.txt\nFrom 6706b39a213064d00af0ec58a159b71b0719a3b4 Mon Sep 17 00:00:00 2001\nMessage-Id: <6706b39a213064d00af0ec58a159b71b0719a3b4.1159941986.git.len.brown@intel.com>\nFrom: Len Brown <len.brown@intel.com>\nReply-To: Len Brown <lenb@kernel.org>\nOrganization: Intel Open Source Technology Center\nDate: Wed, 4 Oct 2006 01:11:12 -0400\nSubject: [PATCH 1/14] test: create junk\n\nSigned-off-by: Len Brown <len.brown@intel.com>\n---\n junk |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/junk b/junk\nnew file mode 100644\nindex 0000000..9ecf3cf\n--- /dev/null\n+++ b/junk\n@@ -0,0 +1 @@\n+this\n--\n1.4.2.3.g128e\n\n$ git-send-email  --no-chain-reply-to --compose --to lenb@kernel.org --smtp-server smpt.comcast.net --suppress-from foo\n\nand i receive a message w/o the Organization and Reply-to headers:\n\n$ cat ~/Documents/test.e-mail-received\nFrom len.brown@intel.com Wed Oct  4 12:34:51 2006\nReturn-Path: <len.brown@intel.com>\nReceived: from alnrmhc12.comcast.net (alnrmhc12.comcast.net [206.18.177.52])\n        by hera.kernel.org (8.13.7/8.13.7) with ESMTP id k94GVifO030722\n        for <lenb@kernel.org>; Wed, 4 Oct 2006 16:32:17 GMT\nReceived: from localhost.localdomain (c-65-96-213-102.hsd1.ma.comcast.net[65.96.213.102])\n          by comcast.net (alnrmhc12) with SMTP\n          id <20061004163139b1200eq2t6e>; Wed, 4 Oct 2006 16:31:39 +0000\nFrom: Len Brown <len.brown@intel.com>\nTo: lenb@kernel.org\nCc: Len Brown <len.brown@intel.com>\nSubject: [PATCH 1/14] test: create junk\nDate: Wed,  4 Oct 2006 12:34:51 -0400\nMessage-Id: <11599796921715-git-send-email-len.brown@intel.com>\nX-Mailer: git-send-email 1.4.2.3.g128e\nIn-Reply-To: <11599796913223-git-send-email-len.brown@intel.com>\nReferences: <11599796913223-git-send-email-len.brown@intel.com>\nX-Virus-Scanned: ClamAV 0.88.4/1997/Wed Oct  4 15:20:43 2006 on hera.kernel.org\nX-Virus-Status: Clean\nX-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,\n        FORGED_RCVD_HELO autolearn=ham version=3.1.3\nX-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on hera.kernel.org\nStatus: R\nX-Status: NGC\nX-KMail-EncryptionState:\nX-KMail-SignatureState:\nX-KMail-MDN-Sent:\n\nSigned-off-by: Len Brown <len.brown@intel.com>\n---\n junk |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/junk b/junk\nnew file mode 100644\nindex 0000000..9ecf3cf\n--- /dev/null\n+++ b/junk\n@@ -0,0 +1 @@\n+this\n--\n1.4.2.3.g128e\n\nSame thing happens if I use the SMTP server inside Intel.\nI haven't figured out how to send directly via kernel.org using this command\nkmail uses a password and ssh to talk to kernel.org.\nThis is actually sort of an issue too, because smtp.comcast.net\nlimits the number of messages sent per connection and\nwill drop after 10 messages with this:\nrequested action aborted: too many messages on a single connection\n\nthanks,\n-Len\n"},{"id":"28260","messageId":"7viriy9w1q.fsf@assigned-by-dhcp.cox.net","threadId":"5810","inReplyTo":"200610041250.50272.len.brown@intel.com","subject":"Re: git-send-email w/ headers","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-10-05T23:34:25Z","receivedAt":"2006-10-05T23:34:25Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Len Brown <len.brown@intel.com> writes:\n\n> git-send-email seems to strip out my custom headers.\n\nIt seems to not care about anything but a selected few.\n\nCould you give this a try, please?\n\n-- >8 --\ngit-send-email: do not drop custom headers the user prepared\n\nThe command picked up only Subject, CC, and From headers in the\nincoming mbox text.  Sending out patches prepared by\ngit-format-patch with user's custom headers was impossible with\nthat.\n\nJust keep the ones it does not need to look at and add them to\nthe header of the message when sending it out.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n---\n\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex 4a20310..77e4557 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -83,7 +83,7 @@ # Constants (essentially)\n my $compose_filename = \".msg.$$\";\n \n # Variables we fill in automatically, or via prompting:\n-my (@to,@cc,@initial_cc,@bcclist,\n+my (@to,@cc,@initial_cc,@bcclist,@xh,\n \t$initial_reply_to,$initial_subject,@files,$from,$compose,$time);\n \n # Behavior modification variables\n@@ -422,6 +422,9 @@ X-Mailer: git-send-email $gitversion\n \t\t$header .= \"In-Reply-To: $reply_to\\n\";\n \t\t$header .= \"References: $references\\n\";\n \t}\n+\tif (@xh) {\n+\t\t$header .= join(\"\\n\", @xh);\n+\t}\n \n \tif ($smtp_server =~ m#^/#) {\n \t\tmy $pid = open my $sm, '|-';\n@@ -472,6 +475,7 @@ foreach my $t (@files) {\n \n \tmy $author_not_sender = undef;\n \t@cc = @initial_cc;\n+\t@xh = ();\n \tmy $found_mbox = 0;\n \tmy $header_done = 0;\n \t$message = \"\";\n@@ -495,6 +499,9 @@ foreach my $t (@files) {\n \t\t\t\t\t\t$2, $_) unless $quiet;\n \t\t\t\t\tpush @cc, $2;\n \t\t\t\t}\n+\t\t\t\telsif (/^[-A-Za-z]+:\\s+\\S/) {\n+\t\t\t\t\tpush @xh, $_;\n+\t\t\t\t}\n \n \t\t\t} else {\n \t\t\t\t# In the traditional\n"},{"id":"28268","messageId":"200610060041.56807.len.brown@intel.com","threadId":"5810","inReplyTo":"7viriy9w1q.fsf@assigned-by-dhcp.cox.net","subject":"Re: git-send-email w/ headers","fromName":"Len Brown","fromEmail":"len.brown@intel.com","sentAt":"2006-10-06T04:41:56Z","receivedAt":"2006-10-06T04:41:56Z","isPatch":false,"sender":{"key":"len.brown@intel.com","avatar":"https://gravatar.com/avatar/a091f34f66caadb51d85a8a496800c6ccae73737e2f45762373e6b8c55fa5dd6?d=mp&s=160"},"body":"On Thursday 05 October 2006 19:34, Junio C Hamano wrote:\n> Len Brown <len.brown@intel.com> writes:\n> \n> > git-send-email seems to strip out my custom headers.\n> \n> It seems to not care about anything but a selected few.\n> \n> Could you give this a try, please?\n\nThe good news is that the message received now includes the custom headers\nfrom the original message.\n\nBut the Signed-off-by: line from the original message body\nhas now been swallowed up into the message header -- so my mailer doesn't display it.\n\nthanks,\n-Len\n\nOriginal Message:\nFrom 42f19e47f7e720cce936e4fdbaa979b6d4cf2f13 Mon Sep 17 00:00:00 2001\nMessage-Id: <42f19e47f7e720cce936e4fdbaa979b6d4cf2f13.1160108957.git.len.brown@intel.com>\nFrom: Len Brown <len.brown@intel.com>\nDate: Wed, 4 Oct 2006 01:11:12 -0400\nSubject: [PATCH 1/14] test: create junk\nReply-To: Len Brown <lenb@kernel.org>\nOrganization: Intel Open Source Technology Center\n\nSigned-off-by: Len Brown <len.brown@intel.com>\n---\n junk |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/junk b/junk\nnew file mode 100644\nindex 0000000..9ecf3cf\n--- /dev/null\n+++ b/junk\n@@ -0,0 +1 @@\n+this\n--\n1.4.2.3.gabd6-dirty\n\nReceived Message:\n\nReturn-Path: <len.brown@intel.com>\n Received: from alnrmhc13.comcast.net (alnrmhc13.comcast.net [206.18.177.53])\n        by hera.kernel.org (8.13.7/8.13.7) with ESMTP id k964RZPa026442\n        for <lenb@kernel.org>; Fri, 6 Oct 2006 04:28:01 GMT\n Received: from localhost.localdomain (c-65-96-213-102.hsd1.ma.comcast.net[65.96.213.102])\n          by comcast.net (alnrmhc13) with SMTP\n          id <20061006042729b1300l5679e>; Fri, 6 Oct 2006 04:27:30 +0000\n From: Len Brown <len.brown@intel.com>\n To: lenb@kernel.org\n Cc: Len Brown <len.brown@intel.com>\n Subject: [PATCH 1/14] test: create junk\n Date: Fri,  6 Oct 2006 00:30:29 -0400\n Message-Id: <11601090432143-git-send-email-len.brown@intel.com>\n X-Mailer: git-send-email 1.4.2.3.gabd6-dirty\n In-Reply-To: <1160109042971-git-send-email-len.brown@intel.com>\n References: <1160109042971-git-send-email-len.brown@intel.com>\n Message-Id: <42f19e47f7e720cce936e4fdbaa979b6d4cf2f13.1160108957.git.len.brown@intel.com>\n Date: Wed, 4 Oct 2006 01:11:12 -0400\n Reply-To: Len Brown <lenb@kernel.org>\n Organization: Intel Open Source Technology Center\n Signed-off-by: Len Brown <len.brown@intel.com>\n X-Virus-Scanned: ClamAV 0.88.4/1999/Thu Oct  5 17:35:38 2006 on hera.kernel.org\n X-Virus-Status: Clean\n X-Spam-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00,\n        FORGED_RCVD_HELO,INVALID_DATE autolearn=no version=3.1.3\n X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on hera.kernel.org\n Status: R\n X-Status: NGC\n X-KMail-EncryptionState: \n X-KMail-SignatureState: \n X-KMail-MDN-Sent: \n Content-Type: \n \n---\n junk |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/junk b/junk\nnew file mode 100644\nindex 0000000..9ecf3cf\n--- /dev/null\n+++ b/junk\n@@ -0,0 +1 @@\n+this\n-- \n1.4.2.3.gabd6-dirty\n"},{"id":"28270","messageId":"7v1wpm2cxd.fsf@assigned-by-dhcp.cox.net","threadId":"5810","inReplyTo":"200610060041.56807.len.brown@intel.com","subject":"Re: git-send-email w/ headers","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-10-06T06:09:18Z","receivedAt":"2006-10-06T06:09:18Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Len Brown <len.brown@intel.com> writes:\n\n> But the Signed-off-by: line from the original message body has\n> now been swallowed up into the message header -- so my mailer\n> doesn't display it.\n\nSorry, what I sent out has worse breakage than not having your\ncustom header.  It would eat the first paragraph of your message\nX-<.\n\nA replacement patch is attached.  If you have already applied\nthe previous patch, you can hand edit the line that says:\n\n\t$header .= join(\"\\n\", @xh);\n\nto\n\n\t$header .= join(\"\\n\", @xh) . \"\\n\";\n\nIt forgets to end the last line of the headers with LF.\n\n---\n\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex 3f50aba..2fd5e87 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -83,7 +83,7 @@ # Constants (essentially)\n my $compose_filename = \".msg.$$\";\n \n # Variables we fill in automatically, or via prompting:\n-my (@to,@cc,@initial_cc,@bcclist,\n+my (@to,@cc,@initial_cc,@bcclist,@xh,\n \t$initial_reply_to,$initial_subject,@files,$from,$compose,$time);\n \n # Behavior modification variables\n@@ -422,6 +422,9 @@ X-Mailer: git-send-email $gitversion\n \t\t$header .= \"In-Reply-To: $reply_to\\n\";\n \t\t$header .= \"References: $references\\n\";\n \t}\n+\tif (@xh) {\n+\t\t$header .= join(\"\\n\", @xh) . \"\\n\";\n+\t}\n \n \tif ($smtp_server =~ m#^/#) {\n \t\tmy $pid = open my $sm, '|-';\n@@ -472,6 +475,7 @@ foreach my $t (@files) {\n \n \tmy $author_not_sender = undef;\n \t@cc = @initial_cc;\n+\t@xh = ();\n \tmy $found_mbox = 0;\n \tmy $header_done = 0;\n \t$message = \"\";\n@@ -495,6 +499,9 @@ foreach my $t (@files) {\n \t\t\t\t\t\t$2, $_) unless $quiet;\n \t\t\t\t\tpush @cc, $2;\n \t\t\t\t}\n+\t\t\t\telsif (/^[-A-Za-z]+:\\s+\\S/) {\n+\t\t\t\t\tpush @xh, $_;\n+\t\t\t\t}\n \n \t\t\t} else {\n \t\t\t\t# In the traditional\n"},{"id":"28302","messageId":"1160153530.4795.51.camel@pmac.infradead.org","threadId":"5810","inReplyTo":"7viriy9w1q.fsf@assigned-by-dhcp.cox.net","subject":"Re: git-send-email w/ headers","fromName":"David Woodhouse","fromEmail":"dwmw2@infradead.org","sentAt":"2006-10-06T16:52:10Z","receivedAt":"2006-10-06T16:52:10Z","isPatch":false,"sender":{"key":"dwmw2@infradead.org","avatar":"https://gravatar.com/avatar/7afd4f07e0cf7d7e046ae2d23678296b37777c96488e6f3451e78a5514154ebd?d=mp&s=160"},"body":"On Thu, 2006-10-05 at 16:34 -0700, Junio C Hamano wrote:\n> Len Brown <len.brown@intel.com> writes:\n> \n> > git-send-email seems to strip out my custom headers.\n> \n> It seems to not care about anything but a selected few.\n> \n> Could you give this a try, please? \n\nIt also needs to preserve (and indeed to provide by default)\nContent-Type headers to specify the character set.\n\n-- \ndwmw2\n"},{"id":"28337","messageId":"200610070040.48919.len.brown@intel.com","threadId":"5810","inReplyTo":"7v1wpm2cxd.fsf@assigned-by-dhcp.cox.net","subject":"Re: git-send-email w/ headers","fromName":"Len Brown","fromEmail":"len.brown@intel.com","sentAt":"2006-10-07T04:40:48Z","receivedAt":"2006-10-07T04:40:48Z","isPatch":false,"sender":{"key":"len.brown@intel.com","avatar":"https://gravatar.com/avatar/a091f34f66caadb51d85a8a496800c6ccae73737e2f45762373e6b8c55fa5dd6?d=mp&s=160"},"body":"On Friday 06 October 2006 02:09, Junio C Hamano wrote:\n> Len Brown <len.brown@intel.com> writes:\n> \n> > But the Signed-off-by: line from the original message body has\n> > now been swallowed up into the message header -- so my mailer\n> > doesn't display it.\n> \n> Sorry, what I sent out has worse breakage than not having your\n> custom header.  It would eat the first paragraph of your message\n> X-<.\n> \n> A replacement patch is attached. \n\nLatest patch seems to be doing the right thing (included below).\n\nHowever, I've discovered another rough edge.\ngit-send-email offers to --compose an initial message, but it doesn't\npick up the .git/config header like git-format-patch does:\n\n$ cat .git/config\n[format]\n        headers = Reply-To: Len Brown <lenb@kernel.org>\\nOrganization: Intel Open Source Technology Center\\n\n\nthanks,\n-Len\n\nReturn-Path: <len.brown@intel.com>\n Received: from sccrmhc13.comcast.net (sccrmhc13.comcast.net [63.240.77.83])\n        by hera.kernel.org (8.13.7/8.13.7) with ESMTP id k974Of6m010205\n        for <lenb@kernel.org>; Sat, 7 Oct 2006 04:25:09 GMT\n Received: from localhost.localdomain (c-65-96-213-102.hsd1.ma.comcast.net[65.96.213.102])\n          by comcast.net (sccrmhc13) with SMTP\n          id <2006100704243601300452mke>; Sat, 7 Oct 2006 04:24:36 +0000\n From: Len Brown <len.brown@intel.com>\n To: lenb@kernel.org\n Cc: Len Brown <len.brown@intel.com>\n Subject: [PATCH 1/14] test: create junk\n Date: Sat,  7 Oct 2006 00:27:35 -0400\n Message-Id: <11601952702774-git-send-email-len.brown@intel.com>\n X-Mailer: git-send-email 1.4.2.3.gabd6-dirty\n In-Reply-To: <11601952681813-git-send-email-len.brown@intel.com>\n References: <11601952681813-git-send-email-len.brown@intel.com>\n Message-Id: <7488d8f01c21a6411ad99c1d16e95ecd6e1542a6.1160195250.git.len.brown@intel.com>\n Date: Wed, 4 Oct 2006 01:11:12 -0400\n Reply-To: Len Brown <lenb@kernel.org>\n Organization: Intel Open Source Technology Center\n X-Virus-Scanned: ClamAV 0.88.4/2002/Fri Oct  6 22:58:03 2006 on hera.kernel.org\n X-Virus-Status: Clean\n X-Spam-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_00,\n        FORGED_RCVD_HELO,INVALID_DATE autolearn=no version=3.1.3\n X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on hera.kernel.org\n Status: R\n X-Status: NGC\n X-KMail-EncryptionState: \n X-KMail-SignatureState: \n X-KMail-MDN-Sent: \n \nSigned-off-by: Len Brown <len.brown@intel.com>\n---\n junk |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/junk b/junk\nnew file mode 100644\nindex 0000000..9ecf3cf\n--- /dev/null\n+++ b/junk\n@@ -0,0 +1 @@\n+this\n-- \n1.4.2.3.gabd6-dirty\n"}]}