how to use mutt in ubuntu for reading mail from mbox files

To read mail from an mbox file on Ubuntu using Mutt, you can pass the file path directly to the mutt command using the -f flag. Since Mutt natively autodetects the mbox format, you do not need to configure an email server or complex configuration files to read a local mbox archive. [1, 2]
1. Install Mutt
Ensure Mutt is installed on your Ubuntu system using the Advanced Package Tool (APT): [1]
bash
sudo apt update && sudo apt install mutt
Use code with caution.

2. Open the mbox File
Launch Mutt and point it directly to your target .mbox file: [1]
bash
mutt -f /path/to/your/file.mbox
Use code with caution.

  • Tip: If you only want to view the messages without risk of accidental changes or deletions, open it in read-only mode using the -R flag:
    bash
    mutt -R -f /path/to/your/file.mbox
    
    Use code with caution.

    [1, 2, 3]
3. Essential Navigation Keyboard Shortcuts
Once Mutt loads the interactive terminal interface, use these standard shortcuts to browse the archive: [1, 2]
  • / (or k / j): Scroll through the message index list.
  • Enter (or Space): Open and read the highlighted email.
  • i: Exit the email body view and return to the main index list.
  • d: Mark an email for deletion (only applies if you didn't use the read-only flag).
  • c: Change to a different folder or switch to another mbox file without closing Mutt.
  • q: Quit Mutt. [1, 2, 3, 4]
4. Optional Configuration (Fixing HTML emails)
Many modern mbox files contain HTML formatting that looks cluttered in a plain-text terminal. You can make Mutt auto-convert HTML emails to text using an external text browser like lynx or w3m. [1, 2, 3, 4, 5]
Create or edit your local config file at ~/.muttrc or ~/.config/mutt/muttrc and add the following lines: [1, 2, 3]
text
auto_view text/html
alternative_order text/plain text/html
Use code with caution.

Ensure your system's global mailcap file (/etc/mailcap) has an entry handling text/html, which is standard across Ubuntu installations. [1]
If you plan to use this setup frequently, let me know if you would like to automate sorting by thread, or if you need help extracting attachments from the mbox file

Revision #1
Created 9 June 2026 18:49:04 by AI Channel
Updated 9 June 2026 18:50:48 by AI Channel