]> git.eshelyaron.com Git - emacs.git/commitdiff
sieve-manage.el: Allow user to avoid STARTTLS capability test (bug#24422)
authorTSUCHIYA Masatoshi <tsuchiya@namazu.org>
Mon, 12 Sep 2016 23:06:43 +0000 (23:06 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Mon, 12 Sep 2016 23:06:43 +0000 (23:06 +0000)
* 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).

lisp/net/sieve-manage.el

index 695bbd860debef9a5ebcd7ecec6e88af5c779fc0..dbe8b22319b7a6acd0f6057d8eda6eb01f60b148 100644 (file)
@@ -146,6 +146,11 @@ for doing the actual authentication."
   :type 'symbol
   :group 'sieve-manage)
 
+(defcustom sieve-manage-ignore-broken-tls nil
+  "Ignore STARTTLS even if STARTTLS capability is provided."
+  :type 'boolean
+  :group 'sieve-manage)
+
 ;; Internal variables:
 
 (defconst sieve-manage-local-variables '(sieve-manage-server
@@ -210,14 +215,16 @@ Return the buffer associated with the connection."
          :return-list t
          :starttls-function
          (lambda (capabilities)
-           (when (string-match "\\bSTARTTLS\\b" capabilities)
-             "STARTTLS\r\n")))
+          (when (and (not sieve-manage-ignore-broken-tls)
+                     (string-match "\\bSTARTTLS\\b" capabilities))
+            "STARTTLS\r\n")))
       (setq sieve-manage-process proc)
       (setq sieve-manage-capability
             (sieve-manage-parse-capability (plist-get props :capabilities)))
       ;; Ignore new capabilities issues after successful STARTTLS
-      (when (and (memq stream '(nil network starttls))
-                 (eq (plist-get props :type) 'tls))
+      (when (or sieve-manage-ignore-broken-tls
+               (and (memq stream '(nil network starttls))
+                    (eq (plist-get props :type) 'tls)))
         (sieve-manage-drop-next-answer))
       (current-buffer))))