Add html "unsafe" filter to work also without dante

If socksify (from dante) is not installed then the filter uses w3m
without it to render an html message part.

Signed-off-by: Jens Grassel <jens@wegtam.com>
Acked-by: Robin Jarry <robin@jarry.cc>
This commit is contained in:
Jens Grassel 2022-04-16 17:40:31 +02:00 committed by Robin Jarry
parent 029ff63929
commit 1ecee8efa5
2 changed files with 17 additions and 0 deletions

View File

@ -105,6 +105,7 @@ install: $(DOCS) aerc
install -m755 filters/colorize $(DESTDIR)$(SHAREDIR)/filters/colorize
install -m755 filters/hldiff $(DESTDIR)$(SHAREDIR)/filters/hldiff
install -m755 filters/html $(DESTDIR)$(SHAREDIR)/filters/html
install -m755 filters/html-unsafe $(DESTDIR)$(SHAREDIR)/filters/html-unsafe
install -m755 filters/plaintext $(DESTDIR)$(SHAREDIR)/filters/plaintext
install -m755 filters/show-ics-details.py $(DESTDIR)$(SHAREDIR)/filters/show-ics-details.py
install -m644 templates/new_message $(DESTDIR)$(SHAREDIR)/templates/new_message

16
filters/html-unsafe Executable file
View File

@ -0,0 +1,16 @@
#!/bin/sh
# aerc filter which runs w3m using socksify (from the dante package) to prevent
# any phoning home by rendered emails. If socksify is not installed then w3m is
# used without it.
if [ $(command -v socksify) ]; then
export SOCKS_SERVER="127.0.0.1:1"
PRE_CMD=socksify
else
PRE_CMD=""
fi
exec $PRE_CMD w3m \
-T text/html \
-cols $(tput cols) \
-dump \
-o display_image=false \
-o display_link_number=true