11

I was trying to send an patch using git .

When i try sending mail the following error output is generated

enter image description here

My .gitconfig file looks like this

enter image description here

parsley72
  • 8,449
  • 8
  • 65
  • 98
jones j alapat
  • 931
  • 3
  • 13
  • 26

5 Answers5

3

Corporate firewalls may block the required ports

I noticed that this problem only happened at work and not at home, and then found out that my work firewall was blocking the required IMAP / SMTP ports.

If that is the case, you must talk to your network administrator.

The difference is that when you use a web interface like gmail's, all traffic goes through HTTP ports, which are allowed, but git send-email uses the email protocol ports directly.

A good way to test that without polluting public mailing lists is to try to send regular emails with mutt or some other local email client first.

You can also check if outgoing ports are getting blocked with answers for this question: https://superuser.com/questions/631087/how-to-easily-determine-which-outbound-ports-arent-blocked-by-firewall

Ciro Santilli OurBigBook.com
  • 347,512
  • 102
  • 1,199
  • 985
2

I have a smiler issue and,After lots of research I got the answer ...

Please configure the .gitconfig file like this ...

[sendemail]
    from = yourEmail@gmail.com
    smtpserver = smtp.gmail.com
    smtpserverport = 587
    smtpencryption = tls
    smtpuser = yourEmail@gmail.com
    smtppass = password
    suppresscc = self
    chainreplyto = false

After that you must have to allow your mail account to login from less secure App ,like for gmail to do the same follow the link https://support.google.com/accounts/answer/6010255?hl=en

TO debug the actual error you can enable the following flag..

--smtp-debug=1

To help keep your account secure, from May 30, 2022, ​​Google no longer supports the use of third-party apps or devices which ask you to sign in to your Google Account using only your username and password.

muzimuzhi Z
  • 187
  • 10
Aman Jaiswal
  • 1,084
  • 2
  • 18
  • 36
  • 1
    From May 30, 2022, login from **less secure App** is no longer available...https://support.google.com/accounts/answer/6010255?hl=en&visit_id=637977818727862987-3835089515&p=less-secure-apps&rd=1 – hustnzj Sep 03 '22 at 06:11
0

I had a similar issue till I realised that I had made the encryption ssl instead of tls. Changing this parameter in .gitconfig helped me. This says that the git version may not be up to date. Try that maybe?

sth
  • 222,467
  • 53
  • 283
  • 367
LockStock
  • 199
  • 12
  • The `smtpEncryption` option is a bit confusing. `ssl` means plain TLS (submissions, port 465), and `tls` means STARTTLS (submission, port 587). – Jan Schär Jun 27 '22 at 16:23
0

Try this link: http://morefedora.blogspot.com/2009/02/configuring-git-send-email-to-use-gmail.html

In addition to that, you might have to have to change the setting in your gmail account to allow less secure apps setting (https://www.google.com/settings/security/lesssecureapps).

drnerd
  • 1
  • 3
    This link may provide answer, but, please paste the relevant and important parts of the link to your answer. This is because if the link is moved or removed, your answer should still provide enough information to the readers. – phoenix Jan 30 '16 at 21:08
0

Are you able to Ping smtp server. if not use IP address of smtp server.

Alok Prasad
  • 622
  • 7
  • 12