5

Sometimes I would like to export an email, in readable plain-text format, with headers stripped and the text readable, just like it's shown to me when I read it in mutt. It must surely be possible?

Of course there is the s-key for saving the email as it is, but unfortunately in 2017 very few emails are easily readable without any processing, there are often several pages with irrelevant headers, and there are different forms of content-transfer-encoding making the content itself unreadable, extra noise due to the multipart/alternative encoding, etc.

4

I, often, use Escape-S to decode-save the message to a file. After that, I can edit the file to remove headers, signatures or anything else.

  • 1
    Actually, I think that's Esc + s (lower case) with mutt's default key bindings. (Remember that mutt's key bindings are case sensitive!) You can also use decode-copy (Esc + C) to copy rather than save (which in mutt implies "move") the message. – a CVn Feb 26 '17 at 15:31
  • The above comment is correct, esc+s, not esc+S - and also, the email will be deleted if doing esc+s, so esc+C seems better. Except for that - perfect, just what I was looking for. It does include a bit more header lines than the plain view, but not far too many anyway. – tobixen Feb 28 '17 at 18:05
-1

Create a new maildir

mkdir -p ~/mymails/{cur,new,tmp}

Start mutt with your mailbox

mutt -f /var/mail/root

Press : for command mode and set the mailbox format to maildir with this command

set mbox_type=Maildir

Select you mails and save all selected with the ;s or ;e key sequence and use ~/mymails/as target. Now all mails are saved as single files in mymails/cur.

  • 1
    The second paragraph of the question specifically rules out using plain s (or e which is basically the same thing). Saving into a maildir doesn't change any of that. – a CVn Feb 26 '17 at 15:29
  • This seems to be the correct answer for another question :p – tobixen Feb 28 '17 at 18:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.