summaryrefslogtreecommitdiff
path: root/lisp/gnus/nnimap.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/gnus/nnimap.el')
-rw-r--r--lisp/gnus/nnimap.el26
1 files changed, 25 insertions, 1 deletions
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el
index 3fbcef60bc0..bb9f5691984 100644
--- a/lisp/gnus/nnimap.el
+++ b/lisp/gnus/nnimap.el
@@ -304,6 +304,7 @@ textual parts.")
((or (eq nnimap-stream 'network)
(and (eq nnimap-stream 'starttls)
(fboundp 'open-gnutls-stream)))
+ (message "Opening connection to %s..." nnimap-address)
(open-network-stream
"*nnimap*" (current-buffer) nnimap-address
(setq port
@@ -313,18 +314,22 @@ textual parts.")
"143"))))
'("143" "imap"))
((eq nnimap-stream 'shell)
+ (message "Opening connection to %s via shell..." nnimap-address)
(nnimap-open-shell-stream
"*nnimap*" (current-buffer) nnimap-address
(setq port (or nnimap-server-port "imap")))
'("imap"))
((eq nnimap-stream 'starttls)
+ (message "Opening connection to %s via starttls..."
+ nnimap-address)
(let ((tls-program
- '("openssl s_client %s -connect %h:%p -no_ssl2 -ign_eof -starttls imap")))
+ '("openssl s_client -connect %h:%p -no_ssl2 -ign_eof -starttls imap")))
(open-tls-stream
"*nnimap*" (current-buffer) nnimap-address
(setq port (or nnimap-server-port "imap"))))
'("imap"))
((memq nnimap-stream '(ssl tls))
+ (message "Opening connection to %s via tls..." nnimap-address)
(funcall (if (fboundp 'open-gnutls-stream)
'open-gnutls-stream
'open-tls-stream)
@@ -1311,6 +1316,25 @@ textual parts.")
(setq nnimap-status-string "Read-only server")
nil)
+(deffoo nnimap-request-thread (id)
+ (let* ((refs (split-string
+ (or (mail-header-references (gnus-summary-article-header))
+ "")))
+ (cmd (let ((value
+ (format
+ "(OR HEADER REFERENCES %s HEADER Message-Id %s)"
+ id id)))
+ (dolist (refid refs value)
+ (setq value (format
+ "(OR (OR HEADER Message-Id %s HEADER REFERENCES %s) %s)"
+ refid refid value)))))
+ (result
+ (with-current-buffer (nnimap-buffer)
+ (nnimap-command "UID SEARCH %s" cmd))))
+ (gnus-fetch-headers (and (car result)
+ (delete 0 (mapcar #'string-to-number
+ (cdr (assoc "SEARCH" (cdr result)))))))))
+
(defun nnimap-possibly-change-group (group server)
(let ((open-result t))
(when (and server