From: Reiner Steib <reinersteib+gmane@imap.cc>
To: ding@gnus.org, xemacs-beta@xemacs.org
Cc: Dave Love <fx@gnu.org>
Subject: Re: IMAP and Exchange 2007 - imap-fetch-safe
Date: Mon, 02 Feb 2009 20:19:58 +0100 [thread overview]
Message-ID: <878woolk81.fsf@marauder.physik.uni-ulm.de> (raw)
In-Reply-To: <84vdrsvqhj.fsf@incoming.verizon.net> (Dave Goldberg's message of "Mon, 02 Feb 2009 09:54:32 -0500")
On Mon, Feb 02 2009, Dave Goldberg wrote:
> Unfortunately I cannot report the same success. I use XEmacs:
>
> "XEmacs 21.4 (patch 21) \"Educational Television\" [Lucid] (x86_64-unknown-linux, Mule) of Tue Jan 6 2009 on blackbird"
Does anyone have an idea what is different in XEmacs?
Here's the relevant code:
(defun imap-fetch-safe (uids props &optional receive nouidfetch buffer)
"Like `imap-fetch', but DTRT with Exchange 2007 bug.
However, UIDS here is a cons, where the car is the canonical form
of the UIDS specification, and the cdr is the one which works with
Exchange 2007 or, potentially, other buggy servers.
See `imap-enable-exchange-bug-workaround'."
;; The first time we get here for a given, we'll try the canonical
;; form. If we get the known error from the buggy server, set the
;; flag buffer-locally (to account for connections to multiple
;; servers), then re-try with the alternative UIDS spec. We don't
;; unconditionally use the alternative form, since the
;; currently-used alternatives are seriously inefficient with some
;; servers (although they are valid).
;;
;; FIXME: Maybe it would be cleaner to have a flag to not signal
;; the error (which otherwise gives a message), and test
;; `imap-failed-tags'. Also, Other IMAP clients use other forms of
;; request which work with Exchange, e.g. Claws does "UID FETCH 1:*
;; (UID)" rather than "FETCH UID 1,*". Is there a good reason not
;; to do the same?
(condition-case data
;; Binding `debug-on-error' allows us to get the error from
;; `imap-parse-response' -- it's normally caught by Emacs around
;; execution of a process filter.
(let ((debug-on-error t))
(imap-fetch (if imap-enable-exchange-bug-workaround
(cdr uids)
(car uids))
props receive nouidfetch buffer))
(error
(if (and (not imap-enable-exchange-bug-workaround)
;; This is the Exchange 2007 response. It may be more
;; robust just to check for a BAD response to the
;; attempted fetch.
(string-match "The specified message set is invalid"
(cadr data)))
(with-current-buffer (or buffer (current-buffer))
(set (make-local-variable 'imap-enable-exchange-bug-workaround)
t)
(imap-fetch (cdr uids) props receive nouidfetch))
(signal (car data) (cdr data))))))
> and if I don't set imap-enable-exchange-bug-workaround to t, I get
> this backtrace:
>
> Debugger entered--Lisp error: (error "Internal error, tag 13 status BAD code nil text The specified message set is invalid.")
> signal(error ("Internal error, tag 13 status BAD code nil text The specified message set is invalid."))
> cerror("Internal error, tag %s status %s code %s text %s" 13 BAD nil "The specified message set is invalid.")
> apply(cerror "Internal error, tag %s status %s code %s text %s" (13 BAD nil "The specified message set is invalid."))
> error("Internal error, tag %s status %s code %s text %s" 13 BAD nil "The specified message set is invalid.")
> imap-parse-response()
> imap-arrival-filter(#<process "imap<1>" pid 10620 state:run> "ecified message set is invalid.
> \n")
> accept-process-output(#<process "imap<1>" pid 10620 state:run> 0 100)
> imap-wait-for-tag(13 nil)
> imap-send-command-wait("FETCH 1,* UID")
> imap-fetch("1,*" "UID" nil nouidfetch nil)
> byte-code("..." [nouidfetch receive props imap-enable-exchange-bug-workaround debug-on-error uids t imap-fetch buffer] 6)
> imap-fetch-safe(("1,*" . "1,*:*") "UID" nil nouidfetch)
> nnimap-find-minmax-uid("INBOX" examine)
> nnimap-retrieve-groups(("INBOX" "Calendar" "Sent Items" "INBOX/Miscellaneous" "INBOX/MessageArchive" "Contacts") "imc")
> gnus-retrieve-groups(("INBOX" "Calendar" "Sent Items" "INBOX/Miscellaneous" "INBOX/MessageArchive" "Contacts") (nnimap "imc" (nnimap-address "imc.mitre.org") (nnimap-stream starttls) (nnimap-server-port 143) (nnimap-need-unselect-to-notice-new-mail t) (nnimap-nov-is-evil t)))
> gnus-read-active-file-2(("INBOX" "Calendar" "Sent Items" "INBOX/Miscellaneous" "INBOX/MessageArchive" "Contacts") (nnimap "imc" (nnimap-address "imc.mitre.org") (nnimap-stream starttls) (nnimap-server-port 143) (nnimap-need-unselect-to-notice-new-mail t) (nnimap-nov-is-evil t)))
> gnus-read-active-file-1((nnimap "imc" (nnimap-address "imc.mitre.org") (nnimap-stream starttls) (nnimap-server-port 143) (nnimap-need-unselect-to-notice-new-mail t) (nnimap-nov-is-evil t)) nil)
> gnus-read-active-file(nil nil)
> gnus-setup-news(nil nil nil)
> byte-code("..." [gnus-slave gnus-current-startup-file gnus-startup-file did-connect level dont-connect gnus-group-quit gnus-run-hooks gnus-startup-hook gnus-make-newsrc-file gnus-dribble-read-file gnus-request-create-group "queue" (nndraft "") "drafts" (nndraft "") gnus-setup-news nil gnus-setup-news-hook gnus-start-draft-setup gnus-group-list-groups gnus-group-first-unread-group gnus-configure-windows group gnus-group-set-mode-line gnus-started-hook gnus-use-dribble-file gnus-agent] 4)
> gnus-1(nil nil nil)
> gnus(nil)
> call-interactively(gnus)
> command-execute(gnus t)
> execute-extended-command(nil)
> call-interactively(execute-extended-command)
Bye, Reiner.
--
,,,
(o o)
---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/
next prev parent reply other threads:[~2009-02-02 19:19 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <87iqphil5p.fsf@liv.ac.uk>
2008-12-22 22:38 ` imap.el workaround for Exchange 2007 Reiner Steib
2008-12-23 15:41 ` Dave Love
2009-01-01 18:34 ` Reiner Steib
2009-01-02 22:20 ` Ted Zlatanov
2009-01-02 22:38 ` Reiner Steib
2009-01-09 12:00 ` Simon Josefsson
2009-01-01 18:55 ` FIXMEs in imap.el and nnimap.el (was: imap.el workaround for Exchange 2007) Reiner Steib
2009-01-02 22:19 ` FIXMEs in imap.el and nnimap.el Ted Zlatanov
2009-01-02 22:57 ` Reiner Steib
2009-01-04 23:10 ` Dave Love
2009-01-07 21:07 ` Dave Love
2009-01-08 20:42 ` Reiner Steib
2009-01-07 19:25 ` Ted Zlatanov
2009-01-08 21:04 ` Reiner Steib
2009-01-13 10:40 ` Dave Love
2009-01-13 17:00 ` IMAP and Exchange 2007 - imap-fetch-safe (was: FIXMEs in imap.el and nnimap.el) Reiner Steib
2009-01-13 17:20 ` IMAP and Exchange 2007 - imap-fetch-safe Simon Josefsson
2009-01-17 20:58 ` Dave Love
2009-01-28 1:18 ` Dave Love
2009-01-31 15:27 ` Reiner Steib
2009-02-01 15:43 ` Bjorn Solberg
2009-02-02 14:54 ` Dave Goldberg
2009-02-02 19:19 ` Reiner Steib [this message]
2009-02-03 16:21 ` Stephen J. Turnbull
2009-02-08 18:00 ` Dave Love
2009-02-08 18:38 ` Dave Goldberg
2009-02-02 19:15 ` Reiner Steib
2009-01-13 18:28 ` Bjorn Solberg
2009-01-13 20:18 ` Bjorn Solberg
2009-01-17 20:59 ` Dave Love
2009-01-04 20:08 ` FIXMEs in imap.el and nnimap.el Dave Love
2009-01-05 16:13 ` Dave Love
2009-01-05 20:35 ` Conventions (was: FIXMEs in imap.el and nnimap.el) Reiner Steib
2009-01-06 11:33 ` Conventions Tassilo Horn
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=878woolk81.fsf@marauder.physik.uni-ulm.de \
--to=reinersteib+gmane@imap.cc \
--cc=Reiner.Steib@gmx.de \
--cc=ding@gnus.org \
--cc=fx@gnu.org \
--cc=xemacs-beta@xemacs.org \
/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).