{"thread":{"id":"16290","subject":"[PATCH v2] contrib/hooks/post-receive-email: send individual mails to recipients","startedAt":"2008-11-12T16:50:15Z","lastAt":"2008-11-12T18:01:10Z","messageCount":4,"participants":["Michael Adam","Johannes Sixt","Junio C Hamano"],"isPatch":true,"patchVersion":2,"patchTotal":null},"messages":[{"id":"95580","messageId":"E1L0Iv1-00BwsF-Jh@intern.SerNet.DE","threadId":"16290","inReplyTo":null,"subject":"[PATCH v2] contrib/hooks/post-receive-email: send individual mails to recipients","fromName":"Michael Adam","fromEmail":"obnox@samba.org","sentAt":"2008-11-12T16:50:15Z","receivedAt":"2008-11-12T16:50:15Z","isPatch":true,"sender":{"key":"obnox@samba.org","avatar":"https://gravatar.com/avatar/5318dd087ca600cb3218a415d282e1615817cbfc2cc9eaf00da4b9237554701b?d=mp&s=160"},"body":"This changes the behaviour of post-receive-email when a list of recipients\n(separated by commas) is specified as hooks.mailinglist. With this modification,\nan individual mail is sent out for each recipient entry in the list, instead\nof sending a single mail with all the recipients in the \"To: \" field.\n\nSigned-off-by: Michael Adam <obnox@samba.org>\n---\nSorry, in the first version of the patch, I forgot to\nadapt the generate_email_header() function fill the \"To\"\nfield only with \"$recipient\" instad of \"$recipients\".\n\nCheers - Michael\n\n contrib/hooks/post-receive-email |   32 ++++++++++++++++++--------------\n 1 files changed, 18 insertions(+), 14 deletions(-)\n\ndiff --git a/contrib/hooks/post-receive-email b/contrib/hooks/post-receive-email\nindex 28a3c0e..f8bbeab 100644\n--- a/contrib/hooks/post-receive-email\n+++ b/contrib/hooks/post-receive-email\n@@ -169,21 +169,25 @@ generate_email()\n \t\tdescribe=$rev\n \tfi\n \n-\tgenerate_email_header\n+\t# loop over the recipients to send individual mails\n+\techo $recipients | sed -e 's/\\s*,\\s*/\\n/' | while read recipient\n+\tdo\n+\t\tgenerate_email_header\n \n-\t# Call the correct body generation function\n-\tfn_name=general\n-\tcase \"$refname_type\" in\n-\t\"tracking branch\"|branch)\n-\t\tfn_name=branch\n-\t\t;;\n-\t\"annotated tag\")\n-\t\tfn_name=atag\n-\t\t;;\n-\tesac\n-\tgenerate_${change_type}_${fn_name}_email\n+\t\t# Call the correct body generation function\n+\t\tfn_name=general\n+\t\tcase \"$refname_type\" in\n+\t\t\"tracking branch\"|branch)\n+\t\t\tfn_name=branch\n+\t\t\t;;\n+\t\t\"annotated tag\")\n+\t\t\tfn_name=atag\n+\t\t\t;;\n+\t\tesac\n+\t\tgenerate_${change_type}_${fn_name}_email\n \n-\tgenerate_email_footer\n+\t\tgenerate_email_footer\n+\tdone\n }\n \n generate_email_header()\n@@ -191,7 +195,7 @@ generate_email_header()\n \t# --- Email (all stdout will be the email)\n \t# Generate header\n \tcat <<-EOF\n-\tTo: $recipients\n+\tTo: $recipient\n \tSubject: ${emailprefix}$projectdesc $refname_type, $short_refname, ${change_type}d. $describe\n \tX-Git-Refname: $refname\n \tX-Git-Reftype: $refname_type\n-- \n1.5.6\n"},{"id":"95582","messageId":"491B0D9B.7080306@viscovery.net","threadId":"16290","inReplyTo":"E1L0Iv1-00BwsF-Jh@intern.SerNet.DE","subject":"Re: [PATCH v2] contrib/hooks/post-receive-email: send individual mails to recipients","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2008-11-12T17:08:43Z","receivedAt":"2008-11-12T17:08:43Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Michael Adam schrieb:\n> This changes the behaviour of post-receive-email when a list of recipients\n> (separated by commas) is specified as hooks.mailinglist. With this modification,\n> an individual mail is sent out for each recipient entry in the list, instead\n> of sending a single mail with all the recipients in the \"To: \" field.\n\nI don't think this is well-behaved:\n\n- The load multiplies for the sender (typically a repository server).\n\n- And wouldn't each recipient get a new Message-Id? This would break\nthreading if further communication takes place among the recipients.\n\nBut I may be wrong on both accounts.\n\n-- Hannes\n"},{"id":"95593","messageId":"E1L0JjD-00ByqG-1I@intern.SerNet.DE","threadId":"16290","inReplyTo":"491B0D9B.7080306@viscovery.net","subject":"Re: [PATCH v2] contrib/hooks/post-receive-email: send individual mails to recipients","fromName":"Michael Adam","fromEmail":"obnox@samba.org","sentAt":"2008-11-12T17:42:06Z","receivedAt":"2008-11-12T17:42:06Z","isPatch":true,"sender":{"key":"obnox@samba.org","avatar":"https://gravatar.com/avatar/5318dd087ca600cb3218a415d282e1615817cbfc2cc9eaf00da4b9237554701b?d=mp&s=160"},"body":"Johannes Sixt wrote:\n> Michael Adam schrieb:\n> > This changes the behaviour of post-receive-email when a list of recipients\n> > (separated by commas) is specified as hooks.mailinglist. With this modification,\n> > an individual mail is sent out for each recipient entry in the list, instead\n> > of sending a single mail with all the recipients in the \"To: \" field.\n> \n> I don't think this is well-behaved:\n> \n> - The load multiplies for the sender (typically a repository server).\n\nThis is right.\n\n> - And wouldn't each recipient get a new Message-Id? This would break\n> threading if further communication takes place among the recipients.\n\nMy idea was that different recipients have different threading anyways.\nOK, threading for multiple recipients can be conserved with group replies.\nI thought that usually you specify a single mailing list as recipient.\nMy use case is that I have additional recipients that do not necessarily\nwant to be seen as recipients on the mailing list that is specified as\nthe primary recipient.\n\n> But I may be wrong on both accounts.\n\nYour concerns are surely valid.\nMaybe it would be useful to make this optional?\n\nThanks for your comments!\n\nCheers - Michael\n\n-- \nMichael Adam <ma@sernet.de>  <obnox@samba.org>\nSerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen\nphone: +49-551-370000-0, fax: +49-551-370000-9\nAG Göttingen, HRB 2816, GF: Dr. Johannes Loxen\nhttp://www.SerNet.DE, mailto: Info @ SerNet.DE\n"},{"id":"95607","messageId":"7vbpwkq0wp.fsf@gitster.siamese.dyndns.org","threadId":"16290","inReplyTo":"E1L0JjD-00ByqG-1I@intern.SerNet.DE","subject":"Re: [PATCH v2] contrib/hooks/post-receive-email: send individual mails to recipients","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-11-12T18:01:10Z","receivedAt":"2008-11-12T18:01:10Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Michael Adam <obnox@samba.org> writes:\n\n> Johannes Sixt wrote:\n>> Michael Adam schrieb:\n>> > This changes the behaviour of post-receive-email when a list of recipients\n>> > (separated by commas) is specified as hooks.mailinglist. With this modification,\n>> > an individual mail is sent out for each recipient entry in the list, instead\n>> > of sending a single mail with all the recipients in the \"To: \" field.\n>> \n>> I don't think this is well-behaved:\n> ...\n> Your concerns are surely valid.\n> Maybe it would be useful to make this optional?\n\nWhat benefit could anybody possibly get by making this optional?\n\nIf you do not want to show multiple names on To: header to the mail\nrecipients, there already is a well-known solution, and it is called\n(surprise!) mailing list ;-)\n"}]}