GNU bug report logs -
#4358
23.1.50; Arithmetic overflow errors break imap
Previous Next
Reported by: James Cloos <cloos <at> jhcloos.com>
Date: Sun, 6 Sep 2009 13:55:05 UTC
Severity: normal
Done: Chong Yidong <cyd <at> stupidchicken.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> which (of course) shows that the imapd is sending the large value.
> Which quite simply does not make sense, as there are certainly not
> that many unseen messages in INBOX. A quick check via telnet shows
> that the imapd does indeed reply to a STATUS INBOX (UNSEEN) command
> with that string, so I'll have to debug that.
Yes, please investigate, to try and seen if it's likely to be a common
problem, or rather a "local error".
> But it would still be nice if gnus didn't crap out when that occurs.
Yes, clearly.
> What can be done to deal with that w/o raising an exception?
Catch the exception and use another number? In this case, I'd guess
that most-positive-fixnum would do the trick. Tho, maybe in the general
case, our error signal could/should carry a bit more info so you'd know
whether to use most-positive-fixnum or most-negative-fixnum.
I'd suggest the patch below, tho if you could provide some more info
about your IMAP server (like name and version number), it'd be good to
add it to the comment.
Stefan
=== modified file 'lisp/net/imap.el'
--- lisp/net/imap.el 2009-09-09 14:17:42 +0000
+++ lisp/net/imap.el 2009-09-09 15:04:06 +0000
@@ -2699,7 +2699,17 @@
(imap-mailbox-put 'uidvalidity (match-string 0) mailbox)
(goto-char (match-end 0))))
((string= token "UNSEEN")
- (imap-mailbox-put 'unseen (read (current-buffer)) mailbox))
+ (imap-mailbox-put 'unseen
+ (condition-case err
+ (read (current-buffer))
+ ;; It seems that some IMAP servers can
+ ;; return very large unseen numbers,
+ ;; like 4294967287 (see bug#4358).
+ (overflow-error
+ ;; Don't go down without a fight.
+ (message "Insanely large number of unseen messages (%s) !!" (cadr err))
+ most-positive-fixnum))
+ mailbox))
(t
(message "Unknown status data %s in mailbox %s ignored"
token mailbox)
This bug report was last modified 14 years and 331 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.