Subject: 24.1.50; IMAP flags not synchronized from IMAP to Gnus

From: Luca Capello <[email-masked]>
Date: Sat, 16 Jun 2012 13:35:13 +0200

Hi there!

I just switched my `gnus-select-method' from nnnil to nnimap, with the
latter previously in `gnus-secondary-select-methods':

--8<---------------cut here---------------start------------->8---
 ;; servers
 (setq
- gnus-select-method '(nnnil)
+ gnus-select-method '(nnimap "home.pca.it"
+                             (nnimap-expunge nil))
--8<---------------cut here---------------end--------------->8---

Exiting Gnus & Emacs, restarting both and I had to wait for the
subscription to all my IMAP folders (more than 1000) and also for the
initial sync of all of them.  Then, I discovered that I have each folder
twice, one with "nnimap+home.pca.it:" and one without.  Even worse, the
flags in the "without" IMAP folders are not synchronized *from* IMAP to
Gnus, while they are on the other way around.

Here how my `*Group*' buffer looks like:

--8<---------------cut here---------------start------------->8---
[ Gnus -- 485901+917 ]
     419+1: INBOX
    9887+0: Junk
     351+0: Sent
[...]
  [ mail -- 966+61 ]
       109+0: nndraft:drafts
        17+0: nnimap+home.pca.it:Drafts
       396+22: nnimap+home.pca.it:INBOX
        16+0: nnimap+home.pca.it:Junk
       138+9: nnimap+home.pca.it:Sent
--8<---------------cut here---------------end--------------->8---

And the `*Server*' buffer:

--8<---------------cut here---------------start------------->8---
     {nnfolder:archive} (opened)
     {nndraft:} (opened)
     {nndoc:gnus-help} (opened)
     {nntp:news.gmane.org} (opened)
     {nnml:} (opened)
     {nnimap:home.pca.it} (opened)
--8<---------------cut here---------------end--------------->8---

Obviously, the above is wrong for two reasons: first, I do not want to
see each folder twice (so Gnus should automatically "merge" the with
"nnimap+home.pca.it:" and without) and, second, I do not want to set
*again* each flag for all the emails (as you can read, almost 500k).

I do not think I did something wrong, but feel free to point me in the
right direction.

Thx, bye,
Gismo / Luca

In GNU Emacs 24.1.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.4.2)
 of 2012-06-15 on zelenka, modified by Debian
 (emacs-snapshot package, version 2:20120615-1)
Configured using:
 `configure '--build' 'x86_64-linux-gnu' '--host' 'x86_64-linux-gnu'
 '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib'
 '--localstatedir=/var' '--infodir=/usr/share/info'
 '--mandir=/usr/share/man' '--with-pop=yes'
 '--enable-locallisppath=/etc/emacs-snapshot:/etc/emacs:/usr/local/share/emacs/24.1.50/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.1.50/site-lisp:/usr/share/emacs/site-lisp'
 '--without-compress-info' '--with-crt-dir=/usr/lib/x86_64-linux-gnu/'
 '--with-x=yes' '--with-x-toolkit=gtk3' '--with-imagemagick=yes'
 'build_alias=x86_64-linux-gnu' 'host_alias=x86_64-linux-gnu'
 'CFLAGS=-DDEBIAN -DSITELOAD_PURESIZE_EXTRA=5000 -g -O2' 'LDFLAGS=-g
 -Wl,--as-needed -znocombreloc' 'CPPFLAGS=-D_FORTIFY_SOURCE=2''

Important settings:
  value of $LC_MESSAGES: en_US.UTF-8
  value of $LC_MONETARY: fr_CH.UTF-8
  value of $LC_NUMERIC: en_US.UTF-8
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Group

Minor modes in effect:
  gnus-topic-mode: t
  gpm-mouse-mode: t
  display-time-mode: t
  show-paren-mode: t
  gnus-undo-mode: t
  mouse-wheel-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
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
C-c ESC f g ESC x d DEL e m a TAB b u TAB TAB TAB DEL 
DEL DEL DEL DEL DEL DEL DEL DEL DEL r e p o r TAB e 
m TAB b u TAB RET

Recent messages:
nnimap read 428k from home.pca.it (initial sync of 1 group; please wait)
nnimap read 488k from home.pca.it (initial sync of 1 group; please wait)
nnimap read 542k from home.pca.it (initial sync of 1 group; please wait)
nnimap read 600k from home.pca.it (initial sync of 1 group; please wait)
nnimap read 662k from home.pca.it (initial sync of 1 group; please wait)
nnimap read 720k from home.pca.it (initial sync of 1 group; please wait)
Reading active file via nnml...done
Reading active file via nndraft...done
Checking new news...done
Making completion list...

Load-path shadows:
/usr/share/emacs/24.1.50/site-lisp/auctex/context-en hides /usr/share/emacs/site-lisp/auctex/context-en
/usr/share/emacs/24.1.50/site-lisp/auctex/tex-style hides /usr/share/emacs/site-lisp/auctex/tex-style
/usr/share/emacs/24.1.50/site-lisp/auctex/texmathp hides /usr/share/emacs/site-lisp/auctex/texmathp
/usr/share/emacs/24.1.50/site-lisp/auctex/tex-jp hides /usr/share/emacs/site-lisp/auctex/tex-jp
/usr/share/emacs/24.1.50/site-lisp/auctex/font-latex hides /usr/share/emacs/site-lisp/auctex/font-latex
/usr/share/emacs/24.1.50/site-lisp/auctex/latex hides /usr/share/emacs/site-lisp/auctex/latex
/usr/share/emacs/24.1.50/site-lisp/auctex/tex-buf hides /usr/share/emacs/site-lisp/auctex/tex-buf
/usr/share/emacs/24.1.50/site-lisp/auctex/context-nl hides /usr/share/emacs/site-lisp/auctex/context-nl
/usr/share/emacs/24.1.50/site-lisp/auctex/toolbar-x hides /usr/share/emacs/site-lisp/auctex/toolbar-x
/usr/share/emacs/24.1.50/site-lisp/auctex/tex-fold hides /usr/share/emacs/site-lisp/auctex/tex-fold
/usr/share/emacs/24.1.50/site-lisp/auctex/tex-info hides /usr/share/emacs/site-lisp/auctex/tex-info
/usr/share/emacs/24.1.50/site-lisp/auctex/tex hides /usr/share/emacs/site-lisp/auctex/tex
/usr/share/emacs/24.1.50/site-lisp/auctex/tex-font hides /usr/share/emacs/site-lisp/auctex/tex-font
/usr/share/emacs/24.1.50/site-lisp/auctex/context hides /usr/share/emacs/site-lisp/auctex/context
/usr/share/emacs/24.1.50/site-lisp/auctex/multi-prompt hides /usr/share/emacs/site-lisp/auctex/multi-prompt
/usr/share/emacs/24.1.50/site-lisp/auctex/tex-fptex hides /usr/share/emacs/site-lisp/auctex/tex-fptex
/usr/share/emacs/24.1.50/site-lisp/auctex/bib-cite hides /usr/share/emacs/site-lisp/auctex/bib-cite
/usr/share/emacs/24.1.50/site-lisp/auctex/tex-bar hides /usr/share/emacs/site-lisp/auctex/tex-bar
/usr/share/emacs/24.1.50/site-lisp/auctex/tex-mik hides /usr/share/emacs/site-lisp/auctex/tex-mik
/usr/share/emacs/24.1.50/site-lisp/debian-startup hides /usr/share/emacs/site-lisp/debian-startup
~/.emacs.d/elisp/fortune hides /usr/share/emacs/24.1.50/lisp/play/fortune

Features:
(shadow sort gnus-cite bbdb-hooks epa-mail footnote flyspell ispell
mail-extr emacsbug help-mode gnus-topic nndraft nnmh nndoc nnml nnfolder
utf-7 gnutls network-stream starttls nnimap parse-time tls utf7 netrc
gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-cache ielm
comint ansi-color ring t-mouse server gismo-full-emacs ratpoison
ratpoisonrc-mode cl-macs generic generic-x gismo-emacs gismo-modes
battery time ido paren eldoc gismo-w3m w3m-search w3m-session
gismo-popup gismo-planner bbdb-anniv timeclock view mule-util cal-china
lunar solar cal-dst cal-bahai cal-islam cal-hebrew holidays hol-loaddefs
appt icalendar diary-lib diary-loaddefs cal-menu calendar cal-loaddefs
gismo-keybindings nroff-mode under dictionary link connection w3m
doc-view jka-compr image-mode w3m-hist w3m-fb bookmark-w3m w3m-ems
w3m-ccl ccl w3m-favicon w3m-image w3m-proc w3m-util dired gismo-gnus
gnus-demon nntp spam spam-stat bbdb-com warnings cl cl-lib gnus-uu yenc
gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime smime dig gnus-sum
gnus-group gnus-undo gnus-start gnus-spec gnus-win browse-url nnrss xml
mm-url url url-proxy url-privacy url-expand url-methods url-history
url-cookie url-domsuf url-util url-parse url-vars mailcap nnmail
gnus-int gnus-range mail-source message sendmail rfc822 mml mml-sec
mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils
mailheader nnoo gnus gnus-ems nnheader mail-utils wid-edit gnus-BTS
gismo-files gismo-eshell gismo-erc erc-stamp erc-log erc-dcc erc-goodies
erc erc-backend erc-compat format-spec auth-source eieio byte-opt
bytecomp byte-compile cconv macroexp gnus-util time-date password-cache
thingatpt pp gismo-easypg epa derived epg epg-config gismo-dired
gismo-debian debian-bug rfc2047 rfc2045 ietf-drums mm-util mail-prsvr
gismo-broken gismo-bbdb bbdb timezone gismo-auctex latex tex-style tex
advice help-fns advice-preload easymenu gismo-functions-insert
gismo-functions unicode-helper edmacro kmacro debian-el
debian-el-loaddefs w3m-load emacs-goodies-el emacs-goodies-custom
emacs-goodies-loaddefs easy-mmode dpkg-dev-el dpkg-dev-el-loaddefs
bbdb-autoloads preview-latex tex-site auto-loads tooltip ediff-hook
vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image
regexp-opt fringe tabulated-list newcomment 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)