Score:0

git send-email setup failure

in flag

I am unable to setup git send-mail to send a patch.

os platform: Ubuntu22.04 LTS
linux kernel: 5.15.0-58-generic 
git virsion: 2.34.1

I following these two guides.

  1. git setup guide
  2. microsoft smtp config
    vishi@striker:~/$ cat ~/.gitconfig 
    [user]
     name = vishalsinh
     email = [email protected]
    [core]
     autocrlf = false
    [sendemail]
     smtpencryption = STARTTLS
     smtpserver = smtp.office365.com
     smtpUser = [email protected]
     smtpServerPort = 587
     confirm = auto
    

Used command this way.

vishi@striker:~/$ ls outgoing/
0000-cover-letter.patch  0001-PATCH-test.patch
vishi@striker:~/$ git send-email outgoing/* --smtp-debug=1

I am getting bellow error.

Net::SMTP>>> Net::SMTP(3.13)
Net::SMTP>>>   Net::Cmd(3.13)
Net::SMTP>>>     Exporter(5.76)
Net::SMTP>>>   IO::Socket::IP(0.41)
Net::SMTP>>>     IO::Socket(1.46)
Net::SMTP>>>       IO::Handle(1.46)
Net::SMTP=GLOB(0x561947328538)<<< 220 PN2PR01CA0160.outlook.office365.com Microsoft ESMTP MAIL Service ready at Mon, 23 Jan 2023 14:41:27 +0000
Net::SMTP=GLOB(0x561947328538)>>> EHLO striker..
Net::SMTP=GLOB(0x561947328538)<<< 501 5.5.4 Invalid domain name [PN2PR01CA0160.INDPRD01.PROD.OUTLOOK.COM]
Net::SMTP=GLOB(0x561947328538)>>> HELO striker..
Net::SMTP=GLOB(0x561947328538)<<< 501 5.5.4 Invalid domain name [PN2PR01CA0160.INDPRD01.PROD.OUTLOOK.COM]
Unable to initialize SMTP properly. Check config and use --smtp-debug. VALUES: server=smtp.office365.com encryption=STARTTLS hello=striker.. port=587 at /usr/lib/git-core/git-send-email line 1648.

Please give hints or docs that I can refer for solution.

Update: 31 jan 2023

Today I solved Domain name issue by specifically adding it by bellow command. after that there was encryption auth not known issue as git send-email does not have "STARTTLS" (git have TLS/SSL encryption). so set it to "tls"

git config --global sendemail.smtpDomain "siliconsignals.io"
git config --global sendemail.smtpencryption tls

now security defaults of microsoft AAD (Azure Active Directory) disables SMTP autentication. so I got bellow error.

with debug logs:

$ git send-email [email protected] outgoing/* --smtp-debug=1
outgoing/0001-biuld-bootloader-host-in-AI-100-so-it-will-work-out-.patch
(mbox) Adding cc: vishalsinh_sisignals <[email protected]> from line 'From: vishalsinh_sisignals <[email protected]>'

From: vishalsinh <[email protected]>
To: [email protected]
Cc: vishalsinh_sisignals <[email protected]>
Subject: [PATCH] biuld bootloader host in AI-100 so it will work out of box
Date: Tue, 31 Jan 2023 15:48:39 +0530
Message-Id: <[email protected]>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

    The Cc list above has been expanded by additional
    addresses found in the patch commit message. By default
    send-email prompts before sending whenever this occurs.
    This behavior is controlled by the sendemail.confirm
    configuration setting.

    For additional information, run 'git send-email --help'.
    To retain the current behavior, but squelch this message,
    run 'git config --global sendemail.confirm auto'.

Send this email? ([y]es|[n]o|[e]dit|[q]uit|[a]ll): y
Net::SMTP>>> Net::SMTP(3.13)
Net::SMTP>>>   Net::Cmd(3.13)
Net::SMTP>>>     Exporter(5.76)
Net::SMTP>>>   IO::Socket::IP(0.41)
Net::SMTP>>>     IO::Socket(1.46)
Net::SMTP>>>       IO::Handle(1.46)
Net::SMTP=GLOB(0x55f2e33df4e0)<<< 220 BM1PR01CA0158.outlook.office365.com Microsoft ESMTP MAIL Service ready at Tue, 31 Jan 2023 10:18:41 +0000
Net::SMTP=GLOB(0x55f2e33df4e0)>>> EHLO siliconsignals.io
Net::SMTP=GLOB(0x55f2e33df4e0)<<< 250-BM1PR01CA0158.outlook.office365.com Hello [122.170.105.202]
Net::SMTP=GLOB(0x55f2e33df4e0)<<< 250-SIZE 157286400
Net::SMTP=GLOB(0x55f2e33df4e0)<<< 250-PIPELINING
Net::SMTP=GLOB(0x55f2e33df4e0)<<< 250-DSN
Net::SMTP=GLOB(0x55f2e33df4e0)<<< 250-ENHANCEDSTATUSCODES
Net::SMTP=GLOB(0x55f2e33df4e0)<<< 250-STARTTLS
Net::SMTP=GLOB(0x55f2e33df4e0)<<< 250-8BITMIME
Net::SMTP=GLOB(0x55f2e33df4e0)<<< 250-BINARYMIME
Net::SMTP=GLOB(0x55f2e33df4e0)<<< 250-CHUNKING
Net::SMTP=GLOB(0x55f2e33df4e0)<<< 250 SMTPUTF8
Net::SMTP=GLOB(0x55f2e33df4e0)>>> STARTTLS
Net::SMTP=GLOB(0x55f2e33df4e0)<<< 220 2.0.0 SMTP server ready
Net::SMTP::_SSL=GLOB(0x55f2e33df4e0)>>> EHLO siliconsignals.io
Net::SMTP::_SSL=GLOB(0x55f2e33df4e0)<<< 250-BM1PR01CA0158.outlook.office365.com Hello [122.170.105.202]
Net::SMTP::_SSL=GLOB(0x55f2e33df4e0)<<< 250-SIZE 157286400
Net::SMTP::_SSL=GLOB(0x55f2e33df4e0)<<< 250-PIPELINING
Net::SMTP::_SSL=GLOB(0x55f2e33df4e0)<<< 250-DSN
Net::SMTP::_SSL=GLOB(0x55f2e33df4e0)<<< 250-ENHANCEDSTATUSCODES
Net::SMTP::_SSL=GLOB(0x55f2e33df4e0)<<< 250-AUTH LOGIN XOAUTH2
Net::SMTP::_SSL=GLOB(0x55f2e33df4e0)<<< 250-8BITMIME
Net::SMTP::_SSL=GLOB(0x55f2e33df4e0)<<< 250-BINARYMIME
Net::SMTP::_SSL=GLOB(0x55f2e33df4e0)<<< 250-CHUNKING
Net::SMTP::_SSL=GLOB(0x55f2e33df4e0)<<< 250 SMTPUTF8
Net::SMTP::_SSL=GLOB(0x55f2e33df4e0)>>> EHLO siliconsignals.io
Net::SMTP::_SSL=GLOB(0x55f2e33df4e0)<<< 250-BM1PR01CA0158.outlook.office365.com Hello [122.170.105.202]
Net::SMTP::_SSL=GLOB(0x55f2e33df4e0)<<< 250-SIZE 157286400
Net::SMTP::_SSL=GLOB(0x55f2e33df4e0)<<< 250-PIPELINING
Net::SMTP::_SSL=GLOB(0x55f2e33df4e0)<<< 250-DSN
Net::SMTP::_SSL=GLOB(0x55f2e33df4e0)<<< 250-ENHANCEDSTATUSCODES
Net::SMTP::_SSL=GLOB(0x55f2e33df4e0)<<< 250-AUTH LOGIN XOAUTH2
Net::SMTP::_SSL=GLOB(0x55f2e33df4e0)<<< 250-8BITMIME
Net::SMTP::_SSL=GLOB(0x55f2e33df4e0)<<< 250-BINARYMIME
Net::SMTP::_SSL=GLOB(0x55f2e33df4e0)<<< 250-CHUNKING
Net::SMTP::_SSL=GLOB(0x55f2e33df4e0)<<< 250 SMTPUTF8
Password for 'smtp://[email protected]@smtp-legacy.office365.com:587': 
Net::SMTP::_SSL=GLOB(0x55f2e33df4e0)>>> AUTH LOGIN
Net::SMTP::_SSL=GLOB(0x55f2e33df4e0)<<< 334 *********
Net::SMTP::_SSL=GLOB(0x55f2e33df4e0)<<< (decoded) Username:
Net::SMTP::_SSL=GLOB(0x55f2e33df4e0)>>> (decoded) [email protected]
Net::SMTP::_SSL=GLOB(0x55f2e33df4e0)>>> dmlzaGFsc2luaC5wYXJtYXJAc2lsaWNvbnNpZ25hbHMuaW8=
Net::SMTP::_SSL=GLOB(0x55f2e33df4e0)<<< 334 *********
Net::SMTP::_SSL=GLOB(0x55f2e33df4e0)<<< (decoded) Password:
Net::SMTP::_SSL=GLOB(0x55f2e33df4e0)>>> (decoded) *********
Net::SMTP::_SSL=GLOB(0x55f2e33df4e0)>>> U2hpdmE0dmlzaCM=
Net::SMTP::_SSL=GLOB(0x55f2e33df4e0)<<< 535 5.7.139 Authentication unsuccessful, SmtpClientAuthentication is disabled for the Tenant. Visit https://aka.ms/smtp_auth_disabled for more information. [BM1PR01CA0158.INDPRD01.PROD.OUTLOOK.COM 2023-01-31T10:19:02.295Z 08DB03199EF82C8E]
5.7.139 Authentication unsuccessful, SmtpClientAuthentication is disabled for the Tenant. Visit https://aka.ms/smtp_auth_disabled for more information. [BM1PR01CA0158.INDPRD01.PROD.OUTLOOK.COM 2023-01-31T10:19:02.295Z 08DB03199EF82C8E]

without debug logs:

$ git send-email [email protected] outgoing/*
outgoing/0001-biuld-bootloader-host-in-AI-100-so-it-will-work-out-.patch
(mbox) Adding cc: vishalsinh_sisignals <[email protected]> from line 'From: vishalsinh_sisignals <[email protected]>'

From: vishalsinh <[email protected]>
To: [email protected]
Cc: vishalsinh_sisignals <[email protected]>
Subject: [PATCH] biuld bootloader host in AI-100 so it will work out of box
Date: Tue, 31 Jan 2023 15:53:39 +0530
Message-Id: <[email protected]>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Send this email? ([y]es|[n]o|[e]dit|[q]uit|[a]ll): y
Password for 'smtp://[email protected]@smtp-legacy.office365.com:587': 
5.7.139 Authentication unsuccessful, SmtpClientAuthentication is disabled for the Tenant. Visit https://aka.ms/smtp_auth_disabled for more information. [BMXPR01CA0089.INDPRD01.PROD.OUTLOOK.COM 2023-01-31T10:24:01.016Z 08DB03117D6EB381]

now from 5.7.139 error and links provided provided + this similar error link I found that the only issue left is my default outlook server security defaults turn of "SMTP AUTH". admin needs to enable it but since I am not admin. I will stop here and use personal Gmail instead.

tripleee avatar
nz flag
Please try with the `--smtp-debug` flag enabled as indicated in the error message, and [edit] your question to include the result.
Vishal Parmar avatar
in flag
tried --smtp-debug got invalid domain name error as you can see in my edited question. thanks. if I can solve it. will post results.
Score:0
in flag

after reaching SMTP-AUTH 5.7.139 error as shown in edited question. I stopped as I did not have admin privileges to enable it.

so I did alternative setup "git send-email" with gmail following this thre guide

  1. gmail setup, Check Gmail through other email platforms
  2. git send-email initial setup
  3. troubleshoot 2-factor authentication. gmail Sign in with App Passwords
Score:0
bd flag

Change smtpencryption = STARTTLS to smtpencryption = tls

David avatar
cn flag
It would be a good idea to explain what is different about the 2 commands.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.