AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1451423
Accepted
Vishal Parmar
Vishal Parmar
Asked: 2023-01-23 23:44:04 +0800 CST2023-01-23 23:44:04 +0800 CST 2023-01-23 23:44:04 +0800 CST

git 发送电子邮件设置失败

  • 772

我无法设置 git send-mail 来发送补丁。

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

我遵循这两个指南。

  1. git 安装指南
  2. 微软smtp配置
    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
    

以这种方式使用命令。

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

我收到以下错误。

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.

请提供我可以参考解决方案的提示或文档。

更新:2023 年 1 月 31 日

今天我通过 bellow 命令专门添加它解决了域名问题。之后出现了加密身份验证未知问题,因为 git send-email 没有“STARTTLS”(git 有 TLS/SSL 加密)。所以将它设置为“tls”

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

现在 Microsoft AAD(Azure Active Directory)的安全默认值禁用 SMTP 验证。所以我得到了波纹管错误。

带有调试日志:

$ 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]

没有调试日志:

$ 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]

现在从 5.7.139 错误和提供的链接提供 + 这个类似的错误链接我发现唯一剩下的问题是我的默认 outlook 服务器安全默认设置“SMTP AUTH”。管理员需要启用它,但因为我不是管理员。我将在这里停下来,改用个人 Gmail。

git
  • 1 1 个回答
  • 47 Views

1 个回答

  • Voted
  1. Best Answer
    Vishal Parmar
    2023-02-01T04:11:53+08:002023-02-01T04:11:53+08:00

    如已编辑问题所示,到达 SMTP-AUTH 5.7.139 错误后。我停止了,因为我没有管理员权限来启用它。

    所以我按照这个指南用gmail做了替代设置“git send-email”

    1. gmail 设置,通过其他电子邮件平台检查 Gmail
    2. git 发送电子邮件初始设置
    3. 解决 2 因素身份验证问题。gmail 使用应用程序密码登录
    • 0

相关问题

  • 安装 git 以在多用户系统中使用

  • 配置 gitosis 的步骤是什么?

  • 如何从 git 存储库编译多个内核?

  • git 和 git-core 包有什么区别?

  • Nautilus Git 集成

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve