This short note explains how to configure the GNU-Midnight-Commander to view .eml and .mbox email-files saved by Thunderbird or Evolution.

Installation

  1. Install helper applications

     sudo apt install mutt lynx
    
  2. Configure GNU-Midnight-Commander

    a. Keep a backup.

     sudo cp /etc/mc/mc.ext /etc/mc/mc.ext.orig
    

    b. Open the file /etc/mc/mc.ext with your favorite editor.

     sudo vi /etc/mc/mc.ext
    

    c. Search for:

    default/*
         Open=
         View=
    

    d. Replace the above with:

    shell/i/.eml
         Open=echo "From - Thu Sep 5 08:43:40 2013" > ~/tmp.mbox && cat %f >> ~/tmp.mbox && mutt -e "alternative_order text/plain text/html" -e "auto_view text/html" -e "set folder=~" -f ~/tmp.mbox && rm ~/tmp.mbox 
         View=echo "From - Thu Sep 5 08:43:40 2013" > ~/tmp.mbox && cat %f >> ~/tmp.mbox && mutt -e "alternative_order text/plain text/html" -e "auto_view text/html" -e "set folder=~" -f ~/tmp.mbox && rm ~/tmp.mbox 
    shell/i/.mbox
         Open=mutt -e "alternative_order text/plain text/html" -e "auto_view text/html" -e "set folder=~" -f %b.mbox
         View=mutt -e "alternative_order text/plain text/html" -e "auto_view text/html" -e "set folder=~" -f %b.mbox
    
    default/*
         Open=
         View=
    

Test and usage

  1. Save an .eml file on disk.

  2. Open the GNU-midnight-commander.

     mc
    
  3. Browse to the location of the file and select it.

  4. Open the viewer with [F3],[Enter] or [Enter],[Enter].

    The later starts mutt to view the content of your email file. HTML will be shown as ASCII with your default text browser.

References