【问题标题】:How to debug "git send-email" failed issue?如何调试“git send-email”失败问题?
【发布时间】:2015-11-12 04:54:44
【问题描述】:

我想使用git send-email 发送补丁。 .gitconfig 文件是这样的:

[user]
        name = Nan Xiao
        email = xxxxxx@chinadtrace.org
[sendemail]
        smtpencryption = ssl
        smtpserver = mail.chinadtrace.org
        smtpuser = xxxxxx@chinadtrace.org
        smtpserverport = 465
        smtppass = xxxxxxxxxx

git send-email 命令的输出是这样的:

[root@localhost linux]# git send-email --smtp-debug --to xxxxxx@gmail.com 0001-xxxxxx.patch

......

Send this email? ([y]es|[n]o|[q]uit|[a]ll): y
Unable to initialize SMTP properly. Check config and use --smtp-debug. VALUES: server=mail.chinadtrace.org encryption=ssl hello=localhost.localdomain port=465 at /usr/libexec/git-core/git-send-email line 1308.

tcpdump抓包是这样的:

tcpdump: listening on enp0s3, link-type EN10MB (Ethernet), capture size 262144 bytes
01:45:15.201553 IP (tos 0x0, ttl 64, id 29480, offset 0, flags [DF], proto TCP (6), length 60)
    localhost.localdomain.38225 > cp-41.webhostbox.net.urd: Flags [S], cksum 0xecfd (incorrect -> 0x21a6), seq 2849543224, win 29200, options [mss 1460,sackOK,TS val 188147472 ecr 0,nop,wscale 7], length 0
01:45:16.204505 IP (tos 0x0, ttl 64, id 29481, offset 0, flags [DF], proto TCP (6), length 60)
    localhost.localdomain.38225 > cp-41.webhostbox.net.urd: Flags [S], cksum 0xecfd (incorrect -> 0x1dba), seq 2849543224, win 29200, options [mss 1460,sackOK,TS val 188148476 ecr 0,nop,wscale 7], length 0

虽然我添加了“--smtp-debug”选项,但我仍然无法分析根本原因。谁能提供一些线索?

更新:
我发现原因是我的服务器使用了代理,但是我怎样才能让git send-email 使用这个代理呢?

【问题讨论】:

  • 你能解决你的问题吗?我面临着类似的问题,我想知道如何解决它。提前致谢

标签: git email smtp sendmail


【解决方案1】:
  • 发邮件前打了格式补丁git format-patch HEAD~..HEAD
  • 在终端git send-email 0001-my-commit-name-generated.patch 中运行此命令
  • 对我有用的是我们有一个自签名证书,这就是我在~/.gitconfig(全局 git 配置)中使用的。尝试从本地机器给它 ssl 证书路径,每个 Debian 都有一个。

    [sendemail]
      from = Dani Carvahal <dani.carvahal@example.com>
      smtpserver = mail02.buc.example.org
      smtpuser = dani.carvahal@example.com
      smtpencryption = tls
      smtpsslcertpath = /usr/local/share/ca-certificates/example-cacert.pem
      smtppass = justmyemailpassword
      chainreplyto = false
      smtpserverport = 25
      to = Bob Smith <bob.smith@example.com>
      bcc = Dani Carvahal <dani.carvahal@example.com>
    

【讨论】:

    猜你喜欢
    • 2019-10-18
    • 2021-01-06
    • 2012-11-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-12-16
    • 2017-12-25
    • 2011-09-04
    相关资源
    最近更新 更多