Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mutt: Saving a message as a text file

Tags:

mutt

I would like to save a message in Mutt as a text file somewhere outside of my maildir. For example, ~/documents/notes. I have found instructions for Saving Messages to Files which says that I should press either C or esc-C (depending on if I want headers or not) and then enter the directory I want to save to. When I do this and enter ~/documents/notes, Mutt says: "/home/user/documents/notes is not a mailbox".

I want to save the message to a plain directory, not a mailbox. How can I do this?

like image 701
oakservice Avatar asked Dec 19 '14 21:12

oakservice


People also ask

Where does the muttrc script save the file?

This script saves the file to the first argument (i.e. in the muttrc example above, the email will save to /tmp ). The format of the file name is YYMMDD SUBJECT.eml.

How to configure Mutt to read emails of the user?

User Configuration file of Mutt : If you want to set some specific configuration for a particular user for Mutt, you can configure those settings in ~/.muttrc or ~/.mutt/muttrc files. To read emails of the user with you are currently logged in, you just need to run “ mutt ” on the terminal, it will load the current user’s mailbox.

How do I pipe a mutt message to a specific path?

The mutt command pipe-message (default shortcut |) can be used for this. It opens a command line and you write cat > DESIRED-FILE-PATH. The "pipe-decode" option controls what happens to headers and mime parts when you save a message this way.

How do I save a text message as a file?

Download the text message attachment and click "Save" when the download pop-up appears. Create a name for the file and save it as a text file, like a.doc or.txt. If the message was sent as text only in the e-mail, copy and paste the text into a text editor like Notepad or Word. Click "File," and then "Save as."


1 Answers

Use C (copy-message) or <Esc>C (decode-copy) if you want to save the mail as a mail message, necessarily in a mailbox. This mailbox can contain only one message if you want, but it won't be a text/plain file. If the mailbox (file or directory) doesn't exist yet, you shouldn't get an error: Mutt will propose you to create the mailbox.

If you just want to save the text of the body, then:

  1. Type v (view-attachments).
  2. Select the text/plain body (this is often the part that is selected by default, so that you won't have to do anything special here in most cases).
  3. Type s (save-entry) to save the body to a file.
like image 85
vinc17 Avatar answered Nov 06 '22 23:11

vinc17