vm-mime-retrieve-external-body may corrupt files when it retrieves
them from the external file. This seems to be rarely triggered, but it
bit me when I got some PDF files with Mac line-endings, which VM read
and converted to Unix line endings, thereby breaking all the offsets
in the PDF.
Here is the patch, which I think should apply to trunk as well:
*** vm-mime.el 2011/03/01 22:03:50 1.6
--- vm-mime.el 2011/04/15 20:28:29 1.7
***************
*** 2749,2755 ****
(if (not (file-exists-p name))
(vm-mime-error "file %s does not exist" name))
(condition-case data
! (insert-file-contents name)
(error (signal 'vm-mime-error (cdr data))))))
((and (string= access-method "url")
vm-url-retrieval-methods)
--- 2749,2755 ----
(if (not (file-exists-p name))
(vm-mime-error "file %s does not exist" name))
(condition-case data
! (insert-file-contents-literally name)
(error (signal 'vm-mime-error (cdr data))))))
((and (string= access-method "url")
vm-url-retrieval-methods)
***************
*** 2811,2817 ****
(setq name (concat "/" user "@" site ":"
name))))
(condition-case data
! (insert-file-contents name)
(error (signal 'vm-mime-error
(format "%s" (cdr data)))))))))))
--- 2811,2817 ----
(setq name (concat "/" user "@" site ":"
name))))
(condition-case data
! (insert-file-contents-literally name)
(error (signal 'vm-mime-error
(format "%s" (cdr data)))))))))))