Subject: 24.0.50; Gnus keeps seeing 101 unread spam

From: Stefan Monnier <[email-masked]>
Date: Thu, 04 Aug 2011 16:39:17 -0400

Package: emacs,gnus

[ I have a couple long standing issues that were introduced with the new
nnimap.el code, and it's really high time I bring them up as
bug reports.
Here's the first one, it's one that really doesn't bother me much
(since oddly enough it only affects my `spam' folder) but seems
potentially serious and has the key property of being easy to reproduce,
contrary to some of the other problems I often bump into and which I'll
hence report later. ]

Here's what I did:
- emacs-trunk/src/emacs -f gnus
- type my IMAP password.
- see "101: nnimap+diro:spam" among the folders with unread email.
- Erase *imap log*
- type `g' to refresh the *Group* buffer.
  [ it still says "101". ]
- hit `c y' on that folder.
  [ it now says "0" unread email in the spam folder. ]
- hit `g' for the fun of it.
  [ Lo and behold I have 101 unread email in my spam folder again. ]

And yes, it's always one hundred and one (actually I think
I occasionally see 40k unread email in that folder, maybe if I first
enter it rather than just doing `c y', but that's rare anyway).
You can find below my sig the list of commands sent to the server, with
2 empty lines to separate the `g', the `c y', and the `g'.

        Stefan

16:27:41 28 SELECT ""
16:27:41 29 UID FETCH 1:* FLAGS
16:27:41 30 EXAMINE "spam"
16:27:41 31 UID FETCH 46421:* FLAGS
16:27:41 32 EXAMINE "yale"
16:27:41 33 UID FETCH 1140:* FLAGS
16:27:41 34 EXAMINE "types"
16:27:41 35 UID FETCH 3626:* FLAGS
16:27:41 36 EXAMINE "subscriptions"
16:27:41 37 UID FETCH 1:* FLAGS
16:27:41 38 EXAMINE "qcpls"
16:27:41 39 UID FETCH 3266:* FLAGS
16:27:41 40 EXAMINE "friends"
16:27:41 41 UID FETCH 1865:* FLAGS
16:27:41 42 EXAMINE "emacs"
16:27:41 43 UID FETCH 176373:* FLAGS
16:27:41 44 EXAMINE "stages"
16:27:41 45 UID FETCH 1658:* FLAGS
16:27:41 46 EXAMINE "nanda"
16:27:41 47 UID FETCH 1179:* FLAGS
16:27:41 48 EXAMINE "diro"
16:27:41 49 UID FETCH 24052:* FLAGS
16:27:41 50 EXAMINE "cours"
16:27:41 51 UID FETCH 4003:* FLAGS
16:27:41 52 EXAMINE "INBOX"
16:27:41 53 UID FETCH 63343:* FLAGS

16:27:55 54 SELECT "spam"
16:27:55 55 UID STORE 46421:46521 +FLAGS.SILENT (\Seen)

16:27:59 56 SELECT ""
16:27:59 57 UID FETCH 1:* FLAGS
16:27:59 58 EXAMINE "spam"
16:27:59 59 UID FETCH 46421:* FLAGS
16:27:59 60 EXAMINE "yale"
16:27:59 61 UID FETCH 1140:* FLAGS
16:27:59 62 EXAMINE "types"
16:27:59 63 UID FETCH 3626:* FLAGS
16:27:59 64 EXAMINE "subscriptions"
16:27:59 65 UID FETCH 1:* FLAGS
16:27:59 66 EXAMINE "qcpls"
16:27:59 67 UID FETCH 3266:* FLAGS
16:27:59 68 EXAMINE "friends"
16:27:59 69 UID FETCH 1865:* FLAGS
16:27:59 70 EXAMINE "emacs"
16:27:59 71 UID FETCH 176373:* FLAGS
16:27:59 72 EXAMINE "stages"
16:27:59 73 UID FETCH 1658:* FLAGS
16:27:59 74 EXAMINE "nanda"
16:27:59 75 UID FETCH 1179:* FLAGS
16:27:59 76 EXAMINE "diro"
16:27:59 77 UID FETCH 24052:* FLAGS
16:27:59 78 EXAMINE "cours"
16:27:59 79 UID FETCH 4003:* FLAGS
16:27:59 80 EXAMINE "INBOX"
16:27:59 81 UID FETCH 63343:* FLAGS

In GNU Emacs 24.0.50.1 (i686-pc-linux-gnu, GTK+ Version 2.24.4)
 of 2011-08-03 on ceviche
Windowing system distributor `The X.Org Foundation', version 11.0.11002000
configured using `configure  'CFLAGS=-Wall -Wno-pointer-sign -DUSE_LISP_UNION_TYPE -DSYNC_INPUT -DENABLE_CHECKING -DXASSERTS -DFONTSET_DEBUG -g -O0 -I/usr/include/GNUstep''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: fr_CH.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Group

Minor modes in effect:
  gnus-undo-mode: t
  electric-pair-mode: t
  electric-indent-mode: t
  url-handler-mode: t
  global-reveal-mode: t
  reveal-mode: t
  auto-insert-mode: t
  savehist-mode: t
  minibuffer-electric-default-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
<return> n <select-window> <select-window> C-x 5 b 
* i m <tab> <return> C-x h C-w <switch-frame> g <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <switch-frame> 
<down-mouse-1> <mouse-movement> <mouse-1> C-q C-j <switch-frame> 
c y <switch-frame> <down-mouse-1> <mouse-movement> 
<mouse-1> C-q C-j <switch-frame> g s <switch-frame> 
C-x h M-w <switch-frame> M-x r e p o - e m - b u <tab> 
<return>

Recent messages:
Reading active file via nndraft...done
Checking new news...done
Saving /home/monnier/var/newsrc.eld...
Saving file /home/monnier/var/newsrc.eld...
Wrote /home/monnier/var/newsrc.eld
Saving /home/monnier/var/newsrc.eld...done
Mark set [2 times]
Saved text until ""
16:27:59 81 UID FETCH 63343:* FLAGS
"

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug executable copyright nndraft nnmh utf-7
rfc2104 gnutls network-stream starttls nnimap parse-time tls utf7 netrc
nnagent nnml gnus-agent gnus-srvr gnus-score score-mode nnvirtual
gnus-msg gnus-art mm-uu mml2015 epg-config mm-view mml-smime smime dig
mailcap nntp gnus-cache nnir gnus-sum nnoo gnus-group gnus-undo nnmail
mail-source server gnus-start gnus-spec gnus-int gnus-range message
format-spec rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse
rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev gmm-utils mailheader
gnus-win gnus gnus-ems nnheader mail-utils wid-edit noutline outline
easy-mmode flyspell ispell eldoc checkdoc regexp-opt thingatpt help-mode
view load-dir electric url-handlers url-parse auth-source eieio byte-opt
bytecomp byte-compile cconv macroexp assoc gnus-util password-cache
url-vars mm-util mail-prsvr reveal autoinsert uniquify advice help-fns
advice-preload savehist minibuf-eldef disp-table cl all-autoloads
company-autoloads debbugs-autoloads epoch-view-autoloads
js2-mode-autoloads load-dir-autoloads markchars-autoloads
minimap-autoloads muse-autoloads info easymenu rainbow-mode-autoloads
register-list-autoloads sisu-mode-autoloads uni-confusables-autoloads
windresize-autoloads package tabulated-list proof-site proof-autoloads
pg-vars bbdb-autoloads agda2 time-date tooltip ediff-hook vc-hooks
lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image fringe
lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax facemenu font-core frame cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev
minibuffer loaddefs button faces cus-face files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process dbusbind
dynamic-setting system-font-setting font-render-setting move-toolbar gtk
x-toolkit x multi-tty emacs)