[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Use built-in gnutls support in Emacs 24
At Mon, 11 Jun 2012 19:52:10 +0900, Kazuhiro Ito wrote:
Ack, good patch!
We need to start pushing patches to github.
>
> Hi,
>
> I think it would be better that we modify
> elmo-network-stream-type-alist's default value. Because we don't need
> ssl.el if we use gnutls.el or tls.el, and we can easily customize
> behaviors by modifying that variable.
>
> The patch with related changes is attached.
>
> --
> Kazuhiro Ito
> [2 wl.diff <application/octet-stream (7bit)>]
> diff -ur ../wanderlust.org/elmo/ChangeLog ./elmo/ChangeLog
> --- ../wanderlust.org/elmo/ChangeLog 2012-04-11 20:08:06.000000000 +0900
> +++ ./elmo/ChangeLog 2012-06-11 11:41:11.020560200 +0900
> @@ -1,3 +1,14 @@
> +2012-06-11 Kazuhiro Ito <kzhr@d1.dion.ne.jp>
> +
> + * elmo-net.el (elmo-open-network-stream): Raise error when open
> + connection function failed.
> +
> + * elmo-nntp.el (elmo-folder-initialize): Do not modify
> + elmo-network-stream-type-alist.
> +
> + * elmo-vars.el (elmo-network-stream-type-alist): Check whether
> + gnutls.el or tls.el is available.
> +
> 2011-07-03 David Maus <dmaus@ictsoc.de>
>
> * elmo-imap4.el (elmo-imap4-session-unselect-mailbox): New
> diff -ur ../wanderlust.org/elmo/elmo-net.el ./elmo/elmo-net.el
> --- ../wanderlust.org/elmo/elmo-net.el 2012-04-11 20:08:06.000000000 +0900
> +++ ./elmo/elmo-net.el 2012-06-11 11:42:00.845410000 +0900
> @@ -311,7 +311,11 @@
> (if stream-type
> (funcall (elmo-network-stream-type-function stream-type)
> name buffer server service)
> - (open-network-stream name buffer server service)))))
> + (open-network-stream name buffer server service)))
> + (unless (and (processp process)
> + (memq (process-status process) '(open run)))
> + (error "Open network connection to %s:%d failed"
> + server service))))
> (error
> (when auto-plugged
> (elmo-set-plugged nil server service
> diff -ur ../wanderlust.org/elmo/elmo-nntp.el ./elmo/elmo-nntp.el
> --- ../wanderlust.org/elmo/elmo-nntp.el 2012-04-11 20:08:06.000000000 +0900
> +++ ./elmo/elmo-nntp.el 2012-06-11 11:42:29.426044700 +0900
> @@ -94,9 +94,8 @@
> (luna-define-method elmo-folder-initialize ((folder elmo-nntp-folder) name)
> (let ((elmo-network-stream-type-alist
> (if elmo-nntp-stream-type-alist
> - (setq elmo-network-stream-type-alist
> - (append elmo-nntp-stream-type-alist
> - elmo-network-stream-type-alist))
> + (append elmo-nntp-stream-type-alist
> + elmo-network-stream-type-alist)
> elmo-network-stream-type-alist))
> tokens)
> (setq tokens (car (elmo-parse-separated-tokens
> diff -ur ../wanderlust.org/elmo/elmo-vars.el ./elmo/elmo-vars.el
> --- ../wanderlust.org/elmo/elmo-vars.el 2012-04-11 20:08:06.000000000 +0900
> +++ ./elmo/elmo-vars.el 2012-06-11 11:43:21.543025700 +0900
> @@ -29,6 +29,7 @@
> ;;; Code:
> ;;
> (require 'poe)
> +(require 'path-util)
>
> ;; silence byte compiler
> (eval-when-compile
> @@ -361,7 +362,14 @@
> "Date match is available or not.")
>
> (defvar elmo-network-stream-type-alist
> - '(("!" ssl ssl open-ssl-stream)
> + `(("!" ssl ,@(cond
> + ((and (fboundp 'gnutls-available-p)
> + (gnutls-available-p))
> + '(gnutls open-gnutls-stream))
> + ((module-installed-p 'tls)
> + '(tls open-tls-stream))
> + (t
> + '(ssl open-ssl-stream))))
> ("!!" starttls starttls starttls-open-stream)
> ("!socks" socks socks socks-open-network-stream)
> ("!direct" direct nil open-network-stream))
> diff -ur ../wanderlust.org/wl/ChangeLog ./wl/ChangeLog
> --- ../wanderlust.org/wl/ChangeLog 2012-04-11 20:08:06.000000000 +0900
> +++ ./wl/ChangeLog 2012-06-11 11:44:03.906448700 +0900
> @@ -1,3 +1,10 @@
> +2012-06-11 Kazuhiro Ito <kzhr@d1.dion.ne.jp>
> +
> + * wl-draft.el: Do not define autoload for `open-ssl-stream'.
> + (wl-template): Require elmo-net.el.
> + (wl-smtp-extension-bind): Respect `elmo-network-stream-type-alist'
> + for over SSL/TLS connection.
> +
> 2012-02-18 David Maus <dmaus@ictsoc.de>
>
> * wl-summary.el (wl-summary-save)
> diff -ur ../wanderlust.org/wl/wl-draft.el ./wl/wl-draft.el
> --- ../wanderlust.org/wl/wl-draft.el 2012-04-11 20:08:06.000000000 +0900
> +++ ./wl/wl-draft.el 2012-06-11 11:44:49.186038600 +0900
> @@ -31,6 +31,7 @@
> ;;; Code:
> ;;
> (require 'elmo)
> +(require 'elmo-net)
> (require 'sendmail)
> (require 'wl-template)
> (require 'emu)
> @@ -55,8 +56,6 @@
> (eval-and-compile
> (autoload 'wl-addrmgr "wl-addrmgr"))
>
> -(autoload 'open-ssl-stream "ssl")
> -
> (defvar wl-draft-buffer-message-number nil)
> (defvar wl-draft-field-completion-list nil)
> (defvar wl-draft-verbose-send t)
> @@ -145,7 +144,9 @@
> (smtp-use-starttls (eq wl-smtp-connection-type 'starttls))
> (smtp-open-connection-function
> (if (eq wl-smtp-connection-type 'ssl)
> - #'open-ssl-stream
> + (let ((stream-type (elmo-get-network-stream-type 'ssl)))
> + (require (elmo-network-stream-type-feature stream-type))
> + (elmo-network-stream-type-function stream-type))
> smtp-open-connection-function))
> smtp-sasl-user-name smtp-sasl-properties sasl-read-passphrase)
> (setq smtp-sasl-user-name wl-smtp-posting-user
--
wbr, Vitaly