Search code examples
muttneomutt

mutt (neomutt) can't access/show plain text attachment (body of message)


When trying to open/read an inline text/plain attachment (the body of a plain-text message) of a received message from the Attachments view in (Neo)mutt, I'm getting:

sh: /tmp/neomutt-x1-1000-1595035-6095510368090236182: Permission denied
Press any key to continue...

When I try to view the file from the terminal, it works fine:

$ cat /tmp/neomutt-x1-1000-1595035-6095510368090236182
Hi ...
[msg body]

This problem doesn't occur when I try to view/open an inline text/plain attachment from the Compose view. Then it is normally displayed in the built-in Pager.

There's also no problem with viewing text/html or any other attachments.


Solution

  • I was experiencing the exact issue, and in my case, my mailcap file had:

    text/plain; $EDITOR %s ;
    

    and my EDITOR variable wasn't set, so in effect Neomutt was attempting to run the text file as an executable.

    Setting the EDITOR variable should fix the problem, or what I did is just change that line to:

    text/plain; less %s ;
    

    which worked perfectly. I use vim for composing mails, but wanted to use less for viewing plain text attachments, so that when viewing a plain text attachment to one of my own drafts I don't inadvertently start editing the text of a temporary file used only for viewing. :-)