* imap.el (imap-enable-exchange-bug-workaround): New variable.
(imap-message-copyuid-1): Use it.
(imap-message-appenduid-1): Likewise. Based on patch by Nathan
J. Williams in
<http://permalink.gmane.org/gmane.emacs.gnus.general/65855>.
* nnimap.el (nnimap-enable-minmax-bug-workaround): Remove, replaced by
imap-enable-exchange-bug-workaround.
(nnimap-find-minmax-uid): Use imap-enable-exchange-bug-workaround.
+2008-04-02 Simon Josefsson <simon@josefsson.org>
+
+ * imap.el (imap-enable-exchange-bug-workaround): New variable.
+ (imap-message-copyuid-1): Use it.
+ (imap-message-appenduid-1): Likewise. Based on patch by Nathan
+ J. Williams in
+ <http://permalink.gmane.org/gmane.emacs.gnus.general/65855>.
+
+ * nnimap.el (nnimap-enable-minmax-bug-workaround): Remove, replaced by
+ imap-enable-exchange-bug-workaround.
+ (nnimap-find-minmax-uid): Use imap-enable-exchange-bug-workaround.
+
2008-04-01 Simon Josefsson <simon@josefsson.org>
* nnimap.el (nnimap-find-minmax-uid): Revert last fix, the "fix" turns
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.'.")
+
\f
;; Utility functions:
(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))))
(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))))
;; 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
(imap-mailbox-select group examine))
(let (minuid maxuid)
(when (> (imap-mailbox-get 'exists) 0)
- (imap-fetch (if nnimap-enable-minmax-bug-workaround "1:*" "1,*")
+ (imap-fetch (if imap-enable-exchange-bug-workaround "1,*:*" "1,*")
"UID" nil 'nouidfetch)
(imap-message-map (lambda (uid Uid)
(setq minuid (if minuid (min minuid uid) uid)