all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: TSUCHIYA Masatoshi <tsuchiya@namazu.org>
To: 24422@debbugs.gnu.org
Subject: bug#24422: Proposal to create `sieve-manage-ignore-broken-tls' option
Date: Mon, 12 Sep 2016 15:57:24 -0400	[thread overview]
Message-ID: <87k2egsxgb.fsf@tsuchiya.vaj.namazu.org> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 247 bytes --]

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: Type: text/x-diff, Size: 1362 bytes --]

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 180 bytes --]

             reply	other threads:[~2016-09-12 19:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-12 19:57 TSUCHIYA Masatoshi [this message]
2016-09-12 23:08 ` bug#24422: Proposal to create `sieve-manage-ignore-broken-tls' option Katsumi Yamaoka
2016-09-13 13:21   ` Ted Zlatanov
2016-09-14  0:08     ` Katsumi Yamaoka
2016-09-20 13:00       ` Ted Zlatanov
2016-09-20 23:40         ` Katsumi Yamaoka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k2egsxgb.fsf@tsuchiya.vaj.namazu.org \
    --to=tsuchiya@namazu.org \
    --cc=24422@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.