From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/71972 Path: news.gmane.org!not-for-mail From: Simon Josefsson Newsgroups: gmane.emacs.gnus.general Subject: Re: nnimap issues Date: Mon, 27 Sep 2010 16:26:00 +0200 Message-ID: <8739svxnyf.fsf@mocca.josefsson.org> References: <878w2olqoa.fsf@mocca.josefsson.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1285597636 27132 80.91.229.12 (27 Sep 2010 14:27:16 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 27 Sep 2010 14:27:16 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M20345@lists.math.uh.edu Mon Sep 27 16:27:15 2010 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1P0Efh-0004ej-1g for ding-account@gmane.org; Mon, 27 Sep 2010 16:27:13 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1P0EfC-0000Sd-2S; Mon, 27 Sep 2010 09:26:42 -0500 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1P0Ef8-0000SF-Jk for ding@lists.math.uh.edu; Mon, 27 Sep 2010 09:26:38 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtp (Exim 4.72) (envelope-from ) id 1P0Ef3-0002lh-PD for ding@lists.math.uh.edu; Mon, 27 Sep 2010 09:26:37 -0500 Original-Received: from yxa-v.extundo.com ([83.241.177.39]) by quimby.gnus.org with esmtp (Exim 3.36 #1 (Debian)) id 1P0Ef1-00039O-00 for ; Mon, 27 Sep 2010 16:26:32 +0200 Original-Received: from mocca (c80-216-27-64.bredband.comhem.se [80.216.27.64]) (authenticated bits=0) by yxa-v.extundo.com (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id o8REQ4CS029207 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT) for ; Mon, 27 Sep 2010 16:26:18 +0200 OpenPGP: id=B565716F; url=http://josefsson.org/key.txt Mail-Copies-To: nobody X-Hashcash: 1:22:100927:ding@gnus.org::qr2h+QoCLnflUkIL:5Me7 In-Reply-To: (Lars Magne Ingebrigtsen's message of "Sun, 26 Sep 2010 19:49:14 +0200") User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.2 (gnu/linux) X-Spam-Status: No, score=-0.8 required=5.0 tests=AWL,BAYES_00, DATE_IN_FUTURE_96_XX,RDNS_DYNAMIC,SPF_FAIL autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on yxa-v.extundo.com X-Virus-Scanned: clamav-milter 0.96.3 at yxa-v X-Virus-Status: Clean X-Spam-Score: -0.9 (/) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:71972 Archived-At: Lars Magne Ingebrigtsen writes: > Lars Magne Ingebrigtsen writes: > >> Yes, it should check the capabilites and auto-STARTTLS if it's >> available, I guess? > > Looking at this, we have to decide whether to start doing STARTTLS > before we get to the server -- we have to open the connection with > `starttls-open-stream', which requires an external program (or the > internal support Ted is working on), and can't just start with a simple > network connection and then switch if it turns out that the server > really supports STARTTLS. Unfortunately. > > I think. The old code opened a native elisp network connection, and upon noticing the STARTTLS capability, re-opened the connection using starttls.el and then upgraded that connection. This was actually all done by imap.el, and nnimap.el was not involved at all -- the only necessary thing is that nnimap let imap.el auto-detect the stream to use by not providing a imap-stream unless specified by the user. See old code in imap-open: ... (message "imap: Connecting to %s..." imap-server) (if (null (let ((imap-stream (or imap-stream imap-default-stream))) (imap-open-1 buffer))) (progn (message "imap: Connecting to %s...failed" imap-server) nil) (when (null imap-stream) ;; Need to choose stream. (let ((streams imap-streams)) (while (setq stream (pop streams)) ;; OK to use this stream? (when (funcall (nth 1 (assq stream imap-stream-alist)) buffer) ;; Stream changed? (if (not (eq imap-default-stream stream)) (with-current-buffer (get-buffer-create (generate-new-buffer-name " *temp*")) (mapc 'make-local-variable imap-local-variables) (imap-disable-multibyte) (buffer-disable-undo) (setq imap-server (or server imap-server)) (setq imap-port (or port imap-port)) (setq imap-auth (or auth imap-auth)) (message "imap: Reconnecting with stream `%s'..." stream) ... /Simon