2015-08-19 78 views
1

我想用git send-email發送補丁。該.gitconfig文件是這樣的:如何調試「git send-email」失敗的問題?

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

git send-email命令的輸出是這樣的:

[[email protected] linux]# git send-email --smtp-debug --to [email protected] 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使用這個代理?

回答

0
  • 難道格式補丁發送電子郵件git format-patch HEAD~..HEAD
  • 跑在終端git send-email 0001-my-commit-name-generated.patch
  • 什麼工作對我來說這個命令是,我們有一個自簽名證書的事實面前,這是我用過的~/.gitconfig(全局git配置)。嘗試從您的本地機器給予SSL證書路徑,每個Debian都有一個。

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