Gnus development mailing list
 help / color / mirror / Atom feed
From: Simon Josefsson <simon@josefsson.org>
To: ding@gnus.org
Subject: Re: nnimap issues
Date: Mon, 27 Sep 2010 16:26:00 +0200	[thread overview]
Message-ID: <8739svxnyf.fsf@mocca.josefsson.org> (raw)
In-Reply-To: <m37hi84cpx.fsf@quimbies.gnus.org> (Lars Magne Ingebrigtsen's message of "Sun, 26 Sep 2010 19:49:14 +0200")

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> Lars Magne Ingebrigtsen <larsi@gnus.org> 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



  reply	other threads:[~2010-09-27 14:26 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-26 10:55 Simon Josefsson
2010-09-26 16:17 ` Lars Magne Ingebrigtsen
2010-09-26 17:08   ` Lars Magne Ingebrigtsen
2010-09-26 18:33     ` Steinar Bang
2010-09-26 18:40       ` Lars Magne Ingebrigtsen
2010-09-26 23:44         ` Daniel Pittman
2010-09-26 17:49   ` Lars Magne Ingebrigtsen
2010-09-27 14:26     ` Simon Josefsson [this message]
2010-09-27 16:56       ` Lars Magne Ingebrigtsen
2010-09-27 14:39   ` Simon Josefsson
2010-09-27 17:20     ` Lars Magne Ingebrigtsen
2010-09-27 17:25       ` Steinar Bang
2010-09-27 17:39         ` Julien Danjou
2010-09-27 21:17           ` Frank Schmitt
2010-09-28  8:08 ` Steinar Bang
2010-09-28  8:35   ` David Engster
2010-09-28 13:00     ` Steinar Bang
2010-09-29 15:06       ` Lars Magne Ingebrigtsen
2010-10-12  6:45       ` Steinar Bang
2010-10-12 12:44         ` Lars Magne Ingebrigtsen

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=8739svxnyf.fsf@mocca.josefsson.org \
    --to=simon@josefsson.org \
    --cc=ding@gnus.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).