2013-05-26 97 views
2

我可以檢索電子郵件並瀏覽各種文件夾。但是,由於證書錯誤,我無法發送任何電子郵件(如下所述)。互聯網上的一些配置提供了一個到cert文件的路徑,但是OSX使用了一個keychain。我在Google上沒有發現任何描述如何爲OSX(Mountain Lion)設置的內容。任何幫助將不勝感激。流浪 - OSX - Emacs - SMTP認證失敗

[我not使用Gmail]

Internet上的其他用戶都引用配置與此類似:(setq ssl-program-name "gnutls-cli" ssl-program-arguments '("--port" service "--insecure" "--x509cafile" "/etc/ssl/certs/ca-certificates.crt" host))然而,對OSX證書沒有這樣的文件位置由於鑰匙扣使用。我認爲這是問題,但我不完全確定。

我在與GNU電子郵件相同的問題,和文檔指出:

The SMTP server may also request that you verify your identity by sending a certificate and the associated encryption key to the server. If you need to do this, you can use an ~/.authinfo entry like this:

machine mail.example.org port 25 key "~/.my_smtp_tls.key" cert "~/.my_smtp_tls.cert" 

這是我目前的配置:

(setq ssl-program-name "/absolute/path/to/gnutls-cli" 
     ssl-program-arguments '("--insecure" "-p" service host) 
     ssl-certificate-verification-policy 1) 

(autoload 'wl "wl" "Wanderlust" t) 
(autoload 'wl-other-frame "wl" "Wanderlust on new frame." t) 
(autoload 'wl-draft "wl-draft" "Write draft with Wanderlust." t) 

;; IMAP 
(setq elmo-imap4-default-server "mail.mydomain.com") 
(setq elmo-imap4-default-user "myusername") 
(setq elmo-imap4-default-authenticate-type 'login) 
(setq elmo-imap4-default-port '993) 
(setq elmo-imap4-default-stream-type 'ssl) 


(setq elmo-imap4-use-modified-utf7 t) 

;; SMTP 
(setq wl-smtp-connection-type 'starttls) 
(setq wl-smtp-posting-port 587) 
(setq wl-smtp-authenticate-type "login") 
(setq wl-smtp-posting-user "myusername") 
(setq wl-smtp-posting-server "mail.mydomain.com") 
(setq wl-local-domain "mydomain.com") 

(setq wl-default-folder "%INBOX") 
(setq wl-default-spec "%") 
;; (setq wl-draft-folder "%Drafts") 
(setq wl-trash-folder "%Trash") 

(setq wl-folder-check-async t) 

(setq elmo-imap4-use-modified-utf7 t) 

(autoload 'wl-user-agent-compose "wl-draft" nil t) 
(if (boundp 'mail-user-agent) 
    (setq mail-user-agent 'wl-user-agent)) 
(if (fboundp 'define-mail-user-agent) 
    (define-mail-user-agent 
     'wl-user-agent 
     'wl-user-agent-compose 
     'wl-draft-send 
     'wl-draft-kill 
     'mail-send-hook)) 

This i發送電子郵件時,S上的錯誤消息:

*** Starting TLS handshake 
- Certificate type: X.509 
- Got a certificate list of 2 certificates. 
- Certificate[0] info: 
- subject `OU=Domain Control Validated,CN=*.liquidweb.com', issuer `C=BE,O=GlobalSign nv-sa,CN=GlobalSign Domain Validation CA - G2', RSA key 2048 bits, signed using RSA-SHA1, activated `2013-02-22 16:03:14 UTC', expires `2018-02-22 16:03:14 UTC', SHA-1 fingerprint `f9926583e10585ca301bec7ec8d36d7e4573750d' 
    Public Key Id: 
     3ff7ead3d8a2be6cf1e48d072a5be80afe5183de 
    Public key's random art: 
     +--[ RSA 2048]----+ 
     |     | 
     |     | 
     |     | 
     |  .   | 
     |  . S  | 
     |  . o +. o | 
     | . o E +*.B | 
     | . . o.oooB.= | 
     | ..o.o==+o=. | 
     +-----------------+ 

- Certificate[1] info: 
- subject `C=BE,O=GlobalSign nv-sa,CN=GlobalSign Domain Validation CA - G2', issuer `C=BE,O=GlobalSign nv-sa,OU=Root CA,CN=GlobalSign Root CA', RSA key 2048 bits, signed using RSA-SHA1, activated `2011-04-13 10:00:00 UTC', expires `2022-04-13 10:00:00 UTC', SHA-1 fingerprint `0481c8ca31be0fa940c7e0ccd572374eadf52b73' 
- Status: The certificate is NOT trusted. The certificate issuer is unknown. The name in the certificate does not match the expected. 
*** Verifying server certificate failed... 
*** Fatal error: Error in the certificate. 
*** Handshake has failed 

byte-code: Wrong type argument: arrayp, nil 
+0

我想我已經使用'(setq ssl-program-name「openssl s_client -ssl2 -connect%s:%p」)',而不是guntls。我會在12至24小時內彙報。我需要在Snow Leopard上測試它,但它似乎適用於Mountain Lion。我正在使用fcc選項將副本放在發送的文件夾中,如果我查看它,它似乎會在服務器上留下一個副本,因此它在讀取電子郵件方面是IMAP而不是pop。 – lawlist

+0

有同樣的問題,但不幸的是,即使在更改ssl-program-name爲openssl後也沒有幫助。你有沒有找到其他解決方案? –

+0

我剛剛爲我的當前Liquidweb共享服務器的工作設置添加了一個示例答案。我修改了'.../lisp/net/tls.el'來刪除一些gnutls-cli行,並保留'openssl s_client -connect mail.mydomain.com:993 -no_ssl2 -ign_eof',這避免了嘗試使用gnutls -cli配置 - 但是,這不是必需的 - 它只是節省了登錄時間並消除了消息緩衝區中的錯誤消息。請注意,如果它們存在,則需要在您的.emacs文件中發生衝突的其他gnus設置註釋掉。 – lawlist

回答

2
;; IMAP 
(setq elmo-imap4-default-server "mail.mydomain.com") 
(setq elmo-imap4-default-user "my-user-name") 
(setq elmo-imap4-default-authenticate-type 'login) 
(setq elmo-imap4-default-port '993) 
(setq elmo-imap4-default-stream-type 'ssl) 
(setq elmo-imap4-use-modified-utf7 t) 
(setq elmo-network-session-idle-timeout 30) 

;; SMTP 
(setq ssl-program-name "openssl s_client -ssl2 -connect %s:%p") 
(setq smtpmail-auth-credentials '(("mail.mydomain.com" 587 "my-user-name" "my-password"))) 
(setq smtp-server "mail.mydomain.com") 
1

嗯,我並沒有真正解決這個問題,但只能使用SSL與谷歌郵件的最後正確的端口支持,是繼workaroud。但是,在設置STARTTLS或TLS上的SMTP服務器INSISTS的另一個電子郵件帳戶時,該問題再次讓我再次陷入困境。所以你所報告的問題仍然是開放的。我花了半天的時間尋找解決方案,但找不到一個解決方案。大多數人都在談論關於使用gnutls-cli -tofu選項而不是--insecure的小談話。

http://lists.gnu.org/archive/html/info-gnus-english/2012-04/msg00001.html

然而,這促使我深入到Emacs和我找不到改變由GNUTLS-CLI被稱爲選項的方式。

問題的最佳解決方案很可能是找出OSX上丟失的鍵和crts的位置,或者如何創建它們,然後將它們放在正確的位置。任何幫助,暗示,評論?

+0

我並沒有在Wanderlust中使用gmail,而是使用了一個共享服務器和liquidweb。如果您想查看我的配置和我對內置tls文件的修改,請成爲我的訪客:https://github.com/lawlist/wl-config – lawlist

1

您正在使用--tofu選項正確的軌道。所有你需要以下步驟here後做的就是添加在你的.emacs以下

(setq starttls-extra-arguments '("--tofu")) 

(您也可以通過Emacs中的自定義界面中設置)。這將讓你的任何參數傳遞給GNUTLS-CLI你希望。