Subject: bug#9173: 24.0.50; Gnus IMAP fails to open folders whose names contain ampersands (&)

From: Steve Purcell <[email-masked]>
Date: Tue, 26 Jul 2011 14:28:44 +0100

I have IMAP folders with names like 'Family.Mum & Dad'. These work fine
in Apple Mail and other IMAP clients such as Squirrelmail.

However, in GNUS they are displayed as

   Family.Mum &- Dad

and when trying to open them, the following error results:

   Retrieving newsgroup: Family.Mum &- Dad...
   gnus-select-newsgroup: Couldn't request group Family.Mum &- Dad: NO Mailbox doesn't exist: Family.Mum &-- Dad

Note also the double hyphen in the second message, which may perhaps
provide a clue.

The server is Dovecot, in case that matters.

In GNU Emacs 24.0.50.1 (x86_64-apple-darwin, NS apple-appkit-1038.35)
 of 2011-07-23 on virtualmac.porkrind.org
Windowing system distributor `Apple', version 10.3.1138
configured using `configure  '--host=x86_64-apple-darwin' '--build=i686-apple-darwin' '--with-ns' 'build_alias=i686-apple-darwin' 'host_alias=x86_64-apple-darwin' 'CC=gcc -mmacosx-version-min=10.5''

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: nil
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8
  default enable-multibyte-characters: t

Major mode: Group

Minor modes in effect:
  shell-dirtrack-mode: t
  gnus-topic-mode: t
  show-paren-mode: t
  diff-auto-refine-mode: t
  gnus-undo-mode: t
  global-fuzzy-format-mode: t
  cua-mode: t
  global-pointback-mode: t
  pointback-mode: t
  desktop-save-mode: t
  global-auto-complete-mode: t
  ido-everywhere: t
  recentf-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  unify-8859-on-decoding-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Features:
(shadow emacsbug mule-util tabify shell hippie-exp tramp tramp-compat
tramp-loaddefs multi-isearch debug smiley descr-text gnus-cite sort qp
gnus-html browse-url mm-url mail-extr gnus-async gnus-bcklg gnus-ml
gnus-topic nndraft nnmh utf-7 nnfolder executable rot13 disp-table
network-stream starttls nnimap parse-time utf7 netrc gnus-agent
gnus-srvr gnus-score score-mode nnvirtual gnus-msg nntp gnus-cache
rinari jump inflections findr ruby-compilation ansi-color haml-mode
markdown-mode textile-mode vc-svn rainbow-mode css-mode flymake-js js
moz newcomment cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles
cc-align cc-engine cc-vars cc-defs clojure-test-mode which-func imenu
durendal ac-slime hippie-expand-slime slime-repl slime-fuzzy slime
apropos hideshow pp clojure-mode vc-dispatcher org-wl org-w3m org-vm
org-rmail org-mhe org-mew org-irc org-jsinfo org-infojs org-html
org-info org-gnus org-docview org-bibtex bibtex org-bbdb
org-google-weather solar cal-dst google-weather url-cache org-fstree
org-checklist org-clock org-exp ob-exp org-exp-blocks org-agenda
org-mac-iCal org ob-emacs-lisp ob-tangle ob-ref ob-lob ob-table
org-footnote org-src ob-comint ob-keys ob ob-eval org-pcomplete org-list
org-faces org-compat org-entities org-macs noutline outline cal-menu
calendar cal-loaddefs inf-ruby fringe-helper flymake-point flymake
compile ruby-mode vc-darcs goto-addr hl-sexp thingatpt paredit eldoc
project-local-variables warnings init-locales init-edit-server
edit-server init-themes color-theme-sanityinc-solarized color-theme
init-misc init-twitter twit url-http tls url-auth url-gw xml init-mail
init-common-lisp init-clojure elein init-slime init-lisp elisp-slime-nav
etags init-rails init-ruby-mode flymake-ruby init-ocaml init-haskell
init-python-mode flymake-python-pyflakes init-haml flymake-haml init-css
init-nxml whattf-dt html5-langs nxml-enc init-htmlize init-org init-php
init-sh init-javascript js-comint comint init-erlang erlang-start
init-csv init-markdown init-textile init-crontab init-gnuplot init-git
diff-git magithub crm json url url-proxy url-privacy url-expand
url-methods url-history url-cookie url-util url-parse auth-source eieio
byte-opt bytecomp byte-compile cconv url-vars rebase-mode rx magit-svn
magit server pcomplete ediff iswitchb diff-mode log-edit pcvs-util
magit-bisect magit-key-mode vc-git init-darcs darcsum gnus-art mm-uu
mml2015 epg-config mm-view mml-smime smime password-cache dig mailcap
nnir gnus-sum macroexp nnoo gnus-group gnus-undo nnmail mail-source
gnus-start gnus-spec gnus-int gnus-range message format-spec rfc822 mml
mml-sec mailabbrev gmm-utils mailheader gnus-win gnus gnus-ems nnheader
gnus-util mail-utils mm-decode mm-bodies mm-encode mail-parse rfc2231
rfc2047 rfc2045 ietf-drums mm-util mail-prsvr add-log init-svn
init-editing-utils fuzzy-format whole-line-or-region eol-conversion
cua-base pointback assoc autopair paren mic-paren diminish init-growl
todochiku growl init-mmm mmm-auto mmm-vars mmm-compat init-fonts
init-sessions session cus-start cus-load desktop init-windows winner
ring init-auto-complete auto-complete-config auto-complete easy-mmode
popup init-hippie-expand init-ido smex ido init-recentf recentf
tree-widget wid-edit init-regex-tool init-flymake init-ibuffer
ibuffer-vc ibuf-macs ibuf-ext ibuffer init-uniquify uniquify init-iedit
init-isearch init-viper init-dired help-mode view derived dired+ dired-x
ediff-merg ediff-diff ediff-wind ediff-mult ediff-help ediff-init
ediff-util dired-aux dired regexp-opt init-proxies init-gui-frames
init-maxframe maxframe init-osx-keys edmacro kmacro init-title-bar
init-xterm init-frame-hooks init-utils find-func init-elpa finder-inf
all-autoloads color-theme-autoloads erc-autoloads info easymenu
findr-autoloads fringe-helper-autoloads gnuplot-autoloads
haskell-mode-autoloads highlight-symbol-autoloads inflections-autoloads
json-autoloads lua-mode-autoloads project-local-variables-autoloads
advice help-fns advice-preload slime-fuzzy-autoloads
slime-repl-autoloads slime-autoloads package tabulated-list
init-site-lisp init-exec-path cl time-date tooltip ediff-hook vc-hooks
lisp-float-type mwheel ns-win 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 ns multi-tty
emacs)