22

How should one open .eml files in linux ? I'm not sure if mutt can handle it ?

UPDATE

I worked it out partially , by creating a new mailbox:

mkdir -p a/{cur,tmp,new}

And place the eml file in a/cur , I could read it with:

mutt -f

But that's not exactly what I want yet

daisy
  • 53,527
  • 78
  • 236
  • 383
  • If your editor is set to `vim` in mutt, don't they get opened as plain text? You could also set an entry in `mailcap` to open them with your text editor if they are attachments. – jasonwryan May 15 '12 at 02:49
  • 2
    @warl0ck Are you tested what mentioned in answers before editing the question? – Sam May 15 '12 at 13:20

2 Answers2

30

mutt doesn't seem able to open individual messages. What you can do is convert the .eml file into an mbox folder containing a single message. This basically involves adding a From line at the top, which can be done using formail -b:

formail -b < themessage.eml > themessage.mbox

This can then be opened within mutt using change-folder (default key c).

mgorven
  • 2,252
  • 19
  • 19
  • 7
    Nice answer. I would also add that the message could be opened directly on the command line: `mutt -f themessage.mbox` Also, the formail command is part of the procmail package, if you don't have it already installed on your system (debian-based systems, at least). – Jeff Bauer Jan 30 '13 at 10:56
6

I had the same problem. Thanks for the "formail -b" suggestion.

The following mailcap entry seems to eliminate the necessity of manual saving, running "formail -b", and changing to the mailbox. These three steps are reduced to pushing <enter> on the message/rfc822 attachment in the attach view:

message/rfc822; formail -b < %s > %s.mbox && mutt -f '%s.mbox'; needsterminal

Additional advantage is that the .mbox file is created in /tmp directory and does not require clean-up afterwards.

Arkady
  • 61
  • 1
  • 1