git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
* git send-email Connection Closed
@ 2015-07-15  5:11 Juston Li
  2015-07-15 22:00 ` Mike Rappazzo
  2015-07-24 12:59 ` Stefan Agner
  0 siblings, 2 replies; 5+ messages in thread
From: Juston Li @ 2015-07-15  5:11 UTC (permalink / raw)
  To: git

Hello

Recently, I have had trouble using git send-email to send a patchset.
After the confirmation to send the email I get the following:
Send this email? ([y]es|[n]o|[q]uit|[a]ll): y
[Net::SMTP::SSL] Connection closed at /usr/lib/git-core/git-send-email
line 1320.
fatal: 'send-email' appears to be a git command, but we were not
able to execute it. Maybe git-send-email is broken?

This message first appeared when I tried to send a 19 commit patchset
via 'git send-email HEAD~19'. It also fails when I try to format-patch
and send the patchset separately via 'git send-email 0001...'
Oddly enough, it works when I send anything other than 19 commits
for example 'git send-email HEAD~1' or 'git send-email HEAD~20'

I thought it was something with the gmail servers but I was able to send
the patchset by downgrading a couple perl packages
warning: downgrading package perl (5.22.0-1 => 5.20.2-1)
warning: downgrading package perl-net-ssleay (1.68-2 => 1.67-1)

Note perl-net-ssleay depends on perl 5.22 so I can't isolate which
package but I can consistently get the failure with the newest packges
and it works fine with the downgraded packages.

Running Arch Linux
git 2.4.5
perl 5.22.0
perl-authen-sasl 2.16
perl-mime-tools 5.505
perl-net-smtp-ssl 1.03

.gitconfig
[sendemail]
    smtpEncryption = tls
    smtpServer = smtp.gmail.com
    smtpUser = juston.h.li@gmail.com
    smtpServerPort = 587

Regards
Juston

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: git send-email Connection Closed
  2015-07-15  5:11 git send-email Connection Closed Juston Li
@ 2015-07-15 22:00 ` Mike Rappazzo
  2015-07-16  2:43   ` Juston Li
  2015-07-24 12:59 ` Stefan Agner
  1 sibling, 1 reply; 5+ messages in thread
From: Mike Rappazzo @ 2015-07-15 22:00 UTC (permalink / raw)
  To: Juston Li; +Cc: Git List

I believe that this is due to gmail not allowing the email.  I think
there are two ways to fix this:

1.  Temporarily enable less secure apps for your gmail account while
you send the email [see
here](https://support.google.com/accounts/answer/6010255?hl=en).
2.  Setup multi-factor authentication on your account and create an
app specific password for git-send-email [see
here](https://support.google.com/accounts/answer/185833?hl=en)

Obviously the second method is more secure.  I have had success with
both of these techniques.

On Wed, Jul 15, 2015 at 1:11 AM, Juston Li <juston.h.li@gmail.com> wrote:
> Hello
>
> Recently, I have had trouble using git send-email to send a patchset.
> After the confirmation to send the email I get the following:
> Send this email? ([y]es|[n]o|[q]uit|[a]ll): y
> [Net::SMTP::SSL] Connection closed at /usr/lib/git-core/git-send-email
> line 1320.
> fatal: 'send-email' appears to be a git command, but we were not
> able to execute it. Maybe git-send-email is broken?
>
> This message first appeared when I tried to send a 19 commit patchset
> via 'git send-email HEAD~19'. It also fails when I try to format-patch
> and send the patchset separately via 'git send-email 0001...'
> Oddly enough, it works when I send anything other than 19 commits
> for example 'git send-email HEAD~1' or 'git send-email HEAD~20'
>
> I thought it was something with the gmail servers but I was able to send
> the patchset by downgrading a couple perl packages
> warning: downgrading package perl (5.22.0-1 => 5.20.2-1)
> warning: downgrading package perl-net-ssleay (1.68-2 => 1.67-1)
>
> Note perl-net-ssleay depends on perl 5.22 so I can't isolate which
> package but I can consistently get the failure with the newest packges
> and it works fine with the downgraded packages.
>
> Running Arch Linux
> git 2.4.5
> perl 5.22.0
> perl-authen-sasl 2.16
> perl-mime-tools 5.505
> perl-net-smtp-ssl 1.03
>
> .gitconfig
> [sendemail]
>     smtpEncryption = tls
>     smtpServer = smtp.gmail.com
>     smtpUser = juston.h.li@gmail.com
>     smtpServerPort = 587
>
> Regards
> Juston
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: git send-email Connection Closed
  2015-07-15 22:00 ` Mike Rappazzo
@ 2015-07-16  2:43   ` Juston Li
  0 siblings, 0 replies; 5+ messages in thread
From: Juston Li @ 2015-07-16  2:43 UTC (permalink / raw)
  To: Mike Rappazzo; +Cc: Git List

On Wed, Jul 15, 2015 at 3:00 PM, Mike Rappazzo <rappazzo@gmail.com> wrote:
> I believe that this is due to gmail not allowing the email.  I think
> there are two ways to fix this:
>
> 1.  Temporarily enable less secure apps for your gmail account while
> you send the email [see
> here](https://support.google.com/accounts/answer/6010255?hl=en).
> 2.  Setup multi-factor authentication on your account and create an
> app specific password for git-send-email [see
> here](https://support.google.com/accounts/answer/185833?hl=en)
>
> Obviously the second method is more secure.  I have had success with
> both of these techniques.

Yeah it makes sense it is gmail not allowing it, I've resent the patchset
before so maybe it doesn't like the same/similar email sent thinking that
I am spamming it.

I have 2 factor authentication enabled and use an app specfic password.

Thanks
Juston

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: git send-email Connection Closed
  2015-07-15  5:11 git send-email Connection Closed Juston Li
  2015-07-15 22:00 ` Mike Rappazzo
@ 2015-07-24 12:59 ` Stefan Agner
  2015-07-24 14:26   ` Stefan Agner
  1 sibling, 1 reply; 5+ messages in thread
From: Stefan Agner @ 2015-07-24 12:59 UTC (permalink / raw)
  To: Juston Li; +Cc: git

Hi Juston,

On 2015-07-15 07:11, Juston Li wrote:
> Recently, I have had trouble using git send-email to send a patchset.
> After the confirmation to send the email I get the following:
> Send this email? ([y]es|[n]o|[q]uit|[a]ll): y
> [Net::SMTP::SSL] Connection closed at /usr/lib/git-core/git-send-email
> line 1320.
> fatal: 'send-email' appears to be a git command, but we were not
> able to execute it. Maybe git-send-email is broken?
> 
> This message first appeared when I tried to send a 19 commit patchset
> via 'git send-email HEAD~19'. It also fails when I try to format-patch
> and send the patchset separately via 'git send-email 0001...'
> Oddly enough, it works when I send anything other than 19 commits
> for example 'git send-email HEAD~1' or 'git send-email HEAD~20'

Just got a similar message here, without the fatal part, just:
[Net::SMTP::SSL] Connection closed at /usr/lib/git-core/git-send-email
line 1320.

It seems that only one patch is causing the problem (in my case the
first after the cover letter). I use TLS too and send it over a postfix
SMTP server I maintain myself. The postfix log shows this:

postfix/smtpd[8535]: lost connection after DATA (16357 bytes) from
unknown[x.y.z.z]
postfix/smtpd[8535]: disconnect from unknown[x.y.z.z]

So it seems that the client side disconnects?

I rerun the command with --smtp-debug=1

...
Net::SMTP::SSL=GLOB(0x1fb3558)>>> +MODULE_LICENSE("GPL");
Net::SMTP::SSL=GLOB(0x1fb3558)>>> -- 
Net::SMTP::SSL=GLOB(0x1fb3558)>>> 2.4.5
Net::SMTP::SSL: Net::Cmd::datasend(): unexpected EOF on command channel:
 at /usr/lib/git-core/git-send-email line 1320.
[Net::SMTP::SSL] Connection closed at /usr/lib/git-core/git-send-email
line 1320.

It seems to me that there is a size limit, after cutting down the patch
to ~16K, sending started to work. I cut it twice, once by removing lines
from the head and once from the bottom, in both cases at the size of
around 16K I could send the patch.
 
> I thought it was something with the gmail servers but I was able to send
> the patchset by downgrading a couple perl packages
> warning: downgrading package perl (5.22.0-1 => 5.20.2-1)
> warning: downgrading package perl-net-ssleay (1.68-2 => 1.67-1)
> 
> Note perl-net-ssleay depends on perl 5.22 so I can't isolate which
> package but I can consistently get the failure with the newest packges
> and it works fine with the downgraded packages.
> 
> Running Arch Linux
> git 2.4.5
> perl 5.22.0
> perl-authen-sasl 2.16
> perl-mime-tools 5.505
> perl-net-smtp-ssl 1.03

Same versions here, unfortunately I can't downgrade because I recently
cleared my package cache :-(

--
Stefan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: git send-email Connection Closed
  2015-07-24 12:59 ` Stefan Agner
@ 2015-07-24 14:26   ` Stefan Agner
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Agner @ 2015-07-24 14:26 UTC (permalink / raw)
  To: Juston Li; +Cc: git

On 2015-07-24 14:59, Stefan Agner wrote:
> Hi Juston,
> 
> On 2015-07-15 07:11, Juston Li wrote:
>> Recently, I have had trouble using git send-email to send a patchset.
>> After the confirmation to send the email I get the following:
>> Send this email? ([y]es|[n]o|[q]uit|[a]ll): y
>> [Net::SMTP::SSL] Connection closed at /usr/lib/git-core/git-send-email
>> line 1320.
>> fatal: 'send-email' appears to be a git command, but we were not
>> able to execute it. Maybe git-send-email is broken?
>>
>> This message first appeared when I tried to send a 19 commit patchset
>> via 'git send-email HEAD~19'. It also fails when I try to format-patch
>> and send the patchset separately via 'git send-email 0001...'
>> Oddly enough, it works when I send anything other than 19 commits
>> for example 'git send-email HEAD~1' or 'git send-email HEAD~20'
> 
> Just got a similar message here, without the fatal part, just:
> [Net::SMTP::SSL] Connection closed at /usr/lib/git-core/git-send-email
> line 1320.
> 
> It seems that only one patch is causing the problem (in my case the
> first after the cover letter). I use TLS too and send it over a postfix
> SMTP server I maintain myself. The postfix log shows this:
> 
> postfix/smtpd[8535]: lost connection after DATA (16357 bytes) from
> unknown[x.y.z.z]
> postfix/smtpd[8535]: disconnect from unknown[x.y.z.z]
> 
> So it seems that the client side disconnects?
> 
> I rerun the command with --smtp-debug=1
> 
> ...
> Net::SMTP::SSL=GLOB(0x1fb3558)>>> +MODULE_LICENSE("GPL");
> Net::SMTP::SSL=GLOB(0x1fb3558)>>> -- 
> Net::SMTP::SSL=GLOB(0x1fb3558)>>> 2.4.5
> Net::SMTP::SSL: Net::Cmd::datasend(): unexpected EOF on command channel:
>  at /usr/lib/git-core/git-send-email line 1320.
> [Net::SMTP::SSL] Connection closed at /usr/lib/git-core/git-send-email
> line 1320.
> 
> It seems to me that there is a size limit, after cutting down the patch
> to ~16K, sending started to work. I cut it twice, once by removing lines
> from the head and once from the bottom, in both cases at the size of
> around 16K I could send the patch.

I found a work-around by using datasend line by line, which did the job
for me:

Altering /usr/lib/git-core/git-send-email, around line 1320:

                $smtp->datasend("$header\n") or die $smtp->message;
                my @lines = split /^/, $message;
                foreach my $line (@lines) {
                        $smtp->datasend("$line") or die $smtp->message;
                }

--
Stefan

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-07-24 14:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-15  5:11 git send-email Connection Closed Juston Li
2015-07-15 22:00 ` Mike Rappazzo
2015-07-16  2:43   ` Juston Li
2015-07-24 12:59 ` Stefan Agner
2015-07-24 14:26   ` Stefan Agner

Code repositories for project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).