Function: nnimap-open-connection

nnimap-open-connection is a byte-compiled function defined in nnimap.el.gz.

Signature

(nnimap-open-connection BUFFER)

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/nnimap.el.gz
(defun nnimap-open-connection (buffer)
  ;; Be backwards-compatible -- the earlier value of nnimap-stream was
  ;; `ssl' when nnimap-server-port was nil.  Sort of.  But it's `tls'
  ;; now, because we're post the Great 2025 Spelling Reform.
  (when (and nnimap-server-port
	     (eq nnimap-stream 'undecided))
    (setq nnimap-stream 'tls))
  (let ((stream
	 (if (eq nnimap-stream 'undecided)
	     (cl-loop for type in '(tls network)
		   for stream = (let ((nnimap-stream type))
				  (nnimap-open-connection-1 buffer))
		   while (eq stream 'no-connect)
		   finally (return stream))
	   (nnimap-open-connection-1 buffer))))
    (if (eq stream 'no-connect)
	nil
      stream)))