aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTSUCHIYA Masatoshi2016-09-12 23:06:43 +0000
committerKatsumi Yamaoka2016-09-12 23:06:43 +0000
commitb26e3427820db1e37c885c7f1023c1dff5087798 (patch)
treeb2830b2875fab880464b586e2f90d9c813ea8fa2
parentee98ca67f886698b6072095e55b820b1c31e1236 (diff)
downloademacs-b26e3427820db1e37c885c7f1023c1dff5087798.tar.gz
emacs-b26e3427820db1e37c885c7f1023c1dff5087798.zip
sieve-manage.el: Allow user to avoid STARTTLS capability test (bug#24422)
* lisp/net/sieve-manage.el (sieve-manage-ignore-broken-tls): New user option. (sieve-manage-open-server): Don't test STARTTLS capability if the option is set (bug#24422).
-rw-r--r--lisp/net/sieve-manage.el15
1 files changed, 11 insertions, 4 deletions
diff --git a/lisp/net/sieve-manage.el b/lisp/net/sieve-manage.el
index 695bbd860de..dbe8b22319b 100644
--- a/lisp/net/sieve-manage.el
+++ b/lisp/net/sieve-manage.el
@@ -146,6 +146,11 @@ for doing the actual authentication."
146 :type 'symbol 146 :type 'symbol
147 :group 'sieve-manage) 147 :group 'sieve-manage)
148 148
149(defcustom sieve-manage-ignore-broken-tls nil
150 "Ignore STARTTLS even if STARTTLS capability is provided."
151 :type 'boolean
152 :group 'sieve-manage)
153
149;; Internal variables: 154;; Internal variables:
150 155
151(defconst sieve-manage-local-variables '(sieve-manage-server 156(defconst sieve-manage-local-variables '(sieve-manage-server
@@ -210,14 +215,16 @@ Return the buffer associated with the connection."
210 :return-list t 215 :return-list t
211 :starttls-function 216 :starttls-function
212 (lambda (capabilities) 217 (lambda (capabilities)
213 (when (string-match "\\bSTARTTLS\\b" capabilities) 218 (when (and (not sieve-manage-ignore-broken-tls)
214 "STARTTLS\r\n"))) 219 (string-match "\\bSTARTTLS\\b" capabilities))
220 "STARTTLS\r\n")))
215 (setq sieve-manage-process proc) 221 (setq sieve-manage-process proc)
216 (setq sieve-manage-capability 222 (setq sieve-manage-capability
217 (sieve-manage-parse-capability (plist-get props :capabilities))) 223 (sieve-manage-parse-capability (plist-get props :capabilities)))
218 ;; Ignore new capabilities issues after successful STARTTLS 224 ;; Ignore new capabilities issues after successful STARTTLS
219 (when (and (memq stream '(nil network starttls)) 225 (when (or sieve-manage-ignore-broken-tls
220 (eq (plist-get props :type) 'tls)) 226 (and (memq stream '(nil network starttls))
227 (eq (plist-get props :type) 'tls)))
221 (sieve-manage-drop-next-answer)) 228 (sieve-manage-drop-next-answer))
222 (current-buffer)))) 229 (current-buffer))))
223 230