comparison lisp/net/imap.el @ 93820:7c273495693a

Merge from gnus--devo--0 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-1110
author Miles Bader <miles@gnu.org>
date Mon, 07 Apr 2008 13:08:33 +0000
parents d3767aa9ae49
children 1e3a407766b9
comparison
equal deleted inserted replaced
93819:06a28dc5b518 93820:7c273495693a
437 437
438 (defvar imap-callbacks nil 438 (defvar imap-callbacks nil
439 "List of response tags and callbacks, on the form `(number . function)'. 439 "List of response tags and callbacks, on the form `(number . function)'.
440 The function should take two arguments, the first the IMAP tag and the 440 The function should take two arguments, the first the IMAP tag and the
441 second the status (OK, NO, BAD etc) of the command.") 441 second the status (OK, NO, BAD etc) of the command.")
442
443 (defvar imap-enable-exchange-bug-workaround nil
444 "Send FETCH UID commands as *:* instead of *.
445 Enabling this appears to be required for some servers (e.g.,
446 Microsoft Exchange) which otherwise would trigger a response 'BAD
447 The specified message set is invalid.'.")
442 448
443 449
444 ;; Utility functions: 450 ;; Utility functions:
445 451
446 (defun imap-remassoc (key alist) 452 (defun imap-remassoc (key alist)
1772 (let ((old-mailbox imap-current-mailbox) 1778 (let ((old-mailbox imap-current-mailbox)
1773 (state imap-state) 1779 (state imap-state)
1774 (imap-message-data (make-vector 2 0))) 1780 (imap-message-data (make-vector 2 0)))
1775 (when (imap-mailbox-examine-1 mailbox) 1781 (when (imap-mailbox-examine-1 mailbox)
1776 (prog1 1782 (prog1
1777 (and (imap-fetch "*" "UID") 1783 (and (imap-fetch
1784 (if imap-enable-exchange-bug-workaround "*:*" "*") "UID")
1778 (list (imap-mailbox-get-1 'uidvalidity mailbox) 1785 (list (imap-mailbox-get-1 'uidvalidity mailbox)
1779 (apply 'max (imap-message-map 1786 (apply 'max (imap-message-map
1780 (lambda (uid prop) uid) 'UID)))) 1787 (lambda (uid prop) uid) 'UID))))
1781 (if old-mailbox 1788 (if old-mailbox
1782 (imap-mailbox-select old-mailbox (eq state 'examine)) 1789 (imap-mailbox-select old-mailbox (eq state 'examine))
1816 (let ((old-mailbox imap-current-mailbox) 1823 (let ((old-mailbox imap-current-mailbox)
1817 (state imap-state) 1824 (state imap-state)
1818 (imap-message-data (make-vector 2 0))) 1825 (imap-message-data (make-vector 2 0)))
1819 (when (imap-mailbox-examine-1 mailbox) 1826 (when (imap-mailbox-examine-1 mailbox)
1820 (prog1 1827 (prog1
1821 (and (imap-fetch "*" "UID") 1828 (and (imap-fetch
1829 (if imap-enable-exchange-bug-workaround "*:*" "*") "UID")
1822 (list (imap-mailbox-get-1 'uidvalidity mailbox) 1830 (list (imap-mailbox-get-1 'uidvalidity mailbox)
1823 (apply 'max (imap-message-map 1831 (apply 'max (imap-message-map
1824 (lambda (uid prop) uid) 'UID)))) 1832 (lambda (uid prop) uid) 'UID))))
1825 (if old-mailbox 1833 (if old-mailbox
1826 (imap-mailbox-select old-mailbox (eq state 'examine)) 1834 (imap-mailbox-select old-mailbox (eq state 'examine))