comparison lisp/net/imap.el @ 101804:d775b84fdd71

Merge from gnus--devo--0 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-1537
author Miles Bader <miles@gnu.org>
date Thu, 05 Feb 2009 02:34:34 +0000
parents a16e9f7c2536
children 714ab1b8092b
comparison
equal deleted inserted replaced
101803:775ac8caba3d 101804:d775b84fdd71
1796 "Like `imap-fetch', but DTRT with Exchange 2007 bug. 1796 "Like `imap-fetch', but DTRT with Exchange 2007 bug.
1797 However, UIDS here is a cons, where the car is the canonical form 1797 However, UIDS here is a cons, where the car is the canonical form
1798 of the UIDS specification, and the cdr is the one which works with 1798 of the UIDS specification, and the cdr is the one which works with
1799 Exchange 2007 or, potentially, other buggy servers. 1799 Exchange 2007 or, potentially, other buggy servers.
1800 See `imap-enable-exchange-bug-workaround'." 1800 See `imap-enable-exchange-bug-workaround'."
1801 ;; We don't unconditionally use the alternative (valid) form, since 1801 ;; The first time we get here for a given, we'll try the canonical
1802 ;; this is said to be significantly inefficient. The first time we 1802 ;; form. If we get the known error from the buggy server, set the
1803 ;; get here for a given, we'll try the canonical form. If we get 1803 ;; flag buffer-locally (to account for connections to multiple
1804 ;; the known error from the buggy server, set the flag 1804 ;; servers), then re-try with the alternative UIDS spec. We don't
1805 ;; buffer-locally (to account for connections to multiple servers), 1805 ;; unconditionally use the alternative form, since the
1806 ;; then re-try with the alternative UIDS spec. 1806 ;; currently-used alternatives are seriously inefficient with some
1807 ;; servers (although they are valid).
1808 ;;
1809 ;; FIXME: Maybe it would be cleaner to have a flag to not signal
1810 ;; the error (which otherwise gives a message), and test
1811 ;; `imap-failed-tags'. Also, Other IMAP clients use other forms of
1812 ;; request which work with Exchange, e.g. Claws does "UID FETCH 1:*
1813 ;; (UID)" rather than "FETCH UID 1,*". Is there a good reason not
1814 ;; to do the same?
1807 (condition-case data 1815 (condition-case data
1808 (imap-fetch (if imap-enable-exchange-bug-workaround 1816 ;; Binding `debug-on-error' allows us to get the error from
1809 (cdr uids) 1817 ;; `imap-parse-response' -- it's normally caught by Emacs around
1810 (car uids)) 1818 ;; execution of a process filter.
1811 props receive nouidfetch buffer) 1819 (let ((debug-on-error t))
1820 (imap-fetch (if imap-enable-exchange-bug-workaround
1821 (cdr uids)
1822 (car uids))
1823 props receive nouidfetch buffer))
1812 (error 1824 (error
1813 (if (and (not imap-enable-exchange-bug-workaround) 1825 (if (and (not imap-enable-exchange-bug-workaround)
1814 (string-match 1826 ;; This is the Exchange 2007 response. It may be more
1815 "The specified message set is invalid" 1827 ;; robust just to check for a BAD response to the
1816 (cadr data))) 1828 ;; attempted fetch.
1829 (string-match "The specified message set is invalid"
1830 (cadr data)))
1817 (with-current-buffer (or buffer (current-buffer)) 1831 (with-current-buffer (or buffer (current-buffer))
1818 (set (make-local-variable 1832 (set (make-local-variable 'imap-enable-exchange-bug-workaround)
1819 'imap-enable-exchange-bug-workaround)
1820 t) 1833 t)
1821 (imap-fetch (cdr uids) props receive nouidfetch)) 1834 (imap-fetch (cdr uids) props receive nouidfetch))
1822 (signal (car data) (cdr data)))))) 1835 (signal (car data) (cdr data))))))
1823 1836
1824 (defun imap-message-copyuid-1 (mailbox) 1837 (defun imap-message-copyuid-1 (mailbox)
3025 imap-mailbox-acl-delete 3038 imap-mailbox-acl-delete
3026 imap-current-message 3039 imap-current-message
3027 imap-list-to-message-set 3040 imap-list-to-message-set
3028 imap-fetch-asynch 3041 imap-fetch-asynch
3029 imap-fetch 3042 imap-fetch
3043 imap-fetch-safe
3030 imap-message-put 3044 imap-message-put
3031 imap-message-get 3045 imap-message-get
3032 imap-message-map 3046 imap-message-map
3033 imap-search 3047 imap-search
3034 imap-message-flag-permanent-p 3048 imap-message-flag-permanent-p