diff options
| author | Lars Magne Ingebrigtsen | 2010-09-05 23:45:14 +0000 |
|---|---|---|
| committer | Katsumi Yamaoka | 2010-09-05 23:45:14 +0000 |
| commit | dfe1285d2ccff13c855e079c03768975715199f5 (patch) | |
| tree | 34b56d4384c760804291ecfd62af0f622d0f7667 | |
| parent | 8695c9a712dcc123d7a775a64bc4201269e86dfc (diff) | |
| download | emacs-dfe1285d2ccff13c855e079c03768975715199f5.tar.gz emacs-dfe1285d2ccff13c855e079c03768975715199f5.zip | |
imap.el (imap-fetch-safe, imap-enable-exchange-bug-workaround): Removed.
| -rw-r--r-- | lisp/ChangeLog | 9 | ||||
| -rw-r--r-- | lisp/gnus/nnimap.el | 2 | ||||
| -rw-r--r-- | lisp/net/imap.el | 59 |
3 files changed, 11 insertions, 59 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 77413d3cacc..5f28f61e4a7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,9 +1,16 @@ | |||
| 1 | 2010-09-05 Lars Magne Ingebrigtsen <larsi@gnus.org> | 1 | 2010-09-05 Lars Magne Ingebrigtsen <larsi@gnus.org> |
| 2 | 2 | ||
| 3 | * imap.el (imap-fetch-safe): Removed function, and altered all callers | ||
| 4 | to use `imap-fetch' instead. According to the comments, this should be | ||
| 5 | safe, since all other IMAP clients use the 1:* syntax. | ||
| 6 | (imap-enable-exchange-bug-workaround): Removed. | ||
| 7 | |||
| 8 | 2010-09-05 Lars Magne Ingebrigtsen <larsi@gnus.org> | ||
| 9 | |||
| 3 | * net/imap.el (imap-log): New convenience function used throughout | 10 | * net/imap.el (imap-log): New convenience function used throughout |
| 4 | instead of repeating the same code all over the place. | 11 | instead of repeating the same code all over the place. |
| 5 | 12 | ||
| 6 | 2010-09-05 David De La Harpe Golden <david@harpegolden.net> | 13 | 2010-09-05 David De La Harpe Golden <david@harpegolden.net> |
| 7 | 14 | ||
| 8 | * mouse.el (mouse-save-then-kill): Save region to kill-ring | 15 | * mouse.el (mouse-save-then-kill): Save region to kill-ring |
| 9 | when mouse-drag-copy-region is non-nil (Bug#6956). | 16 | when mouse-drag-copy-region is non-nil (Bug#6956). |
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index 3d415e71a2a..574eb85c238 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el | |||
| @@ -588,7 +588,7 @@ If EXAMINE is non-nil the group is selected read-only." | |||
| 588 | (imap-mailbox-select decoded-group examine)) | 588 | (imap-mailbox-select decoded-group examine)) |
| 589 | (let (minuid maxuid) | 589 | (let (minuid maxuid) |
| 590 | (when (> (imap-mailbox-get 'exists) 0) | 590 | (when (> (imap-mailbox-get 'exists) 0) |
| 591 | (imap-fetch-safe '("1,*" . "1,*:*") "UID" nil 'nouidfetch) | 591 | (imap-fetch "1:*" "UID" nil 'nouidfetch) |
| 592 | (imap-message-map (lambda (uid Uid) | 592 | (imap-message-map (lambda (uid Uid) |
| 593 | (setq minuid (if minuid (min minuid uid) uid) | 593 | (setq minuid (if minuid (min minuid uid) uid) |
| 594 | maxuid (if maxuid (max maxuid uid) uid))) | 594 | maxuid (if maxuid (max maxuid uid) uid))) |
diff --git a/lisp/net/imap.el b/lisp/net/imap.el index ed72d7b9ce0..88e8ee0222a 100644 --- a/lisp/net/imap.el +++ b/lisp/net/imap.el | |||
| @@ -448,18 +448,6 @@ The actual value is really the text on the continuation line.") | |||
| 448 | The function should take two arguments, the first the IMAP tag and the | 448 | The function should take two arguments, the first the IMAP tag and the |
| 449 | second the status (OK, NO, BAD etc) of the command.") | 449 | second the status (OK, NO, BAD etc) of the command.") |
| 450 | 450 | ||
| 451 | (defvar imap-enable-exchange-bug-workaround nil | ||
| 452 | "Send FETCH UID commands as *:* instead of *. | ||
| 453 | |||
| 454 | When non-nil, use an alternative UIDS form. Enabling appears to | ||
| 455 | be required for some servers (e.g., Microsoft Exchange 2007) | ||
| 456 | which otherwise would trigger a response 'BAD The specified | ||
| 457 | message set is invalid.'. We don't unconditionally use this | ||
| 458 | form, since this is said to be significantly inefficient. | ||
| 459 | |||
| 460 | This variable is set to t automatically per server if the | ||
| 461 | canonical form fails.") | ||
| 462 | |||
| 463 | 451 | ||
| 464 | ;; Utility functions: | 452 | ;; Utility functions: |
| 465 | 453 | ||
| @@ -1780,48 +1768,6 @@ is non-nil return these properties." | |||
| 1780 | (format "String %s cannot be converted to a Lisp integer" number)) | 1768 | (format "String %s cannot be converted to a Lisp integer" number)) |
| 1781 | number))) | 1769 | number))) |
| 1782 | 1770 | ||
| 1783 | (defun imap-fetch-safe (uids props &optional receive nouidfetch buffer) | ||
| 1784 | "Like `imap-fetch', but DTRT with Exchange 2007 bug. | ||
| 1785 | However, UIDS here is a cons, where the car is the canonical form | ||
| 1786 | of the UIDS specification, and the cdr is the one which works with | ||
| 1787 | Exchange 2007 or, potentially, other buggy servers. | ||
| 1788 | See `imap-enable-exchange-bug-workaround'." | ||
| 1789 | ;; The first time we get here for a given, we'll try the canonical | ||
| 1790 | ;; form. If we get the known error from the buggy server, set the | ||
| 1791 | ;; flag buffer-locally (to account for connections to multiple | ||
| 1792 | ;; servers), then re-try with the alternative UIDS spec. We don't | ||
| 1793 | ;; unconditionally use the alternative form, since the | ||
| 1794 | ;; currently-used alternatives are seriously inefficient with some | ||
| 1795 | ;; servers (although they are valid). | ||
| 1796 | ;; | ||
| 1797 | ;; FIXME: Maybe it would be cleaner to have a flag to not signal | ||
| 1798 | ;; the error (which otherwise gives a message), and test | ||
| 1799 | ;; `imap-failed-tags'. Also, Other IMAP clients use other forms of | ||
| 1800 | ;; request which work with Exchange, e.g. Claws does "UID FETCH 1:* | ||
| 1801 | ;; (UID)" rather than "FETCH UID 1,*". Is there a good reason not | ||
| 1802 | ;; to do the same? | ||
| 1803 | (condition-case data | ||
| 1804 | ;; Binding `debug-on-error' allows us to get the error from | ||
| 1805 | ;; `imap-parse-response' -- it's normally caught by Emacs around | ||
| 1806 | ;; execution of a process filter. | ||
| 1807 | (let ((debug-on-error t)) | ||
| 1808 | (imap-fetch (if imap-enable-exchange-bug-workaround | ||
| 1809 | (cdr uids) | ||
| 1810 | (car uids)) | ||
| 1811 | props receive nouidfetch buffer)) | ||
| 1812 | (error | ||
| 1813 | (if (and (not imap-enable-exchange-bug-workaround) | ||
| 1814 | ;; This is the Exchange 2007 response. It may be more | ||
| 1815 | ;; robust just to check for a BAD response to the | ||
| 1816 | ;; attempted fetch. | ||
| 1817 | (string-match "The specified message set is invalid" | ||
| 1818 | (cadr data))) | ||
| 1819 | (with-current-buffer (or buffer (current-buffer)) | ||
| 1820 | (set (make-local-variable 'imap-enable-exchange-bug-workaround) | ||
| 1821 | t) | ||
| 1822 | (imap-fetch (cdr uids) props receive nouidfetch)) | ||
| 1823 | (signal (car data) (cdr data)))))) | ||
| 1824 | |||
| 1825 | (defun imap-message-copyuid-1 (mailbox) | 1771 | (defun imap-message-copyuid-1 (mailbox) |
| 1826 | (if (imap-capability 'UIDPLUS) | 1772 | (if (imap-capability 'UIDPLUS) |
| 1827 | (list (nth 0 (imap-mailbox-get-1 'copyuid mailbox)) | 1773 | (list (nth 0 (imap-mailbox-get-1 'copyuid mailbox)) |
| @@ -1831,7 +1777,7 @@ See `imap-enable-exchange-bug-workaround'." | |||
| 1831 | (imap-message-data (make-vector 2 0))) | 1777 | (imap-message-data (make-vector 2 0))) |
| 1832 | (when (imap-mailbox-examine-1 mailbox) | 1778 | (when (imap-mailbox-examine-1 mailbox) |
| 1833 | (prog1 | 1779 | (prog1 |
| 1834 | (and (imap-fetch-safe '("*" . "*:*") "UID") | 1780 | (and (imap-fetch "*:*" "UID") |
| 1835 | (list (imap-mailbox-get-1 'uidvalidity mailbox) | 1781 | (list (imap-mailbox-get-1 'uidvalidity mailbox) |
| 1836 | (apply 'max (imap-message-map | 1782 | (apply 'max (imap-message-map |
| 1837 | (lambda (uid prop) uid) 'UID)))) | 1783 | (lambda (uid prop) uid) 'UID)))) |
| @@ -1877,7 +1823,7 @@ first element. The rest of list contains the saved articles' UIDs." | |||
| 1877 | (imap-message-data (make-vector 2 0))) | 1823 | (imap-message-data (make-vector 2 0))) |
| 1878 | (when (imap-mailbox-examine-1 mailbox) | 1824 | (when (imap-mailbox-examine-1 mailbox) |
| 1879 | (prog1 | 1825 | (prog1 |
| 1880 | (and (imap-fetch-safe '("*" . "*:*") "UID") | 1826 | (and (imap-fetch "*:*" "UID") |
| 1881 | (list (imap-mailbox-get-1 'uidvalidity mailbox) | 1827 | (list (imap-mailbox-get-1 'uidvalidity mailbox) |
| 1882 | (apply 'max (imap-message-map | 1828 | (apply 'max (imap-message-map |
| 1883 | (lambda (uid prop) uid) 'UID)))) | 1829 | (lambda (uid prop) uid) 'UID)))) |
| @@ -3013,7 +2959,6 @@ Return nil if no complete line has arrived." | |||
| 3013 | imap-list-to-message-set | 2959 | imap-list-to-message-set |
| 3014 | imap-fetch-asynch | 2960 | imap-fetch-asynch |
| 3015 | imap-fetch | 2961 | imap-fetch |
| 3016 | imap-fetch-safe | ||
| 3017 | imap-message-put | 2962 | imap-message-put |
| 3018 | imap-message-get | 2963 | imap-message-get |
| 3019 | imap-message-map | 2964 | imap-message-map |