[neomutt-users] Selectively pipe emails to w3m

Kenneth Flak kennethflak at protonmail.com
Fri Jun 25 18:23:12 CEST 2021


Hi list,

Is there a way to selectively pipe emails to w3m or display the plain text version, based on a regexp pattern? I subscribe to the mailing list version of a discord forum, which sends mails in both plain text and html, and I would like to get the plain text version. Maybe I'm looking at it from the wrong angle... The relevant section of my .mailcap looks like this:

text/plain; nvim %s
text/html; browser-mutt.sh qutebrowser %s; test=test -n "$DISPLAY"
text/html; w3m -I %{charset} -v -F -T text/html -dump %s; copiousoutput

browser-mutt refers to this script:

#!/bin/bash

BROWSER=$1
CONTENT=$2

mkdir -p /tmp/neomutt-arch
FILENAME=$(basename $CONTENT).html

cp $CONTENT /tmp/neomutt-arch/$FILENAME
$BROWSER file:///tmp/neomutt-arch/$FILENAME &


Grateful for any help!
Kenneth

--
Roosna & Flak - Contemporary Dance & Music
Web: roosnaflak.com
Code: {github,gitlab}.com/kflak
Mastodon: @kf at sonomu.club



More information about the neomutt-users mailing list