March 19, 2024

View PDF attachments as text in Mutt

To do so, install pdftotext:

$ sudo apt install poppler-utils

Look for a mailcap file. If none exists:

$ touch .config/mutt/mailcap

Then add the following line:

application/pdf; pdftotext -layout -q %s -; copiousoutput;

Next you need to add these lines to your .muttrc:

auto_view application/pdf 
set mailcap_path = ~/.config/mutt/mailcap 

You now can type m to view a PDF file as text.

You can read more about mailcap and auto_view in the manual of Mutt.


personal computing command-line interface (cli) gnu linux trisquel shell literacy office applications wiki mutt pdf

No affiliate links, no analytics, no tracking, no cookies. This work © 2016-2024 by yctct is licensed under CC BY-ND 4.0 .   about me   contact me   all entries & tags   FAQ   GPG public key

GPG fingerprint: 2E0F FB60 7FEF 11D0 FB45 4DDC E979 E52A 7036 7A88