{"thread":{"id":"30762","subject":"How can I specify the \"sendmail\" program for git-send-email?","startedAt":"2012-06-11T07:32:32Z","lastAt":"2012-06-11T16:25:47Z","messageCount":9,"participants":["Richard Yang","Erik Faye-Lund","konglu@minatec.inpg.fr","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"193286","messageId":"20120611073232.GA5602@richard","threadId":"30762","inReplyTo":null,"subject":"How can I specify the \"sendmail\" program for git-send-email?","fromName":"Richard Yang","fromEmail":"weiyang@linux.vnet.ibm.com","sentAt":"2012-06-11T07:32:32Z","receivedAt":"2012-06-11T07:32:32Z","isPatch":false,"sender":{"key":"weiyang@linux.vnet.ibm.com","avatar":null},"body":"Hi, experts\n\nI read the git-send-email manual and find the --smtp-server option can\nspecify the sendmail-like program to send mail.\n\nThen I use this option in command line \n--smtp-server=/usr/bin/msmtp\nThis works.\n\nWhile I found it not very convenient to write the option on command line\nevery time, then I wrote it in the .gitconfig file in my home directory.\n\n[sendmail]\n\tsmtpserver = /usr/bin/msmtp\n\tsmtppass       = 123456\n\tsmtpuser       = weiyang@linux.vnet.ibm.com\n        smtpserverport = 143\n\nWhile this time I don't use the --smtp-server option in command line. \n\nAnd seems this time, it doesn't use the msmpt to send mail, since this\ntime it fails.\n\nThen my second approach is not correct? \n\n-- \nRichard Yang\nHelp you, Help me\n"},{"id":"193287","messageId":"CABPQNSbwtP0hp8QYznwXjLAaoKVj_ZUWXQQCDG80Xb+TME1MWw@mail.gmail.com","threadId":"30762","inReplyTo":"20120611073232.GA5602@richard","subject":"Re: How can I specify the \"sendmail\" program for git-send-email?","fromName":"Erik Faye-Lund","fromEmail":"kusmabite@gmail.com","sentAt":"2012-06-11T08:23:21Z","receivedAt":"2012-06-11T08:23:21Z","isPatch":false,"sender":{"key":"kusmabite@gmail.com","avatar":"https://avatars.githubusercontent.com/u/47073?v=4"},"body":"On Mon, Jun 11, 2012 at 9:32 AM, Richard Yang\n<weiyang@linux.vnet.ibm.com> wrote:\n> Hi, experts\n>\n> I read the git-send-email manual and find the --smtp-server option can\n> specify the sendmail-like program to send mail.\n>\n> Then I use this option in command line\n> --smtp-server=/usr/bin/msmtp\n> This works.\n>\n> While I found it not very convenient to write the option on command line\n> every time, then I wrote it in the .gitconfig file in my home directory.\n>\n> [sendmail]\n>        smtpserver = /usr/bin/msmtp\n>        smtppass       = 123456\n>        smtpuser       = weiyang@linux.vnet.ibm.com\n>        smtpserverport = 143\n\nThe configuration-section for git send-mail is actually spelled\n\"sendemail\", and not \"sendmail\". Notice the additional 'e'.\n\nhttp://git-scm.com/docs/git-send-email\n"},{"id":"193289","messageId":"20120611090431.GA23447@richard","threadId":"30762","inReplyTo":"CABPQNSbwtP0hp8QYznwXjLAaoKVj_ZUWXQQCDG80Xb+TME1MWw@mail.gmail.com","subject":"Re: How can I specify the \"sendmail\" program for git-send-email?","fromName":"Richard Yang","fromEmail":"weiyang@linux.vnet.ibm.com","sentAt":"2012-06-11T09:04:31Z","receivedAt":"2012-06-11T09:04:31Z","isPatch":false,"sender":{"key":"weiyang@linux.vnet.ibm.com","avatar":null},"body":"On Mon, Jun 11, 2012 at 10:23:21AM +0200, Erik Faye-Lund wrote:\n>On Mon, Jun 11, 2012 at 9:32 AM, Richard Yang\n><weiyang@linux.vnet.ibm.com> wrote:\n>> Hi, experts\n>>\n>> I read the git-send-email manual and find the --smtp-server option can\n>> specify the sendmail-like program to send mail.\n>>\n>> Then I use this option in command line\n>> --smtp-server=/usr/bin/msmtp\n>> This works.\n>>\n>> While I found it not very convenient to write the option on command line\n>> every time, then I wrote it in the .gitconfig file in my home directory.\n>>\n>> [sendmail]\n>>        smtpserver = /usr/bin/msmtp\n>>        smtppass       = 123456\n>>        smtpuser       = weiyang@linux.vnet.ibm.com\n>>        smtpserverport = 143\n>\n>The configuration-section for git send-mail is actually spelled\n>\"sendemail\", and not \"sendmail\". Notice the additional 'e'.\nOops, a stupid mistake.\n\nThanks all :)\n>\n>http://git-scm.com/docs/git-send-email\n\n-- \nRichard Yang\nHelp you, Help me\n"},{"id":"193290","messageId":"CABPQNSZ1dyAfCVLGcLxbeBdS_9A_arYOhzgKBtndReK5zxu_MA@mail.gmail.com","threadId":"30762","inReplyTo":"20120611090431.GA23447@richard","subject":"Re: How can I specify the \"sendmail\" program for git-send-email?","fromName":"Erik Faye-Lund","fromEmail":"kusmabite@gmail.com","sentAt":"2012-06-11T09:15:02Z","receivedAt":"2012-06-11T09:15:02Z","isPatch":false,"sender":{"key":"kusmabite@gmail.com","avatar":"https://avatars.githubusercontent.com/u/47073?v=4"},"body":"On Mon, Jun 11, 2012 at 11:04 AM, Richard Yang\n<weiyang@linux.vnet.ibm.com> wrote:\n> On Mon, Jun 11, 2012 at 10:23:21AM +0200, Erik Faye-Lund wrote:\n>>On Mon, Jun 11, 2012 at 9:32 AM, Richard Yang\n>><weiyang@linux.vnet.ibm.com> wrote:\n>>> Hi, experts\n>>>\n>>> I read the git-send-email manual and find the --smtp-server option can\n>>> specify the sendmail-like program to send mail.\n>>>\n>>> Then I use this option in command line\n>>> --smtp-server=/usr/bin/msmtp\n>>> This works.\n>>>\n>>> While I found it not very convenient to write the option on command line\n>>> every time, then I wrote it in the .gitconfig file in my home directory.\n>>>\n>>> [sendmail]\n>>>        smtpserver = /usr/bin/msmtp\n>>>        smtppass       = 123456\n>>>        smtpuser       = weiyang@linux.vnet.ibm.com\n>>>        smtpserverport = 143\n>>\n>>The configuration-section for git send-mail is actually spelled\n>>\"sendemail\", and not \"sendmail\". Notice the additional 'e'.\n> Oops, a stupid mistake.\n>\n> Thanks all :)\n\nWell, I've always been slightly annoyed by the \"send-mail\" vs\n\"sendemail\" inconsistency. Perhaps we could do something along these\nlines (plus all documentation-updates, omitted for clarity) to reduce\nthe risk of confusion?\n\nYeah, the leaking of $identity between different sections is a bit\nsuboptimal, but as a fallback-mechanism I don't think it actually\nmatters much.\n\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex 03292fd..d167d96 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -375,7 +375,11 @@ sub read_config {\n \t}\n }\n\n-# read configuration from [sendemail \"$identity\"], fall back on [sendemail]\n+# read configuration from [sendmail \"$identity\"], fall back on [sendmail]\n+$identity = Git::config(@repo, \"sendmail.identity\") unless (defined $identity);\n+read_config(\"sendmail.$identity\") if (defined $identity);\n+read_config(\"sendmail\");\n+# same as above, but with legacy \"sendemail\"\n $identity = Git::config(@repo, \"sendemail.identity\") unless (defined\n$identity);\n read_config(\"sendemail.$identity\") if (defined $identity);\n read_config(\"sendemail\");\n"},{"id":"193291","messageId":"20120611112516.Horde.jg0rcXwdC4BP1bl8bOMwLoA@webmail.minatec.grenoble-inp.fr","threadId":"30762","inReplyTo":"CABPQNSZ1dyAfCVLGcLxbeBdS_9A_arYOhzgKBtndReK5zxu_MA@mail.gmail.com","subject":"Re: How can I specify the \"sendmail\" program for git-send-email?","fromName":"","fromEmail":"konglu@minatec.inpg.fr","sentAt":"2012-06-11T09:25:16Z","receivedAt":"2012-06-11T09:25:16Z","isPatch":false,"sender":{"key":"konglu@minatec.inpg.fr","avatar":null},"body":"\nErik Faye-Lund <kusmabite@gmail.com> a écrit :\n\n> Well, I've always been slightly annoyed by the \"send-mail\" vs\n> \"sendemail\" inconsistency. Perhaps we could do something along these\n> lines (plus all documentation-updates, omitted for clarity) to reduce\n> the risk of confusion?\n>\n> Yeah, the leaking of $identity between different sections is a bit\n> suboptimal, but as a fallback-mechanism I don't think it actually\n> matters much.\n\n[...]\n\n> -# read configuration from [sendemail \"$identity\"], fall back on [sendemail]\n> +# read configuration from [sendmail \"$identity\"], fall back on [sendmail]\n> +$identity = Git::config(@repo, \"sendmail.identity\") unless (defined  \n> $identity);\n> +read_config(\"sendmail.$identity\") if (defined $identity);\n> +read_config(\"sendmail\");\n> +# same as above, but with legacy \"sendemail\"\n>  $identity = Git::config(@repo, \"sendemail.identity\") unless (defined\n> $identity);\n>  read_config(\"sendemail.$identity\") if (defined $identity);\n>  read_config(\"sendemail\");\n\nI'm not very familiar with perl, but do you mean to replace \"sendemail\" by\n\"sendmail\" or just make \"sendmail\" usable in the config file, along with\n\"sendemail\" ?\n"},{"id":"193292","messageId":"CABPQNSYYsNTxPRhL5LM_c-KcruAhzKmqvDTNzpS09ukpQ=sbvw@mail.gmail.com","threadId":"30762","inReplyTo":"20120611112516.Horde.jg0rcXwdC4BP1bl8bOMwLoA@webmail.minatec.grenoble-inp.fr","subject":"Re: How can I specify the \"sendmail\" program for git-send-email?","fromName":"Erik Faye-Lund","fromEmail":"kusmabite@gmail.com","sentAt":"2012-06-11T09:45:14Z","receivedAt":"2012-06-11T09:45:14Z","isPatch":false,"sender":{"key":"kusmabite@gmail.com","avatar":"https://avatars.githubusercontent.com/u/47073?v=4"},"body":"On Mon, Jun 11, 2012 at 11:25 AM,  <konglu@minatec.inpg.fr> wrote:\n>\n> Erik Faye-Lund <kusmabite@gmail.com> a écrit :\n>\n>\n>> Well, I've always been slightly annoyed by the \"send-mail\" vs\n>> \"sendemail\" inconsistency. Perhaps we could do something along these\n>> lines (plus all documentation-updates, omitted for clarity) to reduce\n>> the risk of confusion?\n>>\n>> Yeah, the leaking of $identity between different sections is a bit\n>> suboptimal, but as a fallback-mechanism I don't think it actually\n>> matters much.\n>\n>\n> [...]\n>\n>\n>> -# read configuration from [sendemail \"$identity\"], fall back on\n>> [sendemail]\n>> +# read configuration from [sendmail \"$identity\"], fall back on [sendmail]\n>> +$identity = Git::config(@repo, \"sendmail.identity\") unless (defined\n>> $identity);\n>> +read_config(\"sendmail.$identity\") if (defined $identity);\n>> +read_config(\"sendmail\");\n>> +# same as above, but with legacy \"sendemail\"\n>>  $identity = Git::config(@repo, \"sendemail.identity\") unless (defined\n>> $identity);\n>>  read_config(\"sendemail.$identity\") if (defined $identity);\n>>  read_config(\"sendemail\");\n>\n>\n> I'm not very familiar with perl, but do you mean to replace \"sendemail\" by\n> \"sendmail\" or just make \"sendmail\" usable in the config file, along with\n> \"sendemail\" ?\n\nI meant to switch to \"sendmail\", but keep \"sendemail\" around to be\nbackwards compatible. At some point in the future it might make sense\nto remove the support for \"sendemail\", though.\n"},{"id":"193295","messageId":"20120611121335.Horde.NUDqUXwdC4BP1cTP77JwT6A@webmail.minatec.grenoble-inp.fr","threadId":"30762","inReplyTo":"CABPQNSYYsNTxPRhL5LM_c-KcruAhzKmqvDTNzpS09ukpQ=sbvw@mail.gmail.com","subject":"Re: How can I specify the \"sendmail\" program for git-send-email?","fromName":"","fromEmail":"konglu@minatec.inpg.fr","sentAt":"2012-06-11T10:13:35Z","receivedAt":"2012-06-11T10:13:35Z","isPatch":false,"sender":{"key":"konglu@minatec.inpg.fr","avatar":null},"body":"\nErik Faye-Lund <kusmabite@gmail.com> a écrit :\n\n> I meant to switch to \"sendmail\", but keep \"sendemail\" around to be\n> backwards compatible.\n\nSounds good to me. That would avoid everyone to change their config file\nand, for those who haven't set [sendemail], it would be more natural to\ntype \"sendmail\" than \"sendemail\" (that's my personal opinion though).\n"},{"id":"193319","messageId":"7v4nqh96z5.fsf@alter.siamese.dyndns.org","threadId":"30762","inReplyTo":"CABPQNSZ1dyAfCVLGcLxbeBdS_9A_arYOhzgKBtndReK5zxu_MA@mail.gmail.com","subject":"Re: How can I specify the \"sendmail\" program for git-send-email?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-06-11T15:57:34Z","receivedAt":"2012-06-11T15:57:34Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Erik Faye-Lund <kusmabite@gmail.com> writes:\n\n> Well, I've always been slightly annoyed by the \"send-mail\" vs\n> \"sendemail\" inconsistency.\n\nHrm, isn't it between \"sendmail\" (as in /usr/lib/sendmail) and\n\"send-email\" (a subcommand of git)?\n\n> Perhaps we could do something along these\n> lines (plus all documentation-updates, omitted for clarity) to reduce\n> the risk of confusion?\n\nAssuming that the contrast between \"sendmail\" and \"git send-email\"\nis what you are trying to address, I fail to see how it would help\nreducing the confusion if you start naming configuration variables\nused by \"git send-email\" without E.\n\nIf the proposal were to give \"send-email.$var\" synomyms to\ncorresponding \"sendemail.$var\" variables, I would have been\npersuaded to believe it may alleviate potential confusion, though.\n\n> Yeah, the leaking of $identity between different sections is a bit\n> suboptimal, but as a fallback-mechanism I don't think it actually\n> matters much.\n>\n> diff --git a/git-send-email.perl b/git-send-email.perl\n> index 03292fd..d167d96 100755\n> --- a/git-send-email.perl\n> +++ b/git-send-email.perl\n> @@ -375,7 +375,11 @@ sub read_config {\n>  \t}\n>  }\n>\n> -# read configuration from [sendemail \"$identity\"], fall back on [sendemail]\n> +# read configuration from [sendmail \"$identity\"], fall back on [sendmail]\n> +$identity = Git::config(@repo, \"sendmail.identity\") unless (defined $identity);\n> +read_config(\"sendmail.$identity\") if (defined $identity);\n> +read_config(\"sendmail\");\n> +# same as above, but with legacy \"sendemail\"\n>  $identity = Git::config(@repo, \"sendemail.identity\") unless (defined\n> $identity);\n>  read_config(\"sendemail.$identity\") if (defined $identity);\n>  read_config(\"sendemail\");\n"},{"id":"193323","messageId":"CABPQNSaLtdGVfdkQyRFn4_Ze84zGVuvPwxTpr3hY8uDc0WU2Zg@mail.gmail.com","threadId":"30762","inReplyTo":"7v4nqh96z5.fsf@alter.siamese.dyndns.org","subject":"Re: How can I specify the \"sendmail\" program for git-send-email?","fromName":"Erik Faye-Lund","fromEmail":"kusmabite@gmail.com","sentAt":"2012-06-11T16:25:47Z","receivedAt":"2012-06-11T16:25:47Z","isPatch":false,"sender":{"key":"kusmabite@gmail.com","avatar":"https://avatars.githubusercontent.com/u/47073?v=4"},"body":"On Mon, Jun 11, 2012 at 5:57 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Erik Faye-Lund <kusmabite@gmail.com> writes:\n>\n>> Well, I've always been slightly annoyed by the \"send-mail\" vs\n>> \"sendemail\" inconsistency.\n>\n> Hrm, isn't it between \"sendmail\" (as in /usr/lib/sendmail) and\n> \"send-email\" (a subcommand of git)?\n>\n\nUgh, you are right. My brain must have been defective :)\n\n>> Perhaps we could do something along these\n>> lines (plus all documentation-updates, omitted for clarity) to reduce\n>> the risk of confusion?\n>\n> Assuming that the contrast between \"sendmail\" and \"git send-email\"\n> is what you are trying to address, I fail to see how it would help\n> reducing the confusion if you start naming configuration variables\n> used by \"git send-email\" without E.\n>\n\nNo, this was just me being a moron.\n\n> If the proposal were to give \"send-email.$var\" synomyms to\n> corresponding \"sendemail.$var\" variables, I would have been\n> persuaded to believe it may alleviate potential confusion, though.\n\nThis was really the way I wanted to go, but I somehow got unsure about\nthe legality of the dashes in config sections. I'm a bit skeptical to\nintroducing new non-letter characters if we don't have to.\n\nSo let's just drop my suggestion. I wasn't thinking straight.\n"}]}