2013-12-15 6 views
2

Emacs gnus를 사용하여 Gmail 계정에 연결하려고합니다. 이것은 관련 구성 코드는 대부분 from here 촬영 : 나는, 발사 이맥스를 다시 부팅 할 때Windows에서 Emacs gnus의 gmail nnimap 서버를 열 수 없음

(setq tls-program '("openssl s_client -CAfile C:/Users/GGustafson/gmail.crt -connect %h:%p -no_ssl2 -ign_eof")) 

(setq gnus-select-method '(nnimap "gmail" 
    (nnimap-address "imap.gmail.com") 
    (nnimap-server-port 993) 
    (nnimap-stream ssl) 
    (nnimap-authinfo-file "~/.authinfo"))) 

(setq message-send-mail-function 'smtpmail-send-it 
smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil)) 
    smtpmail-auth-credentials '(("smtp.gmail.com" 587 "[email protected]" nil)) 
    smtpmail-default-smtp-server "smtp.gmail.com" 
    smtpmail-smtp-server "smtp.gmail.com" 
    smtpmail-smtp-service 587) 

M-x gnus을, 내가 얻을이 *Messages* : 정확히 여기 무슨 일이 일어나고 무엇

Opening connection to imap.gmail.com via tls... 
gnutls.c: [1] (Emacs) GnuTLS library not found 
Opening TLS connection to `imap.gmail.com'... 
Opening TLS connection with `openssl s_client -CAfile C:/Users/GGustafson/gmail.crt -connect imap.gmail.com:993 -no_ssl2 -ign_eof'...done 
Opening TLS connection to `imap.gmail.com'...done 
nnimap (gmail) open error: 'depth=3 C = US, O = Equifax, OU = Equifax Secure Certificate Authority^M 
'. Continue? (y or n) y 

? 이전에 일부 verify error:num=20:unable to get local issuer certificate 오류가 발생했지만 following these instructions으로 해결했습니다. 해당 인증서 사본에 -CAfile 매개 변수를 추가했습니다.

사항을 확인하려면,이 작업을 수행 할 수 있습니다

C:\Users\GGustafson>openssl s_client -CAfile C:/Users/GGustafson/gmail.crt -connect imap.gmail.com:993 -no_ssl2 -ign_eof 
CONNECTED(00000003) 
depth=3 C = US, O = Equifax, OU = Equifax Secure Certificate Authority verify return:1 
depth=2 C = US, O = GeoTrust Inc., CN = GeoTrust Global CA verify return:1 
depth=1 C = US, O = Google Inc, CN = Google Internet Authority G2 verify return:1 
depth=0 C = US, ST = California, L = Mountain View, O = Google Inc, CN = imap.gmail.com verify return:1 
--- 
Certificate chain 
0 s:/C=US/ST=California/L=Mountain View/O=Google Inc/CN=imap.gmail.com 
    i:/C=US/O=Google Inc/CN=Google Internet Authority G2 
1 s:/C=US/O=Google Inc/CN=Google Internet Authority G2 
    i:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA 
2 s:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA 
    i:/C=US/O=Equifax/OU=Equifax Secure Certificate Authority 
--- 
Server certificate 
-----BEGIN CERTIFICATE----- 
****SNIP**** 
    Start Time: 1387083719 
    Timeout : 300 (sec) 
    Verify return code: 0 (ok) 
--- 
* OK Gimap ready for requests from 128.84.124.191 el7if9939594qeb.109 

을 내가 GNUS 내 Gmail을 읽을 수 있도록 놓친 거지 뭐? 나는 Windows 7에서 Cygwin openssl을 사용하고 있습니다. 내가 GNUS에서 Gmail로 연결하기 위해 Windows 7에서 할 필요가

+0

'-quiet'를's_client' 옵션에 추가 해보십시오. – tripleee

답변

1

나를 위해 일한 것은 openssl 대신 a gnutls port for windows을 사용하고 tls-program의 사용자 정의를 제거하는 것입니다. 이맥스는 gnutls-cli이 기본값 인 tls-program으로 시도하는 첫 번째 프로그램이기 때문에 경로에있는 경우 자동으로 gnutls의 바이너리를 사용합니다.

openssl을 시도하기 전에 gnutls를 사용하는 것이 좋습니다. 이유는 아마도 기본값에서 첫 번째 일 것입니다.

+0

'tls-program'의 커스터마이징을 제거하는 방법에 대해 더 자세히 알려주시겠습니까? Windows 7에서 Gnus를 사용하게 된 적이 없었습니다. – ReneFroger

+0

@ReneFroger 이맥스 설정에서 tls-program을 설정하지 마십시오. 즉, 기본값으로 설정하십시오. –

3

한 가지였다보다

;; So gnutls can find trustfiles on windows 
(eval-after-load "gnutls" 
'(progn 
    (setq gnutls-trustfiles '("c:/cygwin/usr/ssl/certs/ca-bundle.trust.crt" "c:/cygwin/usr/ssl/certs/ca-bundle.crt")))) 

기타, 설치의 나머지는 비슷하다

메일 벌금을 읽을 수
(setq gnus-secondary-select-methods 
     '(
    (nnimap "gmail" 
      (nnimap-address "imap.gmail.com") 
      (nnimap-server-port 993) 
      (nnimap-stream ssl) 
      (nnir-search-engine imap) 
      (nnimap-authinfo-file "~/.authinfo") 
      ) 
    (nntp "news.gmane.org") 
    (nnfolder "archive" 
     (nnfolder-directory "~/Documents/Text/Gnus/Mail/archive") 
     (nnfolder-active-file "~/Documents/Text/Gnus/Mail/archive/active") 
     (nnfolder-get-new-mail nil) 
     (nnfolder-inhibit-expiry t)))) 

Gmail에서.

+0

나는 원래 gnutls를 사용하지 않았다. 한번 openssl 대신에 더 많은 커스터마이징을하지 않아도 괜찮 았습니다. 그러나 'gnutls-trustfiles'에 대한 제안은 가치 있고 관련성이 높습니다. +1도 마찬가지입니다. :) –

+0

cygwin을 설치하는 것 외에 다른 방법으로 트러스트 파일을 구할 수 있습니까? – sk8ingdom