VM

get-new-mail in virtual folders

Bug #607907 reported by Uday Reddy
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
VM
Fix Released
Medium
Uday Reddy

Bug Description

Doing a get-new-mail in a virtual folder is switching the display to the underlying physical folder.

This didn't happen in 8.1.91a (which was withdrawn), but it is happening in 8.1.925a as well as the current trunk. By the point the control reaches the following backtrace, the display has been switched. The save-excursion in vm-virtual-get-new-mail doesn't help.

Debugger entered--returning value: "3588 messages, 17 new, 158 unread, 2 deleted"
  vm-get-new-mail()
  byte-code(...)
* vm-virtual-get-new-mail()
  (cond ((eq major-mode ...) (vm-virtual-get-new-mail)) ((not ...) (error "Can't get mail for a non-VM folder buffer")) ((null arg) (if ... ...) (if ... ... ...) (let ... ...)) (t (let ... ... ... ... ... ...)))
* vm-get-new-mail(nil)
  call-interactively(vm-get-new-mail nil nil)

Bug 614413 lists related issues.

Related branches

Uday Reddy (reddyuday)
Changed in vm:
status: New → Confirmed
status: Confirmed → Triaged
importance: Undecided → Medium
assignee: nobody → Uday Reddy (reddyuday)
milestone: none → 8.1.93a
tags: added: virtual
Uday Reddy (reddyuday)
Changed in vm:
milestone: 8.1.93a → 8.1.94a
Revision history for this message
Uday Reddy (reddyuday) wrote :

Revision 760 of the 8.1.x branch extends vm-build-virtual-message-list to work with POP/IMAP folders. But this fix only works for creating new virtual folders. It is not working for incorporating new messages into them.

Revision history for this message
Uday Reddy (reddyuday) wrote :

More funny errors arose today, when doing a get-new-mail in a virtual folder:

Checking for new mail for d:/Home/udr/mail/imap-cache-edb15217b986b74f2751726a69a193f6...
Logging into the IMAP server...
Updating attributes on the IMAP server... done
Retrieving message attributes and labels...
Retrieving message atrributes and labels... done
Retrieving new messages...
Updating summary...
Generating summary... 0
Sorting messages... done
Generating summary... 800
4483 messages, 2 new, 351 unread, 0 deleted
IMAP error: server said BAD
4483 messages, 2 new, 351 unread, 0 deleted
Generating summary... 0
vm-sort-messages: Unknown key: activiity
Commands: d, s, x, u; f, o, 1, 2, m, v; ~, %; q to quit; ? for help.
Mark set

Revision history for this message
Uday Reddy (reddyuday) wrote :

The BAD command is:

VM UID FETCH nil:nil (RFC822.SIZE)
VM BAD Error in IMAP command UID: Invalid UID messageset

This is arising as follows:

1. get-new-mail in the virtual folder invokes get-new-mail in the underlying IMAP folder.

2. This calls vm-imap-synchronize-folder, which gets new messages and calls vm-assimilate-new-messages.

3. Part of the assimilation is to call vm-build-virtual-message-list for all the virtual folders that mirror the IMAP folder.

4. At this point, the virtual-folder-definition points to the cache-folder rather than the IMAP folder's buffer. (This is obviously a bug.) So, vm-build-virtual-message-list calls vm-visit-folder on the folder.

5. vm-visit-folder does vm-preview-current-message which calls vm-fetch-imap-message, which in turn tries to retrieve the message body. At this point, the imap-uid field of the message is nil. (This seems to be another bug.)

Uday Reddy (reddyuday)
Changed in vm:
status: Triaged → In Progress
Revision history for this message
Uday Reddy (reddyuday) wrote :

The bug in point 4 was apparently a feature.

vm-build-virtual-message-list is doing an in-place update of vm-virtual-folder-definition, overwriting the buffer reference by file-name. This is a hold-over from VM 7.19, but it is not clear why it is being done.

Bug fix in rev. 966 eliminates this overwriting.

Revision history for this message
Uday Reddy (reddyuday) wrote :

Bug 614413 also lists related issues.

description: updated
Revision history for this message
Uday Reddy (reddyuday) wrote :

The bug fix causes a further problem in vm-link-to-virtual-buffers:

Debugger entered--Lisp error: (wrong-type-argument stringp (get-buffer "INBOX"))
  expand-file-name((get-buffer "INBOX") "Y:/tmpmail/")
  (vm-get-file-buffer (expand-file-name (car folders) vm-folder-directory))
  (eq folder-buffer (vm-get-file-buffer (expand-file-name ... vm-folder-directory)))
  (if (eq folder-buffer (vm-get-file-buffer ...)) (setq vbuffers (cons ... vbuffers) vm-real-buffers (cons folder-buffer vm-real-buffers) folders nil clauses nil))
  (while folders (if (eq folder-buffer ...) (setq vbuffers ... vm-real-buffers ... folders nil clauses nil)) (setq folders (cdr folders)))
  (while clauses (setq folders (car ...)) (while folders (if ... ...) (setq folders ...)) (setq clauses (cdr clauses)))
  (cond ((eq major-mode ...) (setq clauses ...) (while clauses ... ... ...)))
  (while b-list (set-buffer (car b-list)) (cond (... ... ...)) (setq b-list (cdr b-list)))
  (save-excursion (while b-list (set-buffer ...) (cond ...) (setq b-list ...)) vbuffers)
  (let ((b-list ...) (vbuffers nil) (folder-buffer ...) folders clauses) (save-excursion (while b-list ... ... ...) vbuffers))
  vm-link-to-virtual-buffers()
  (setq major-mode (quote vm-mode) mode-line-format vm-mode-line-format mode-name "VM" mode-popup-menu (and vm-use-menus (vm-menu-support-possible-p) (vm-menu-mode-menu)) buffer-read-only t buffer-offer-save t require-final-newline nil selective-display nil vm-thread-obarray (quote bonk) vm-thread-subject-obarray (quote bonk) vm-label-obarray (make-vector 29 0) vm-last-message-pointer nil vm-modification-counter 0 vm-message-list nil vm-message-pointer nil vm-message-order-changed nil vm-message-order-header-present nil vm-imap-retrieved-messages nil vm-pop-retrieved-messages nil vm-summary-buffer nil vm-system-state nil vm-undo-record-list nil vm-undo-record-pointer nil vm-virtual-buffers (vm-link-to-virtual-buffers) vm-folder-type ...)
  vm-mode-internal(nil nil)

Revision history for this message
Uday Reddy (reddyuday) wrote :

This problem is now fixed in rev. 967.

The variable vm-messages-needing-summary-update has some defunct messages as a result of this. Needs further work.

Uday Reddy (reddyuday)
Changed in vm:
status: In Progress → Fix Committed
Uday Reddy (reddyuday)
tags: added: 7.19 8.1 8.2
Revision history for this message
Uday Reddy (reddyuday) wrote :

The bug is still present in revision 1193.

Changed in vm:
status: Fix Committed → In Progress
Revision history for this message
Uday Reddy (reddyuday) wrote :

See Bug 614413 for further progress on this issue.

Changed in vm:
status: In Progress → Fix Committed
Uday Reddy (reddyuday)
Changed in vm:
status: Fix Committed → Fix Released
Uday Reddy (reddyuday)
no longer affects: vm/8.1.x
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.