{"thread":{"id":"39854","subject":"git send-email Connection Closed","startedAt":"2015-07-15T05:11:13Z","lastAt":"2015-07-24T14:26:52Z","messageCount":5,"participants":["Juston Li","Mike Rappazzo","Stefan Agner"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"266145","messageId":"CAFow2F9ZFNcBdoc7YTCeGT_PA-UvMyfcKWE4K4ufGMyFXJd5Uw@mail.gmail.com","threadId":"39854","inReplyTo":null,"subject":"git send-email Connection Closed","fromName":"Juston Li","fromEmail":"juston.h.li@gmail.com","sentAt":"2015-07-15T05:11:13Z","receivedAt":"2015-07-15T05:11:13Z","isPatch":false,"sender":{"key":"juston.h.li@gmail.com","avatar":null},"body":"Hello\n\nRecently, I have had trouble using git send-email to send a patchset.\nAfter the confirmation to send the email I get the following:\nSend this email? ([y]es|[n]o|[q]uit|[a]ll): y\n[Net::SMTP::SSL] Connection closed at /usr/lib/git-core/git-send-email\nline 1320.\nfatal: 'send-email' appears to be a git command, but we were not\nable to execute it. Maybe git-send-email is broken?\n\nThis message first appeared when I tried to send a 19 commit patchset\nvia 'git send-email HEAD~19'. It also fails when I try to format-patch\nand send the patchset separately via 'git send-email 0001...'\nOddly enough, it works when I send anything other than 19 commits\nfor example 'git send-email HEAD~1' or 'git send-email HEAD~20'\n\nI thought it was something with the gmail servers but I was able to send\nthe patchset by downgrading a couple perl packages\nwarning: downgrading package perl (5.22.0-1 => 5.20.2-1)\nwarning: downgrading package perl-net-ssleay (1.68-2 => 1.67-1)\n\nNote perl-net-ssleay depends on perl 5.22 so I can't isolate which\npackage but I can consistently get the failure with the newest packges\nand it works fine with the downgraded packages.\n\nRunning Arch Linux\ngit 2.4.5\nperl 5.22.0\nperl-authen-sasl 2.16\nperl-mime-tools 5.505\nperl-net-smtp-ssl 1.03\n\n.gitconfig\n[sendemail]\n    smtpEncryption = tls\n    smtpServer = smtp.gmail.com\n    smtpUser = juston.h.li@gmail.com\n    smtpServerPort = 587\n\nRegards\nJuston\n"},{"id":"266165","messageId":"CANoM8SXv22_CGpK+5b7rzSstkpevPt_KmCW9ZHQNS-2wBmEEVg@mail.gmail.com","threadId":"39854","inReplyTo":"CAFow2F9ZFNcBdoc7YTCeGT_PA-UvMyfcKWE4K4ufGMyFXJd5Uw@mail.gmail.com","subject":"Re: git send-email Connection Closed","fromName":"Mike Rappazzo","fromEmail":"rappazzo@gmail.com","sentAt":"2015-07-15T22:00:35Z","receivedAt":"2015-07-15T22:00:35Z","isPatch":false,"sender":{"key":"rappazzo@gmail.com","avatar":"https://avatars.githubusercontent.com/u/525287?v=4"},"body":"I believe that this is due to gmail not allowing the email.  I think\nthere are two ways to fix this:\n\n1.  Temporarily enable less secure apps for your gmail account while\nyou send the email [see\nhere](https://support.google.com/accounts/answer/6010255?hl=en).\n2.  Setup multi-factor authentication on your account and create an\napp specific password for git-send-email [see\nhere](https://support.google.com/accounts/answer/185833?hl=en)\n\nObviously the second method is more secure.  I have had success with\nboth of these techniques.\n\nOn Wed, Jul 15, 2015 at 1:11 AM, Juston Li <juston.h.li@gmail.com> wrote:\n> Hello\n>\n> Recently, I have had trouble using git send-email to send a patchset.\n> After the confirmation to send the email I get the following:\n> Send this email? ([y]es|[n]o|[q]uit|[a]ll): y\n> [Net::SMTP::SSL] Connection closed at /usr/lib/git-core/git-send-email\n> line 1320.\n> fatal: 'send-email' appears to be a git command, but we were not\n> able to execute it. Maybe git-send-email is broken?\n>\n> This message first appeared when I tried to send a 19 commit patchset\n> via 'git send-email HEAD~19'. It also fails when I try to format-patch\n> and send the patchset separately via 'git send-email 0001...'\n> Oddly enough, it works when I send anything other than 19 commits\n> for example 'git send-email HEAD~1' or 'git send-email HEAD~20'\n>\n> I thought it was something with the gmail servers but I was able to send\n> the patchset by downgrading a couple perl packages\n> warning: downgrading package perl (5.22.0-1 => 5.20.2-1)\n> warning: downgrading package perl-net-ssleay (1.68-2 => 1.67-1)\n>\n> Note perl-net-ssleay depends on perl 5.22 so I can't isolate which\n> package but I can consistently get the failure with the newest packges\n> and it works fine with the downgraded packages.\n>\n> Running Arch Linux\n> git 2.4.5\n> perl 5.22.0\n> perl-authen-sasl 2.16\n> perl-mime-tools 5.505\n> perl-net-smtp-ssl 1.03\n>\n> .gitconfig\n> [sendemail]\n>     smtpEncryption = tls\n>     smtpServer = smtp.gmail.com\n>     smtpUser = juston.h.li@gmail.com\n>     smtpServerPort = 587\n>\n> Regards\n> Juston\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n"},{"id":"266170","messageId":"CAFow2F_MLF_tHNRXcZLuP5i8tu1WFyjhjoALaASO6hMxDMHKgQ@mail.gmail.com","threadId":"39854","inReplyTo":"CANoM8SXv22_CGpK+5b7rzSstkpevPt_KmCW9ZHQNS-2wBmEEVg@mail.gmail.com","subject":"Re: git send-email Connection Closed","fromName":"Juston Li","fromEmail":"juston.h.li@gmail.com","sentAt":"2015-07-16T02:43:42Z","receivedAt":"2015-07-16T02:43:42Z","isPatch":false,"sender":{"key":"juston.h.li@gmail.com","avatar":null},"body":"On Wed, Jul 15, 2015 at 3:00 PM, Mike Rappazzo <rappazzo@gmail.com> wrote:\n> I believe that this is due to gmail not allowing the email.  I think\n> there are two ways to fix this:\n>\n> 1.  Temporarily enable less secure apps for your gmail account while\n> you send the email [see\n> here](https://support.google.com/accounts/answer/6010255?hl=en).\n> 2.  Setup multi-factor authentication on your account and create an\n> app specific password for git-send-email [see\n> here](https://support.google.com/accounts/answer/185833?hl=en)\n>\n> Obviously the second method is more secure.  I have had success with\n> both of these techniques.\n\nYeah it makes sense it is gmail not allowing it, I've resent the patchset\nbefore so maybe it doesn't like the same/similar email sent thinking that\nI am spamming it.\n\nI have 2 factor authentication enabled and use an app specfic password.\n\nThanks\nJuston\n"},{"id":"266726","messageId":"91a8d8eb8767d29a4ed0a96d7a633c37@agner.ch","threadId":"39854","inReplyTo":"CAFow2F9ZFNcBdoc7YTCeGT_PA-UvMyfcKWE4K4ufGMyFXJd5Uw@mail.gmail.com","subject":"Re: git send-email Connection Closed","fromName":"Stefan Agner","fromEmail":"stefan@agner.ch","sentAt":"2015-07-24T12:59:34Z","receivedAt":"2015-07-24T12:59:34Z","isPatch":false,"sender":{"key":"stefan@agner.ch","avatar":"https://avatars.githubusercontent.com/u/34061?v=4"},"body":"Hi Juston,\n\nOn 2015-07-15 07:11, Juston Li wrote:\n> Recently, I have had trouble using git send-email to send a patchset.\n> After the confirmation to send the email I get the following:\n> Send this email? ([y]es|[n]o|[q]uit|[a]ll): y\n> [Net::SMTP::SSL] Connection closed at /usr/lib/git-core/git-send-email\n> line 1320.\n> fatal: 'send-email' appears to be a git command, but we were not\n> able to execute it. Maybe git-send-email is broken?\n> \n> This message first appeared when I tried to send a 19 commit patchset\n> via 'git send-email HEAD~19'. It also fails when I try to format-patch\n> and send the patchset separately via 'git send-email 0001...'\n> Oddly enough, it works when I send anything other than 19 commits\n> for example 'git send-email HEAD~1' or 'git send-email HEAD~20'\n\nJust got a similar message here, without the fatal part, just:\n[Net::SMTP::SSL] Connection closed at /usr/lib/git-core/git-send-email\nline 1320.\n\nIt seems that only one patch is causing the problem (in my case the\nfirst after the cover letter). I use TLS too and send it over a postfix\nSMTP server I maintain myself. The postfix log shows this:\n\npostfix/smtpd[8535]: lost connection after DATA (16357 bytes) from\nunknown[x.y.z.z]\npostfix/smtpd[8535]: disconnect from unknown[x.y.z.z]\n\nSo it seems that the client side disconnects?\n\nI rerun the command with --smtp-debug=1\n\n...\nNet::SMTP::SSL=GLOB(0x1fb3558)>>> +MODULE_LICENSE(\"GPL\");\nNet::SMTP::SSL=GLOB(0x1fb3558)>>> -- \nNet::SMTP::SSL=GLOB(0x1fb3558)>>> 2.4.5\nNet::SMTP::SSL: Net::Cmd::datasend(): unexpected EOF on command channel:\n at /usr/lib/git-core/git-send-email line 1320.\n[Net::SMTP::SSL] Connection closed at /usr/lib/git-core/git-send-email\nline 1320.\n\nIt seems to me that there is a size limit, after cutting down the patch\nto ~16K, sending started to work. I cut it twice, once by removing lines\nfrom the head and once from the bottom, in both cases at the size of\naround 16K I could send the patch.\n \n> I thought it was something with the gmail servers but I was able to send\n> the patchset by downgrading a couple perl packages\n> warning: downgrading package perl (5.22.0-1 => 5.20.2-1)\n> warning: downgrading package perl-net-ssleay (1.68-2 => 1.67-1)\n> \n> Note perl-net-ssleay depends on perl 5.22 so I can't isolate which\n> package but I can consistently get the failure with the newest packges\n> and it works fine with the downgraded packages.\n> \n> Running Arch Linux\n> git 2.4.5\n> perl 5.22.0\n> perl-authen-sasl 2.16\n> perl-mime-tools 5.505\n> perl-net-smtp-ssl 1.03\n\nSame versions here, unfortunately I can't downgrade because I recently\ncleared my package cache :-(\n\n--\nStefan\n"},{"id":"266727","messageId":"66194061e3b38a203af399ba4fd8e4be@agner.ch","threadId":"39854","inReplyTo":"91a8d8eb8767d29a4ed0a96d7a633c37@agner.ch","subject":"Re: git send-email Connection Closed","fromName":"Stefan Agner","fromEmail":"stefan@agner.ch","sentAt":"2015-07-24T14:26:52Z","receivedAt":"2015-07-24T14:26:52Z","isPatch":false,"sender":{"key":"stefan@agner.ch","avatar":"https://avatars.githubusercontent.com/u/34061?v=4"},"body":"On 2015-07-24 14:59, Stefan Agner wrote:\n> Hi Juston,\n> \n> On 2015-07-15 07:11, Juston Li wrote:\n>> Recently, I have had trouble using git send-email to send a patchset.\n>> After the confirmation to send the email I get the following:\n>> Send this email? ([y]es|[n]o|[q]uit|[a]ll): y\n>> [Net::SMTP::SSL] Connection closed at /usr/lib/git-core/git-send-email\n>> line 1320.\n>> fatal: 'send-email' appears to be a git command, but we were not\n>> able to execute it. Maybe git-send-email is broken?\n>>\n>> This message first appeared when I tried to send a 19 commit patchset\n>> via 'git send-email HEAD~19'. It also fails when I try to format-patch\n>> and send the patchset separately via 'git send-email 0001...'\n>> Oddly enough, it works when I send anything other than 19 commits\n>> for example 'git send-email HEAD~1' or 'git send-email HEAD~20'\n> \n> Just got a similar message here, without the fatal part, just:\n> [Net::SMTP::SSL] Connection closed at /usr/lib/git-core/git-send-email\n> line 1320.\n> \n> It seems that only one patch is causing the problem (in my case the\n> first after the cover letter). I use TLS too and send it over a postfix\n> SMTP server I maintain myself. The postfix log shows this:\n> \n> postfix/smtpd[8535]: lost connection after DATA (16357 bytes) from\n> unknown[x.y.z.z]\n> postfix/smtpd[8535]: disconnect from unknown[x.y.z.z]\n> \n> So it seems that the client side disconnects?\n> \n> I rerun the command with --smtp-debug=1\n> \n> ...\n> Net::SMTP::SSL=GLOB(0x1fb3558)>>> +MODULE_LICENSE(\"GPL\");\n> Net::SMTP::SSL=GLOB(0x1fb3558)>>> -- \n> Net::SMTP::SSL=GLOB(0x1fb3558)>>> 2.4.5\n> Net::SMTP::SSL: Net::Cmd::datasend(): unexpected EOF on command channel:\n>  at /usr/lib/git-core/git-send-email line 1320.\n> [Net::SMTP::SSL] Connection closed at /usr/lib/git-core/git-send-email\n> line 1320.\n> \n> It seems to me that there is a size limit, after cutting down the patch\n> to ~16K, sending started to work. I cut it twice, once by removing lines\n> from the head and once from the bottom, in both cases at the size of\n> around 16K I could send the patch.\n\nI found a work-around by using datasend line by line, which did the job\nfor me:\n\nAltering /usr/lib/git-core/git-send-email, around line 1320:\n\n                $smtp->datasend(\"$header\\n\") or die $smtp->message;\n                my @lines = split /^/, $message;\n                foreach my $line (@lines) {\n                        $smtp->datasend(\"$line\") or die $smtp->message;\n                }\n\n--\nStefan\n"}]}