我能够检索电子邮件并浏览各种文件夹。但是,由于证书错误(如下所述),我无法发送任何电子邮件。互联网上的一些配置提供了证书文件的路径,但 OSX 使用钥匙串代替。我在 Google 上没有找到任何描述如何为 OSX(Mountain Lion)进行设置的内容。任何帮助将不胜感激。
[我正在not
使用 gmail。]
互联网上的其他用户引用了与此类似的配置: (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))
这是发送电子邮件时的错误消息:
*** 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