Subject: bug#24422: closed (Re: bug#24422: Proposal to create `sieve-manage-ignore-broken-tls' option)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 12 Sep 2016 23:09:02 +0000

Your bug report

#24422: Proposal to create `sieve-manage-ignore-broken-tls' option

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
24422: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=24422
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#24422: Proposal to create `sieve-manage-ignore-broken-tls' option
From: Katsumi Yamaoka <[email-masked]>
To: [email-masked]
Cc: [email-masked]
Date: Tue, 13 Sep 2016 08:08:37 +0900
List-Id: <debbugs-submit.debbugs.gnu.org>

On Mon, 12 Sep 2016 15:57:24 -0400, TSUCHIYA Masatoshi wrote:
> When accessing a managesieve server which provides broken TLS
> connections, it is quite useful that sieve-manage-open-server() ignores
> STARTTLS capability.  Therefore, I propose the following patch.

The patch looks fine and not likely to cause a trouble.  I've
committed it in the Emacs master with this log entry:

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).

Thanks.

Subject: Proposal to create `sieve-manage-ignore-broken-tls' option
From: TSUCHIYA Masatoshi <[email-masked]>
To: [email-masked]
Date: Mon, 12 Sep 2016 15:57:24 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi,

When accessing a managesieve server which provides broken TLS
connections, it is quite useful that sieve-manage-open-server() ignores
STARTTLS capability.  Therefore, I propose the following patch.

Regards,

-- 
TSUCHIYA Masatoshi
--- a/lisp/sieve-manage.el
+++ b/lisp/sieve-manage.el
@@ -147,6 +147,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
@@ -211,14 +216,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))))