You are not logged in.

#1 2022-05-06 15:42:00

dtbaumann
Member
Registered: 2015-07-03
Posts: 28

[SOLVED] Emacs/Gnus imap search fails on Exchange servers

Thought I put this here because these forums have always been the most reliable source for solutions if "something does not work as expected"

With Emacs 28.1 all searches through mails on Exchange servers fail and return empty result groups. Other IMAP servers work without problems. The culprit has been identified in

https://emacs.stackexchange.com/questio … mpty-group

The problem can be solved temporarily by patching /usr/share/emacs/28.1/lisp/gnus/gnus-search.el.gz  and putting it somewhere into the local load-path for lisp files. A bug report seems to be pending.

*** /usr/share/emacs/28.1/lisp/gnus/gnus-search.el 2022-05-06 17:25:27.807462678 +0200
--- ~/share/lisp/gnus-search.el 2022-05-06 17:25:27.812230453 +0200
@@ -1093,7 +1093,8 @@
       (let* ((nnimap-streaming t)
 	     (call
 	      (nnimap-send-command
-	       "UID SEARCH CHARSET UTF-8 %s"
+;;	       "UID SEARCH CHARSET UTF-8 %s"
+	       "UID SEARCH CHARSET US-ASCII %s"
 	       (pop query))))
 	(dolist (l query)
 	  (process-send-string (get-buffer-process (current-buffer)) l)
@@ -1268,7 +1269,7 @@
 	(if literal-plus
 	    (format "{%d+}\n%s"
 		    (string-bytes str)
-		    (encode-coding-string str 'utf-8))
+		    (encode-coding-string str 'us-ascii))
 	  ;; Otherwise, if the user hasn't already quoted the string,
 	  ;; quote it for them.
 	  (if (string-prefix-p "\"" str)

Offline

Board footer

Powered by FluxBB