From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/67437 Path: news.gmane.org!not-for-mail From: Reiner Steib Newsgroups: gmane.emacs.gnus.general Subject: Re: gnus IMAP vs. Exchange Server 2007 Date: Wed, 24 Sep 2008 20:27:49 +0200 Message-ID: <874p45qtzu.fsf@marauder.physik.uni-ulm.de> References: <9206c7e10809241007t13f92263lb4946826a852560f@mail.gmail.com> Reply-To: Reiner Steib NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1222285037 15409 80.91.229.12 (24 Sep 2008 19:37:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 24 Sep 2008 19:37:17 +0000 (UTC) Cc: Vitaly Mayatskikh , ding@gnus.org To: Mat Marcus Original-X-From: ding-owner+M15888@lists.math.uh.edu Wed Sep 24 21:38:14 2008 connect(): Connection refused 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.50) id 1KiaBd-00055D-JB for ding-account@gmane.org; Wed, 24 Sep 2008 21:38:10 +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 1KiaA5-0003sP-5Y; Wed, 24 Sep 2008 14:36:33 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1KiaA3-0003s4-KY for ding@lists.math.uh.edu; Wed, 24 Sep 2008 14:36:31 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.69) (envelope-from ) id 1Kia9z-0004dT-C4 for ding@lists.math.uh.edu; Wed, 24 Sep 2008 14:36:31 -0500 Original-Received: from mail.uni-ulm.de ([134.60.1.11]) by quimby.gnus.org with esmtp (Exim 3.36 #1 (Debian)) id 1KiaA3-0007E1-00 for ; Wed, 24 Sep 2008 21:36:31 +0200 Original-Received: from bridgekeeper.physik.uni-ulm.de (bridgekeeper.physik.uni-ulm.de [134.60.41.37]) by mail.uni-ulm.de (8.14.2/8.14.2) with ESMTP id m8OJaKDm022818; Wed, 24 Sep 2008 21:36:20 +0200 (MEST) Original-Received: from localhost (localhost [127.0.0.1]) by bridgekeeper.physik.uni-ulm.de (Postfix) with ESMTP id 154F413325; Wed, 24 Sep 2008 21:36:20 +0200 (CEST) X-Face: P05mdcZT&lL[-s2=mw~RsllZ0zZAb?vdE}.s, "Vitaly Mayatskikh" , ding@gnus.org In-Reply-To: <9206c7e10809241007t13f92263lb4946826a852560f@mail.gmail.com> (Mat Marcus's message of "Wed, 24 Sep 2008 10:07:09 -0700") User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.1 (gnu/linux) X-DCC-SIHOPE-DCC-3-Metrics: poseidon 1085; Body=3 Fuz1=3 Fuz2=3 X-Virus-Scanned: by amavisd-new X-Spam-Score: -2.6 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:67437 Archived-At: On Wed, Sep 24 2008, Mat Marcus wrote: > Vitaly Mayatskikh wrote: >> Mat Marcus writes: [...] >>> 3) in either case is there a patch workaround for gnus? I am >>> currently running gnus "5.11" that comes with emacs 22.1.1. [...] >> (setq imap-enable-exchange-bug-workaround t) >> >> "Documentation: >> Send FETCH UID commands as *:* instead of *. >> Enabling this appears to be required for some servers (e.g., >> Microsoft Exchange) which otherwise would trigger a response 'BAD >> The specified message set is invalid.'." > > Thanks for the reply. This variable is just what I need. C-h v > indicates that it is not present in the version of gnus that I have > (see 3, above). Do I just grab an arbitrary nightly snapshot and > replace my lisp/gnus folder? No. There are some options: - install the current development version (No Gnus) completely as described in the top-level README. - Insert this code (e.g. in ~/.gnus.el) *before* setting `imap-enable-exchange-bug-workaround': --8<---------------cut here---------------start------------->8--- ;; Workaround. Don't use with Gnus 5.12 or later. (require 'imap) (unless (boundp 'imap-enable-exchange-bug-workaround) (defvar imap-enable-exchange-bug-workaround nil "Send FETCH UID commands as *:* instead of *. Enabling this appears to be required for some servers (e.g., Microsoft Exchange) which otherwise would trigger a response 'BAD The specified message set is invalid.'. BACKPORT from No Gnus!") (defun imap-message-copyuid-1 (mailbox) (if (imap-capability 'UIDPLUS) (list (nth 0 (imap-mailbox-get-1 'copyuid mailbox)) (string-to-number (nth 2 (imap-mailbox-get-1 'copyuid mailbox)))) (let ((old-mailbox imap-current-mailbox) (state imap-state) (imap-message-data (make-vector 2 0))) (when (imap-mailbox-examine-1 mailbox) (prog1 (and (imap-fetch (if imap-enable-exchange-bug-workaround "*:*" "*") "UID") (list (imap-mailbox-get-1 'uidvalidity mailbox) (apply 'max (imap-message-map (lambda (uid prop) uid) 'UID)))) (if old-mailbox (imap-mailbox-select old-mailbox (eq state 'examine)) (imap-mailbox-unselect))))))) (defun imap-message-appenduid-1 (mailbox) (if (imap-capability 'UIDPLUS) (imap-mailbox-get-1 'appenduid mailbox) (let ((old-mailbox imap-current-mailbox) (state imap-state) (imap-message-data (make-vector 2 0))) (when (imap-mailbox-examine-1 mailbox) (prog1 (and (imap-fetch (if imap-enable-exchange-bug-workaround "*:*" "*") "UID") (list (imap-mailbox-get-1 'uidvalidity mailbox) (apply 'max (imap-message-map (lambda (uid prop) uid) 'UID)))) (if old-mailbox (imap-mailbox-select old-mailbox (eq state 'examine)) (imap-mailbox-unselect))))))) (message "Workaround `imap-enable-exchange-bug-workaround' added.")) (setq imap-enable-exchange-bug-workaround t) --8<---------------cut here---------------end--------------->8--- - install the following patch (and recompile imap.el): --8<---------------cut here---------------start------------->8--- --- imap.el 2 Mar 2008 16:55:00 -0000 7.44 +++ imap.el 2 Apr 2008 14:46:57 -0000 7.45 @@ -440,6 +440,12 @@ The function should take two arguments, the first the IMAP tag and the second the status (OK, NO, BAD etc) of the command.") +(defvar imap-enable-exchange-bug-workaround nil + "Send FETCH UID commands as *:* instead of *. +Enabling this appears to be required for some servers (e.g., +Microsoft Exchange) which otherwise would trigger a response 'BAD +The specified message set is invalid.'.") + ;; Utility functions: @@ -1774,7 +1780,8 @@ (imap-message-data (make-vector 2 0))) (when (imap-mailbox-examine-1 mailbox) (prog1 - (and (imap-fetch "*" "UID") + (and (imap-fetch + (if imap-enable-exchange-bug-workaround "*:*" "*") "UID") (list (imap-mailbox-get-1 'uidvalidity mailbox) (apply 'max (imap-message-map (lambda (uid prop) uid) 'UID)))) @@ -1818,7 +1825,8 @@ (imap-message-data (make-vector 2 0))) (when (imap-mailbox-examine-1 mailbox) (prog1 - (and (imap-fetch "*" "UID") + (and (imap-fetch + (if imap-enable-exchange-bug-workaround "*:*" "*") "UID") (list (imap-mailbox-get-1 'uidvalidity mailbox) (apply 'max (imap-message-map (lambda (uid prop) uid) 'UID)))) --8<---------------cut here---------------end--------------->8--- > Or will this introduce more "instabilities" than it is worth? Or am > I better off downloading and compiling a newer emacs? If so, which > version will suffice? It's only in the development version of Emacs (to become Emacs 23). Unfortunately we didn't apply this patch to v5-10 so that it is not included in the recently released Emacs 22.3. Bye, Reiner. -- ,,, (o o) ---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/