Gnus development mailing list
 help / color / mirror / Atom feed
From: Simon Josefsson <simon@josefsson.org>
To: Jake Colman <colman@ppllc.com>
Cc: Ted Zlatanov <tzz@lifelogs.com>, "ding@gnus.org" <ding@gnus.org>,
	Emacs developers <emacs-devel@gnu.org>
Subject: Re: Exchange 2007 Issues When Copying Between Folders
Date: Tue, 01 Apr 2008 16:29:49 +0200	[thread overview]
Message-ID: <87r6dpir6q.fsf@mocca.josefsson.org> (raw)
In-Reply-To: <87k5jhpsev.fsf@mocca.josefsson.org> (Simon Josefsson's message of "Tue, 01 Apr 2008 16:21:28 +0200")

Simon Josefsson <simon@josefsson.org> writes:

> Jake Colman <colman@ppllc.com> writes:
>
>> Simon,
>>
>> Can you suggest something better to fix this problem?  I'm sure that I'm
>> not the only user who will want to use Gnus with Exchange 2007.  This
>> fix, incorrect though it may be, does work.  Is there something other
>> IMAP command that will get data in the way Gnus needs to see it?
>
> Does the fix work?  In another post you said it didn't help.
>
> We can introduce a variable nnimap-enable-exchange-bug-workaround that
> toggles the way the code works.  You can set that variable, if it indeed
> solves your problem, and others can leave it at its disabled default
> value.

Here is what I propose, if 1:* really solves the problem.  Please test
it, apply the patch and customize nnimap-enable-minmax-bug-workaround to
a non-nil value.

/Simon

--- nnimap.el	01 Apr 2008 16:03:24 +0200	7.44
+++ nnimap.el	01 Apr 2008 16:27:27 +0200	
@@ -219,6 +219,19 @@
 
 ;; Performance / bug workaround variables
 
+(defcustom nnimap-enable-minmax-bug-workaround nil
+  "Send UID FETCH UID commands as 1:* instead of 1,*.
+Enabling this appears to be required for some servers (e.g.,
+Exchange) which otherwise would trigger a response 'BAD The
+specified message set is invalid.'.
+Note that enabling this work around may cause significant
+performance penalties if you have large mailboxes.  It makes the
+code transfer one line of data for each message in a
+mailbox (i.e., O(n)) compared to transfering only two
+lines (i.e., O(1))."
+  :type 'boolean
+  :group 'nnimap)
+
 (defcustom nnimap-close-asynchronous t
   "Close mailboxes asynchronously in `nnimap-close-group'.
 This means that errors caught by nnimap when closing the mailbox will
@@ -555,7 +568,8 @@
 	      (imap-mailbox-select group examine))
       (let (minuid maxuid)
 	(when (> (imap-mailbox-get 'exists) 0)
-	  (imap-fetch "1,*" "UID" nil 'nouidfetch)
+	  (imap-fetch (if nnimap-enable-minmax-bug-workaround "1:*" "1,*")
+		      "UID" nil 'nouidfetch)
 	  (imap-message-map (lambda (uid Uid)
 			      (setq minuid (if minuid (min minuid uid) uid)
 				    maxuid (if maxuid (max maxuid uid) uid)))




  reply	other threads:[~2008-04-01 14:29 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-31 14:54 Jake Colman
2008-03-31 18:50 ` Ted Zlatanov
2008-04-01 14:06   ` Simon Josefsson
2008-04-01 14:13     ` Jake Colman
2008-04-01 14:14     ` Jake Colman
2008-04-01 14:21       ` Simon Josefsson
2008-04-01 14:29         ` Simon Josefsson [this message]
2008-04-01 14:34           ` Jake Colman
2008-04-01 14:49             ` Simon Josefsson
2008-04-02 14:22               ` Ted Zlatanov
2008-04-02 14:35                 ` Simon Josefsson
2008-04-01 22:00     ` Gaute Strokkenes
2008-04-01 22:08       ` Simon Josefsson
2008-04-02 14:19     ` Ted Zlatanov
2008-04-02 14:33       ` Simon Josefsson
2008-04-03 13:09         ` Ted Zlatanov

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=87r6dpir6q.fsf@mocca.josefsson.org \
    --to=simon@josefsson.org \
    --cc=colman@ppllc.com \
    --cc=ding@gnus.org \
    --cc=emacs-devel@gnu.org \
    --cc=tzz@lifelogs.com \
    /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).