[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#27203: closed (25.2; rmail doesn't handle mime if

From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#27203: closed (25.2; rmail doesn't handle mime if rmail-mime-attachment-dirs-alist gives no valid destination)
Date: Sat, 03 Jun 2017 00:44:02 +0000

Your message dated Fri, 02 Jun 2017 20:43:37 -0400
with message-id <address@hidden>
and subject line Re: bug#27203: 25.2; rmail doesn't handle mime if 
rmail-mime-attachment-dirs-alist gives no valid destination
has caused the debbugs.gnu.org bug report #27203,
regarding 25.2; rmail doesn't handle mime if rmail-mime-attachment-dirs-alist 
gives no valid destination
to be marked as done.

(If you believe you have received this mail in error, please contact

27203: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=27203
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: 25.2; rmail doesn't handle mime if rmail-mime-attachment-dirs-alist gives no valid destination Date: Fri, 02 Jun 2017 17:09:15 -0400
The variable rmail-mime-attachment-dirs-alist gives a list of directories
based on content-type to use as the default detachment location.  If
this variable has no matching entry for the content type of something in
a message, or no directories associated with that type exist, rmail will
not decode the MIME at all.  It prints the message "MIME decoding
failed: (wrong-type-argument stringp nil)", but this is often
immediately overwritten by message of the form "Showing message 1...",
so that you don't even know that something has failed.

To reproduce:

emacs -Q
M-x rmail
set the variable rmail-mime-attachment-dirs-alist to nil or
  something like '((".*" "~/nosuchdirectory"))
Go to a new MIME message
See undecoded MIME
Look in *Messages* buffer for error message.

This happens because directory is set to nil in rmail-mime-insert-bulk.
It passes the nil to file-name-as-directory, causing the error.  The
simplest fix would be to set directory to something like "nodirectory"
when rmail-mime-insert-bulk fails to find an existing directory to use.

In GNU Emacs 25.2.2 (x86_64-unknown-linux-gnu, X toolkit, Xaw scroll bars)
 of 2017-05-29 built on neptune
Windowing system distributor 'The X.Org Foundation', version 11.0.11501000
System Description:     Ubuntu 16.04.2 LTS

Configured features:

Important settings:
  value of $LC_ALL: C
  value of $LANG: en_US.UTF-8
  locale-coding-system: nil

Major mode: Messages

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-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
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
No previous nondeleted message
Showing message 2...
MIME decoding failed: (wrong-type-argument stringp nil)
Showing message 2...done

Load-path shadows:
None found.

(shadow sort mail-extr dabbrev emacsbug sendmail cl-extra rmailkwd
cus-edit cus-start cus-load wid-edit thingatpt rmailmm message dired
format-spec rfc822 mml mml-sec password-cache epg epg-config gnus-util
mm-decode mm-bodies mm-encode mailabbrev gmm-utils mailheader mail-parse
rfc2231 rmail rfc2047 rfc2045 ietf-drums mm-util help-fns help-mode
easymenu cl-loaddefs pcase cl-lib mail-prsvr mail-utils time-date
mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel x-win term/common-win x-dnd tool-bar dnd fontset
image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax facemenu font-core frame cl-generic cham
georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese charscript case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice
loaddefs button faces cus-face macroexp files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote inotify dynamic-setting
font-render-setting x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 110595 13424)
 (symbols 48 21548 0)
 (miscs 40 132 166)
 (strings 32 20017 2892)
 (string-bytes 1 546266)
 (vectors 16 13328)
 (vector-slots 8 444689 5903)
 (floats 8 175 176)
 (intervals 56 479 145)
 (buffers 976 22)
 (heap 1024 16339 714))

--- End Message ---
--- Begin Message --- Subject: Re: bug#27203: 25.2; rmail doesn't handle mime if rmail-mime-attachment-dirs-alist gives no valid destination Date: Fri, 02 Jun 2017 20:43:37 -0400 User-agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)
Version: 26.1

Thanks, I applied the following:

commit 73635ed
Date:   Fri Jun 2 20:42:01 2017 -0400

    Small rmailmm fix (bug#27203)
    * lisp/mail/rmailmm.el (rmail-mime-insert-bulk):
    Fall back to HOME if no match in rmail-mime-attachment-dirs-alist.

diff --git a/lisp/mail/rmailmm.el b/lisp/mail/rmailmm.el
index c6b9cfd..1ffd466 100644
--- a/lisp/mail/rmailmm.el
+++ b/lisp/mail/rmailmm.el
@@ -817,12 +817,13 @@ directly."
         (bulk-data (aref tagline 1))
         (body (rmail-mime-entity-body entity))
         ;; Find the default directory for this media type.
-        (directory (catch 'directory
-                     (dolist (entry rmail-mime-attachment-dirs-alist)
-                       (when (string-match (car entry) (car content-type))
-                         (dolist (dir (cdr entry))
-                           (when (file-directory-p dir)
-                             (throw 'directory dir)))))))
+        (directory (or (catch 'directory
+                         (dolist (entry rmail-mime-attachment-dirs-alist)
+                           (when (string-match (car entry) (car content-type))
+                             (dolist (dir (cdr entry))
+                               (when (file-directory-p dir)
+                                 (throw 'directory dir))))))
+                       "~"))
         (filename (or (cdr (assq 'name (cdr content-type)))
                       (cdr (assq 'filename (cdr content-disposition)))

--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]