Instruire Mutt sur la conduite à tenir face à certaines pièces jointes.
.mutt/muttrc
set mailcap_path = "~/.mutt/mailcap"
alternative_order text/html text/plain
set implicit_autoview
Concise example : .mutt/mailcap
# text/html; lynx -dump -force_html -width=96 -assume_charset=%{charset} %s; needsterminal; copiousoutput (1)
text/html; w3m -s -cols 96 -graph -I %{charset} -T text/html -o display_link_number=1; copiousoutput (2)
text/pdf; pdftotext -layout %s -; copiousoutput
text/csv; less %s; copiousoutput
image/*; catimg -t -r 2 -w %s; needsterminal
application/msword; antiword -w 96 %s; copiousoutput
application/vnd.openxmlformats-officedocument.wordprocessingml.document; docx2txt < %s -; copiousoutput
application/vnd.oasis.opendocument.text; odt2txt --width=96 %s; copiousoutput
application/x-tar; tar --list %s; copiousoutput
application/zip; unzip -l %s; copiousoutput
application/x-xz; xz -l %s; copiousoutput
1 | For a 96 letters wide terminal |
2 | Accentuated letters (and general presentation) are best handled by w3m as per 2018. |
Real file : .mutt/mailcap
# text/html; lynx -dump -force_html -width=96 -assume_charset=%{charset} %s; needsterminal; copiousoutput (1)
text/html; w3m -s -cols 96 -graph -I %{charset} -T text/html -o display_link_number=1; copiousoutput (2)
# application/octet-stream; gpg -d %s; copiousoutput
application/gpg; gpg -d %s; copiousoutput
text/pdf; pdftotext -layout %s -; copiousoutput
application/pdf; pdftotext -layout %s -; copiousoutput
application/x-pdf; pdftotext -layout %s -; copiousoutput
application/x-bzpdf; pdftotext -layout %s -; copiousoutput
application/x-gzpdf; pdftotext -layout %s -; copiousoutput
image/*; cacaview %s; needsterminal
#image/*; img2txt -d none -y 11 -x 7 -W 95 %s; copiousoutput # mauvais support dans mutt
application/msword; antiword -w 96 %s; copiousoutput
application/vnd.openxmlformats-officedocument.wordprocessingml.document; docx2txt < %s -; copiousoutput
application/vnd.oasis.opendocument.text; odt2txt --width=96 %s; copiousoutput
application/vnd.oasis.opendocument.text-master; odt2txt --width=96 %s; copiousoutput
application/vnd.oasis.opendocument.text-template; odt2txt --width=96 %s; copiousoutput
application/vnd.oasis.opendocument.text-web; odt2txt --width=96 %s; copiousoutput
application/vnd.oasis.opendocument.presentation; odt2txt --width=96 %s; copiousoutput
application/vnd.oasis.opendocument.presentation-template; odt2txt --width=96 %s; copiousoutput
#application/vnd.oasis.opendocument.spreadsheet
#application/vnd.oasis.opendocument.spreadsheet-template
application/vnd.sun.xml.writer; odt2txt --width=96 %s; copiousoutput
application/vnd.sun.xml.writer.template; odt2txt --width=96 %s; copiousoutput
application/vnd.sun.xml.writer.global; odt2txt --width=96 %s; copiousoutput
application/vnd.sun.xml.calc; odt2txt --width=96 %s; copiousoutput
application/vnd.sun.xml.calc.template; odt2txt --width=96 %s; copiousoutput
application/vnd.sun.xml.impress; odt2txt --width=96 %s; copiousoutput
application/vnd.sun.xml.impress.template; odt2txt --width=96 %s; copiousoutput
text/csv; less %s; copiousoutput
text/tab-separated-values; less %s; copiousoutput
application/x-bzip; tar --list %s; copiousoutput
application/x-bzip1; tar --list %s; copiousoutput
application/x-bzip-compressed-tar; tar --list %s; copiousoutput
application/x-bzip1-compressed-tar; tar --list %s; copiousoutput
application/x-tar; tar --list %s; copiousoutput
application/x-tarz; tar --list %s; copiousoutput
application/x-lzma; xz -l %s; copiousoutput
application/x-lzma-compressed-tar; xz -l %s; copiousoutput
application/x-xz; xz -l %s; copiousoutput
application/x-xz-compressed-tar; xz -l %s; copiousoutput
application/x-7z-compressed; 7z l %s; copiousoutput
application/x-7z-compressed-tar; tar --list %s; copiousoutput
application/x-zip; unzip -l %s; copiousoutput
application/x-zip-compressed; unzip -l %s; copiousoutput
application/zip; unzip -l %s; copiousoutput